Closed jcrozum closed 11 months ago
I'm working on this in the usability-improvements branch.
I have implemented a summary function that reports the size and the info in 1b. I also added some import functions that wrap biodivine_aeon
imports. I also incorporated the SCC expansion into the SuccessionDiagram
class.
I have added pickle
support to the SuccessionDiagram
class, and I have added the succession diagram depth to the summary
function.
Note: I have renamed SuccessionDiagram.G
to SuccessionDiagram.dag
to conform to PEP standards (well, okay, it's mostly to get my linter to shut up about modifying "constants" that aren't really constant). In making this change, I realized that we still have some code that touches internals of the SuccessionDiagram
class that should probably only be accessed indirectly. Not a big deal, but if we do a code cleanup before full release, we might want to look into these cases.
I have partly addressed point 3, but instead of a class, I went with a type alias. I considered implementing a separate class, but I realized that we use these dictionaries all over the place, and I was concerned about the performance hit of wrapping the dictionary. The type alias now enforces that spaces are represented as balm.typing.space_type = dict[str, Literal[0,1]]
(previously it was dict[str, int]
. Note that pyeda
has a Literal
class that clashes with the Python's typing.Literal
(this is in the standard library). I have therefore imported the pyeda
version as PyedaLiteral
when we need it. In the code, at least as far as type hints are concerned, Boolean states are just a special case of Boolean spaces that have only one element.
Edit: I have changed the type alias names to be more conventional; the space type is now balm.typing.BooleanSpace
A few ideas for how to improve UX:
SuccessionDiagram
object. We want to know a. size and depth b. a list of attractor seed states and the trap spaces they are in (if not fixed points), as well as which (if any) are motif-avoidant c. whether the SD is complete or, e.g., just an SCC expansion or hasn't been checked for faithfulness/univocalitybiodivine_aeon
to import rules.