Skip to content

Commit

Permalink
Copy the known stable motifs into the inner succession diagram instea…
Browse files Browse the repository at this point in the history
…d of re-computing.
  • Loading branch information
daemontus committed Aug 23, 2024
1 parent 1d17066 commit db5d1ea
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions biobalm/_sd_algorithms/expand_source_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,14 @@ def expand_source_blocks(
for block, block_nodes in minimal_blocks:
block_sd = sd.component_subdiagram(list(block), node)

# The succession diagram "restricted" to the considered block should have
# the same (restricted) successor nodes.
assert len(
block_sd.node_successors(block_sd.root(), compute=True)
) == len(block_nodes)
# Instead of expanding the inner succession diagram "normally", we can
# copy the successors/stable motifs that we already know. This doesn't
# make too much of a difference unless the maximal trap space computation
# is complex, but that is sometimes true, especially for large networks.
for succ_id in block_nodes:
succ_motif = sd.edge_stable_motif(node, succ_id, reduced=True)
block_sd._ensure_node(block_sd.root(), succ_motif) # type: ignore
block_sd.node_data(block_sd.root())["expanded"] = True

# We could also consider using `seeds` instead of `candidates` here. Ultimately, this
# matters very rarely. The reasoning for why we use `candidates` is that we can (almost)
Expand Down

1 comment on commit db5d1ea

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
biobalm
   _pint_reachability.py615018%24, 40–54, 69–93, 101–146
   control.py1141488%107, 119, 125, 129, 134, 143–159, 477, 480, 493
   interaction_graph_utils.py52688%11–13, 151–152, 222–223
   petri_net_translation.py1491193%22–26, 79, 136, 308–309, 333–334, 343, 452
   space_utils.py1322085%26–28, 104–110, 133–139, 347–350, 414, 462
   succession_diagram.py3796583%6, 120, 210–215, 228, 275–282, 386–393, 410–411, 421, 427, 543, 630–636, 752, 755, 873–891, 923, 933, 936, 976, 983, 1034, 1048, 1170, 1329, 1340, 1348, 1376, 1391, 1403, 1408, 1414
   symbolic_utils.py32584%10, 39–44, 100, 128
   trappist_core.py1842785%14–18, 55, 57, 92, 215, 217, 219, 247–250, 254–256, 276–282, 340, 342, 372, 420, 422
biobalm/_sd_algorithms
   expand_attractor_seeds.py60788%6, 28, 42, 109–114, 119
   expand_bfs.py28196%6
   expand_dfs.py30197%6
   expand_minimal_spaces.py37295%6, 31
   expand_source_SCCs.py1111686%11–13, 50, 69, 77, 82, 103, 112, 120, 131, 140, 143, 167, 179, 242–243
   expand_source_blocks.py1111388%11, 26, 41, 49, 54, 78, 128, 154, 163, 196, 206, 212, 221
   expand_to_target.py31390%6, 38, 43
biobalm/_sd_attractors
   attractor_candidates.py2659066%13–15, 26–27, 93, 101, 107–108, 130, 152, 187, 193–204, 223, 239–320, 325, 329, 335, 341, 356, 383, 388, 392, 398, 400–438, 511, 582–583, 684
   attractor_symbolic.py1141686%6–7, 75, 88–92, 103, 112, 144, 179, 191–193, 202, 230, 236
TOTAL197734782% 

Tests Skipped Failures Errors Time
359 0 💤 0 ❌ 0 🔥 1m 44s ⏱️

Please sign in to comment.