Skip to content

Commit

Permalink
Infer a valid influence graph instead of erasing it.
Browse files Browse the repository at this point in the history
  • Loading branch information
daemontus committed Feb 29, 2024
1 parent a48e9bf commit c5a17fa
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions balm/interaction_graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from biodivine_aeon import Regulation, VariableId

import copy
from typing import cast

from biodivine_aeon import BooleanNetwork, RegulatoryGraph, SignType
Expand Down Expand Up @@ -148,8 +147,8 @@ def independent_cycles(
def cleanup_network(network: BooleanNetwork) -> BooleanNetwork:
"""
Prepare a `BooleanNetwork` object for use in a `SuccessionDiagram`. This mainly
checks that the network has no parameters and removes any constraints that could
add additional overhead to symbolic manipulation.
checks that the network has no parameters and fixes any static constraints to
ensure that they are actually correct.
"""

assert (
Expand All @@ -167,10 +166,4 @@ def cleanup_network(network: BooleanNetwork) -> BooleanNetwork:
f"Parametrized networks are not supported. Found implicit parameters: {names}."
)

network = copy.copy(network)
for reg in network.regulations():
reg["essential"] = False
reg["sign"] = None
assert network.ensure_regulation(reg) is not None

return network
return network.infer_valid_graph()

1 comment on commit c5a17fa

@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
balm
   control.py1141488%102, 114, 120, 124, 129, 138–154, 472, 475, 488
   interaction_graph_utils.py48590%6–8, 46, 164–165
   motif_avoidant.py152299%25, 121
   petri_net_translation.py1481193%18–22, 58, 94, 207–208, 232–233, 242, 346
   space_utils.py129497%25–27, 252, 278
   succession_diagram.py2471295%6, 163, 177, 185, 188, 205–206, 312, 439, 627, 665, 700
   symbolic_utils.py26388%10–12, 44
   trappist_core.py1833084%11–15, 45, 47, 82, 129, 195, 197, 199, 227–230, 234–236, 256–262, 320, 322, 352, 392, 394, 425, 454
balm/_sd_algorithms
   compute_attractor_seeds.py30197%8
   expand_attractor_seeds.py51590%6, 42, 97–102
   expand_bfs.py28196%6
   expand_dfs.py30197%6
   expand_minimal_spaces.py37295%6, 31
   expand_source_SCCs.py164696%19–21, 91, 101, 143, 287
   expand_to_target.py31390%6, 38, 43
TOTAL146310093% 

Tests Skipped Failures Errors Time
363 0 💤 0 ❌ 0 🔥 1m 10s ⏱️

Please sign in to comment.