Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Succession api and docs #106

Merged
merged 8 commits into from
Mar 4, 2024
Merged

Succession api and docs #106

merged 8 commits into from
Mar 4, 2024

Conversation

jcrozum
Copy link
Owner

@jcrozum jcrozum commented Mar 1, 2024

This PR updates much of the SuccessionDiagram documentation and API (according to #93).

Changes to the API are reflected in other files (hence the large number of changed files).

For us, the main changes are

  • SuccessionDiagram.from_bnet and similar are removed in favor of SuccessionDiagram.from_rules, which takes a format argument ("bnet" by default). The from_file function is kept separate.
  • Many of the SuccessionDiagram.node_... functions are replaced by a SuccessionDiagram.node_data function that returns the node dictionary, cast to a NodeData object that inherits from TypedDict. This should not have any impact on performance, since we were accessing that node dictionary anyway (just casting the values instead of the whole thing). Now, for example, you should access sd.node_data(x)["depth"] instead of sd.node_depth(x). Replaced functions are
    • node_depth -> "depth"
    • node_restricted_petri_net -> "petri_net"
    • node_is_expanded -> "expanded"
    • node_space -> "space"
    • "attractors" is included (no function for this previously)
      Functions NOT replaced (yet?):
    • node_nfvs (actually a network thing, not an sd-node thing)
    • node_attractor_seeds (because of the compute option)
    • node_successors (because it needs network info)
    • node_is_minimal (again, needs network info)
  • I added SuccessionDiagram.expanded_attractor_seeds for quickly getting attractors out of the object.

Copy link

github-actions bot commented Mar 1, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
balm
   control.py1141488%102, 114, 120, 124, 129, 138–154, 472, 475, 488
   interaction_graph_utils.py30487%6–8, 145–146
   motif_avoidant.py152299%25, 124
   petri_net_translation.py1481193%18–22, 58, 94, 207–208, 232–233, 242, 346
   space_utils.py129497%25–27, 252, 278
   succession_diagram.py2571694%6, 184–189, 197, 257–258, 268, 274, 390, 580, 772, 810, 847
   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
TOTAL147110393% 

Tests Skipped Failures Errors Time
361 0 💤 0 ❌ 0 🔥 49.761s ⏱️

Copy link
Collaborator

@daemontus daemontus left a comment

Choose a reason for hiding this comment

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

I see no immediate issues. We can merge this :)

@jcrozum jcrozum merged commit 0da3e96 into main Mar 4, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants