process-bigraph 0.0.34__tar.gz → 0.0.35__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.
Files changed (22) hide show
  1. {process-bigraph-0.0.34/process_bigraph.egg-info → process-bigraph-0.0.35}/PKG-INFO +1 -6
  2. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph/composite.py +6 -6
  3. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph/tests.py +13 -0
  4. {process-bigraph-0.0.34 → process-bigraph-0.0.35/process_bigraph.egg-info}/PKG-INFO +1 -6
  5. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/setup.py +1 -1
  6. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/AUTHORS.md +0 -0
  7. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/LICENSE +0 -0
  8. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/README.md +0 -0
  9. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph/__init__.py +0 -0
  10. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph/emitter.py +0 -0
  11. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph/experiments/__init__.py +0 -0
  12. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph/experiments/minimal_gillespie.py +0 -0
  13. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph/process_types.py +0 -0
  14. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph/processes/__init__.py +0 -0
  15. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph/processes/growth_division.py +0 -0
  16. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph/processes/parameter_scan.py +0 -0
  17. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph/protocols.py +0 -0
  18. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph.egg-info/SOURCES.txt +0 -0
  19. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph.egg-info/dependency_links.txt +0 -0
  20. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph.egg-info/requires.txt +0 -0
  21. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/process_bigraph.egg-info/top_level.txt +0 -0
  22. {process-bigraph-0.0.34 → process-bigraph-0.0.35}/setup.cfg +0 -0
@@ -1,12 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: process-bigraph
3
- Version: 0.0.34
4
- Summary: UNKNOWN
3
+ Version: 0.0.35
5
4
  Home-page: https://github.com/vivarium-collective/process-bigraph
6
5
  Author: Ryan Spangler, Eran Agmon
7
6
  Author-email: ryan.spangler@gmail.com, agmon.eran@gmail.com
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
7
  Classifier: Development Status :: 3 - Alpha
11
8
  Classifier: Intended Audience :: Developers
12
9
  Classifier: License :: OSI Approved :: MIT License
@@ -73,5 +70,3 @@ diagraph of a whole-cell E. coli model.
73
70
  ## License
74
71
 
75
72
  Bigraph-schema is open-source software released under the [Apache 2 License](https://github.com/vivarium-collective/process-bigraph/blob/main/LICENSE).
76
-
77
-
@@ -401,6 +401,8 @@ class Composite(Process):
401
401
  def load(cls, path, core=None):
402
402
  with open(path) as data:
403
403
  document = json.load(data)
404
+ composition = document['composition']
405
+ document['composition'] = core.deserialize('schema', composition)
404
406
 
405
407
  composite = cls(
406
408
  document,
@@ -456,10 +458,6 @@ class Composite(Process):
456
458
  self.composition,
457
459
  edge_state)
458
460
 
459
- # self.state = deep_merge(
460
- # self.state,
461
- # edge_state)
462
-
463
461
  # TODO: call validate on this composite, not just check
464
462
  # assert self.core.validate(
465
463
  # self.composition,
@@ -511,6 +509,9 @@ class Composite(Process):
511
509
  self.composition,
512
510
  self.state)
513
511
 
512
+ def serialize_schema(self):
513
+ return self.core.serialize('schema', self.composition)
514
+
514
515
  def save(self,
515
516
  filename='composite.json',
516
517
  outdir='out',
@@ -531,8 +532,7 @@ class Composite(Process):
531
532
  document['state'] = serialized_state
532
533
 
533
534
  if schema:
534
- serialized_schema = self.core.representation(
535
- self.composition)
535
+ serialized_schema = self.serialize_schema()
536
536
  document['composition'] = serialized_schema
537
537
 
538
538
  # save the dictionary to a JSON file
@@ -610,6 +610,19 @@ def test_grow_divide(core):
610
610
  assert '0_0_0_0_1' in composite.state['environment']
611
611
  assert composite.state['environment']['0_0_0_0_1']['mass'] == composite.state['environment']['0_0_0_0_1']['grow_divide']['instance'].state['mass']
612
612
 
613
+ # check recursive schema reference
614
+ assert (id(composite.composition['environment']['_value']['grow_divide']) ==
615
+ id(composite.composition['environment']['_value']['grow_divide']['_outputs']['environment']['_value']['grow_divide']))
616
+
617
+ composite.save('test_grow_divide_saved.json')
618
+
619
+ c2 = Composite.load(
620
+ 'out/test_grow_divide_saved.json',
621
+ core=core)
622
+
623
+ assert (id(composite.composition['environment']['_value']['grow_divide']) ==
624
+ id(composite.composition['environment']['_value']['grow_divide']['_outputs']['environment']['_value']['grow_divide']))
625
+
613
626
 
614
627
  def test_gillespie_composite(core):
615
628
  composite_schema = {
@@ -1,12 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: process-bigraph
3
- Version: 0.0.34
4
- Summary: UNKNOWN
3
+ Version: 0.0.35
5
4
  Home-page: https://github.com/vivarium-collective/process-bigraph
6
5
  Author: Ryan Spangler, Eran Agmon
7
6
  Author-email: ryan.spangler@gmail.com, agmon.eran@gmail.com
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
7
  Classifier: Development Status :: 3 - Alpha
11
8
  Classifier: Intended Audience :: Developers
12
9
  Classifier: License :: OSI Approved :: MIT License
@@ -73,5 +70,3 @@ diagraph of a whole-cell E. coli model.
73
70
  ## License
74
71
 
75
72
  Bigraph-schema is open-source software released under the [Apache 2 License](https://github.com/vivarium-collective/process-bigraph/blob/main/LICENSE).
76
-
77
-
@@ -2,7 +2,7 @@ import re
2
2
  from setuptools import setup, find_packages
3
3
 
4
4
 
5
- VERSION = '0.0.34'
5
+ VERSION = '0.0.35'
6
6
 
7
7
 
8
8
  with open("README.md", "r") as readme: