Skip to content

Conversation

@dachengx
Copy link
Collaborator

@dachengx dachengx commented Jul 3, 2025

What is the problem / what does the code in this PR do

The dependency structure forms a directed acyclic graph (DAG), allowing us to define a topological level for each node, as implemented in #896. This new PR extends that by also computing the shortest dependency path within the DAG:

  1. Topological level: level(node) = 1 + max(level(dep)) Represents the longest path from any source node to the given node — useful for understanding how late a node occurs in the dependency chain.
  2. Shortest dependency path: level(node) = 1 + min(level(dep)) Captures the minimum number of steps from a source node to the current node, identifying the shallowest point of dependency.

By combining both metrics, we can better analyze the structure of the dependency tree. In particular, we can identify key nodes that act as "connectors" or "cut points": if we divide the tree at such a node, one of the resulting subtrees will contain all nodes that depend on it, effectively capturing a full dependency closure.

That node is the node with a unique topological level and shortest dependency path among all nodes.

Previously, in reprocessing, only data_types that depend on one depends_on are allowed in per-chunk storage. Now we allow multiple depends_on, if all depends_on eventually depend on a single data_type, and all intermediate data_types are not stored.

Can you briefly describe how it works?

Can you give a minimal working example (or illustrate with a figure)?

Please include the following if applicable:

  • Update the docstring(s)
  • Update the documentation
  • Tests to check the (new) code is working as desired.
  • Does it solve one of the open issues on github?

Please make sure that all automated tests have passed before asking for a review (you can save the PR as a draft otherwise).

@dachengx dachengx added the enhancement New feature or request label Jul 3, 2025
@coveralls
Copy link

Coverage Status

coverage: 88.956% (-0.1%) from 89.063%
when pulling 7dad875 on dag_shortest_path
into 328dc07 on master.

dachengx added a commit to XENONnT/straxen that referenced this pull request Jul 4, 2025
dachengx added a commit to XENONnT/outsource that referenced this pull request Jul 4, 2025
dachengx added a commit to XENONnT/outsource that referenced this pull request Jul 5, 2025
@dachengx dachengx merged commit 7817aff into master Jul 5, 2025
7 checks passed
@dachengx dachengx deleted the dag_shortest_path branch July 5, 2025 21:03
dachengx added a commit to XENONnT/straxen that referenced this pull request Jul 5, 2025
dachengx added a commit that referenced this pull request Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants