Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofSuccessionDiagram.from_rules
, which takes aformat
argument ("bnet"
by default). Thefrom_file
function is kept separate.SuccessionDiagram.node_...
functions are replaced by aSuccessionDiagram.node_data
function that returns the node dictionary, cast to aNodeData
object that inherits fromTypedDict
. 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 accesssd.node_data(x)["depth"]
instead ofsd.node_depth(x)
. Replaced functions arenode_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 thecompute
option)node_successors
(because it needs network info)node_is_minimal
(again, needs network info)SuccessionDiagram.expanded_attractor_seeds
for quickly getting attractors out of the object.