Skip to content

Commit

Permalink
Apply auto format.
Browse files Browse the repository at this point in the history
  • Loading branch information
daemontus committed Jun 4, 2024
1 parent c79427a commit 047d448
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
10 changes: 7 additions & 3 deletions biobalm/_sd_algorithms/expand_source_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def expand_source_blocks(
# can be either in this node, or in any of the child nodes. If a clean block
# is found, we know that it is safe to expand it without "missing" any MAAs.
clean_block_found = False
for (block, block_nodes) in minimal_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
Expand All @@ -190,7 +190,9 @@ def expand_source_blocks(
)
if len(block_sd_candidates) == 0:
if sd.config["debug"]:
print(f" > [{node}] Found clean block with no MAAs ({len(block_nodes)}): {block_nodes}")
print(
f" > [{node}] Found clean block with no MAAs ({len(block_nodes)}): {block_nodes}"
)
clean_block_found = True
next_level = next_level | set(block_nodes)
sd.node_data(node)["attractor_seeds"] = []
Expand All @@ -204,7 +206,9 @@ def expand_source_blocks(
if not clean_block_found:
# If all blocks have MAAs, we expand all successors.
if sd.config["debug"]:
print(f" > [{node}] No clean block found. Expanding all {len(successors)} successors.")
print(
f" > [{node}] No clean block found. Expanding all {len(successors)} successors."
)
next_level = next_level | set(successors)

current_level = next_level
Expand Down
1 change: 1 addition & 0 deletions tests/source_SCC_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from biobalm import SuccessionDiagram
from biobalm._sd_algorithms.expand_source_SCCs import expand_source_SCCs


def expansion(bn: BooleanNetwork):
sd = SuccessionDiagram(bn)
fully_expanded = expand_source_SCCs(sd, check_maa=False)
Expand Down
9 changes: 8 additions & 1 deletion tests/source_block_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@

from biobalm import SuccessionDiagram


def expansion(bn: BooleanNetwork):
sd = SuccessionDiagram(bn)
fully_expanded = sd.expand_block(find_motif_avoidant_attractors=False)
assert fully_expanded

return bn.variable_count(), len(sd), len(list(sd.expanded_ids())), sd.depth(), len(sd.minimal_trap_spaces())
return (
bn.variable_count(),
len(sd),
len(list(sd.expanded_ids())),
sd.depth(),
len(sd.minimal_trap_spaces()),
)


def test_expansion():
Expand Down

1 comment on commit 047d448

@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, 206–207
   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.py1081388%11, 26, 41, 49, 54, 78, 128, 154, 163, 193, 203, 209, 218
   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
TOTAL197434782% 

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

Please sign in to comment.