process-bigraph 0.0.38__tar.gz → 0.0.39__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/.gitignore +2 -0
- {process-bigraph-0.0.38/process_bigraph.egg-info → process-bigraph-0.0.39}/PKG-INFO +1 -1
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/composite.py +23 -5
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/tests.py +6 -1
- {process-bigraph-0.0.38 → process-bigraph-0.0.39/process_bigraph.egg-info}/PKG-INFO +1 -1
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph.egg-info/SOURCES.txt +1 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph.egg-info/requires.txt +1 -3
- process-bigraph-0.0.39/pyproject.toml +19 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/setup.py +1 -1
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/.github/workflows/notebook_to_html.yml +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/.github/workflows/pytest.yml +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/AUTHORS.md +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/CLA.md +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/CODE_OF_CONDUCT.md +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/CONTRIBUTING.md +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/LICENSE +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/README.md +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/doc/_static/process-bigraph.png +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/notebooks/process-bigraphs.ipynb +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/notebooks/visualize_processes.ipynb +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/__init__.py +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/emitter.py +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/experiments/__init__.py +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/experiments/minimal_gillespie.py +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/process_types.py +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/processes/__init__.py +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/processes/growth_division.py +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/processes/parameter_scan.py +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/protocols.py +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph.egg-info/dependency_links.txt +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph.egg-info/top_level.txt +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/pytest.ini +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/release.sh +0 -0
- {process-bigraph-0.0.38 → process-bigraph-0.0.39}/setup.cfg +0 -0
|
@@ -379,6 +379,14 @@ class Defer:
|
|
|
379
379
|
self.defer.get(),
|
|
380
380
|
self.args)
|
|
381
381
|
|
|
382
|
+
def match_star_path(path, star_path):
|
|
383
|
+
compare = zip(path, star_path)
|
|
384
|
+
for element, star_element in compare:
|
|
385
|
+
if element != star_element:
|
|
386
|
+
if star_element != "*":
|
|
387
|
+
return False
|
|
388
|
+
return True
|
|
389
|
+
|
|
382
390
|
|
|
383
391
|
class Composite(Process):
|
|
384
392
|
"""
|
|
@@ -487,13 +495,16 @@ class Composite(Process):
|
|
|
487
495
|
|
|
488
496
|
def build_step_network(self):
|
|
489
497
|
self.step_triggers = {}
|
|
498
|
+
self.star_triggers = {}
|
|
490
499
|
for step_path, step in self.step_paths.items():
|
|
491
500
|
step_triggers = find_step_triggers(
|
|
492
501
|
step_path, step)
|
|
493
502
|
self.step_triggers = merge_collections(
|
|
494
503
|
self.step_triggers,
|
|
495
504
|
step_triggers)
|
|
496
|
-
|
|
505
|
+
for trigger in self.step_triggers:
|
|
506
|
+
if "*" in trigger:
|
|
507
|
+
self.star_triggers[trigger] = self.step_triggers[trigger]
|
|
497
508
|
self.steps_run = set([])
|
|
498
509
|
|
|
499
510
|
self.step_dependencies, self.node_dependencies = build_step_network(
|
|
@@ -571,6 +582,12 @@ class Composite(Process):
|
|
|
571
582
|
'process_bigraph.composite.Step')
|
|
572
583
|
|
|
573
584
|
|
|
585
|
+
def clean_front(self, state):
|
|
586
|
+
self.find_instance_paths(state)
|
|
587
|
+
|
|
588
|
+
# import ipdb; ipdb.set_trace()
|
|
589
|
+
|
|
590
|
+
|
|
574
591
|
def inputs(self):
|
|
575
592
|
return self.process_schema.get('inputs', {})
|
|
576
593
|
|
|
@@ -756,8 +773,7 @@ class Composite(Process):
|
|
|
756
773
|
self.bridge_updates.append(
|
|
757
774
|
bridge_update)
|
|
758
775
|
|
|
759
|
-
self.
|
|
760
|
-
self.state)
|
|
776
|
+
self.clean_front(self.state)
|
|
761
777
|
|
|
762
778
|
return update_paths
|
|
763
779
|
|
|
@@ -896,6 +912,10 @@ class Composite(Process):
|
|
|
896
912
|
paths = explode_path(update_path)
|
|
897
913
|
for path in paths:
|
|
898
914
|
step_paths = self.step_triggers.get(path, [])
|
|
915
|
+
if self.star_triggers:
|
|
916
|
+
for star_trigger, star_steps in self.star_triggers.items():
|
|
917
|
+
if match_star_path(path, star_trigger):
|
|
918
|
+
step_paths.extend(star_steps)
|
|
899
919
|
for step_path in step_paths:
|
|
900
920
|
if step_path is not None and step_path not in self.steps_run:
|
|
901
921
|
steps_to_run.append(step_path)
|
|
@@ -931,5 +951,3 @@ class Composite(Process):
|
|
|
931
951
|
self.bridge_updates = []
|
|
932
952
|
|
|
933
953
|
return updates
|
|
934
|
-
|
|
935
|
-
|
|
@@ -7,7 +7,7 @@ import random
|
|
|
7
7
|
from bigraph_schema import default
|
|
8
8
|
from process_bigraph import register_types
|
|
9
9
|
|
|
10
|
-
from process_bigraph.composite import Process, Step, Composite, merge_collections
|
|
10
|
+
from process_bigraph.composite import Process, Step, Composite, merge_collections, match_star_path
|
|
11
11
|
|
|
12
12
|
from process_bigraph.processes.growth_division import grow_divide_agent
|
|
13
13
|
from process_bigraph.process_types import ProcessTypes
|
|
@@ -875,6 +875,10 @@ def test_stochastic_deterministic_composite(core):
|
|
|
875
875
|
# TODO make the demo for a hybrid stochastic/deterministic simulator
|
|
876
876
|
pass
|
|
877
877
|
|
|
878
|
+
def test_match_star_path(core):
|
|
879
|
+
assert match_star_path(["first", "list", "test"], ["first", "*", "test"])
|
|
880
|
+
assert not match_star_path(["first", "list", "tent"], ["first", "*", "test"])
|
|
881
|
+
assert match_star_path(["first", "list", "test"], ["first", "list", "test"])
|
|
878
882
|
|
|
879
883
|
if __name__ == '__main__':
|
|
880
884
|
core = ProcessTypes()
|
|
@@ -900,3 +904,4 @@ if __name__ == '__main__':
|
|
|
900
904
|
test_merge_schema(core)
|
|
901
905
|
test_grow_divide(core)
|
|
902
906
|
test_star_update(core)
|
|
907
|
+
test_match_star_path(core)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "process-bigraph"
|
|
3
|
+
version = "0.0.39"
|
|
4
|
+
description = ""
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = "==3.12.9"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"bigraph-schema",
|
|
9
|
+
"matplotlib",
|
|
10
|
+
"pytest"
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
[tool.setuptools]
|
|
14
|
+
packages = [
|
|
15
|
+
"process_bigraph"
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
[tool.uv.sources]
|
|
19
|
+
bigraph-schema = { path = "../bigraph-schema", editable = true }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/experiments/minimal_gillespie.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/processes/growth_division.py
RENAMED
|
File without changes
|
{process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph/processes/parameter_scan.py
RENAMED
|
File without changes
|
|
File without changes
|
{process-bigraph-0.0.38 → process-bigraph-0.0.39}/process_bigraph.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|