Commit d24e365e authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

interaction graph: Update doc

parent 5b3e2eda
......@@ -74,8 +74,8 @@ def get_solutions_and_related_places_from_file(file_path):
.. code-block:: python
(("Ax", "Bx"): {"n3", "Bx"})
:rtype: <dict <tuple>: <set>>
(("Ax", "Bx"), {"n3", "Bx"})
:rtype: <generator <tuple <tuple>, <set>>>
decomp_solutions = json.load(open(file_path))
......@@ -118,8 +118,8 @@ def get_solutions_and_related_places(path):
.. code-block:: python
(("Ax", "Bx"): {"n3", "Bx"})
:rtype: <dict <tuple>: <set>>
(("Ax", "Bx"), {"n3", "Bx"})
:rtype: <generator <tuple <tuple>, <set>>>
# Check valid input file/directory
......@@ -142,10 +142,37 @@ def get_solutions_and_related_places(path):
def filter_trajectories(trajectories, molecules_of_interest):
"""Get solutions and count frontier places related to the given molecules
of interest.
binary_interactions: binary_interactions[searched_molec] += Counter(sol)
compteur avec pour clés les entités des solutions liées à 1 molec d'intéret et avec leurs occurences pour valeurs
:param trajectories: A generator of tuples with tuple of frontier places as
keys and set of places involved in transitions as values.
.. code-block:: python
(("Ax", "Bx"), {"n3", "Bx"})
:param molecules_of_interest: Iterable of molecules of interest.
:type trajectories: <generator <tuple <tuple>, <set>>>
:type molecules_of_interest: <tuple>
:return: A tuple of all solutions related to the molecules of interest,
and a dictionary of related frontier places.
.. code-block:: python
# For molecules of interest "A" and "B"
((("frontier_1", "frontier_2", "frontier_3"),),
{"A": {
"frontier_1": 1,
"frontier_2": 1,
"B": {
"frontier_3": 1,
:rtype: <tuple <tuple <tuple <str>>>, <dict <str>: <Counter <str>: <int>>>>
molecules_of_interest = set(molecules_of_interest)
......@@ -157,7 +184,7 @@ def filter_trajectories(trajectories, molecules_of_interest):
We assume that the molecules of interest **are** in the trajectories.
We associate with each entity the trajectories containing them.
:param trajectory_places: A trajectory: A set of entities.
:param trajectory_places: A trajectory: i.e a set of entities.
:type trajectory_places: <set>
:return: True if an entity of interest is found in the given trajectory.
:rtype: <boolean>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment