bigraph-schema 0.0.42__tar.gz → 0.0.43__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.

Potentially problematic release.


This version of bigraph-schema might be problematic. Click here for more details.

Files changed (19) hide show
  1. {bigraph-schema-0.0.42/bigraph_schema.egg-info → bigraph-schema-0.0.43}/PKG-INFO +5 -1
  2. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/bigraph_schema/registry.py +8 -3
  3. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/bigraph_schema/type_system.py +15 -7
  4. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43/bigraph_schema.egg-info}/PKG-INFO +5 -1
  5. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/setup.py +1 -1
  6. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/AUTHORS.md +0 -0
  7. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/LICENSE +0 -0
  8. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/README.md +0 -0
  9. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/bigraph_schema/__init__.py +0 -0
  10. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/bigraph_schema/data.py +0 -0
  11. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/bigraph_schema/parse.py +0 -0
  12. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/bigraph_schema/protocols.py +0 -0
  13. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/bigraph_schema/react.py +0 -0
  14. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/bigraph_schema/units.py +0 -0
  15. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/bigraph_schema.egg-info/SOURCES.txt +0 -0
  16. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/bigraph_schema.egg-info/dependency_links.txt +0 -0
  17. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/bigraph_schema.egg-info/requires.txt +0 -0
  18. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/bigraph_schema.egg-info/top_level.txt +0 -0
  19. {bigraph-schema-0.0.42 → bigraph-schema-0.0.43}/setup.cfg +0 -0
@@ -1,10 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bigraph-schema
3
- Version: 0.0.42
3
+ Version: 0.0.43
4
4
  Summary: A serializable type schema for compositional systems biology
5
5
  Home-page: https://github.com/vivarium-collective/bigraph-schema
6
6
  Author: Eran Agmon, Ryan Spangler
7
7
  Author-email: agmon.eran@gmail.com, ryan.spangler@gmail.com
8
+ License: UNKNOWN
9
+ Platform: UNKNOWN
8
10
  Classifier: Development Status :: 3 - Alpha
9
11
  Classifier: Intended Audience :: Developers
10
12
  Classifier: License :: OSI Approved :: MIT License
@@ -52,3 +54,5 @@ This resource will guide you through the core concepts and methods, helping you
52
54
  ## License
53
55
 
54
56
  Bigraph-schema is open-source software released under the [Apache 2 License](https://github.com/vivarium-collective/bigraph-schema/blob/main/LICENSE).
57
+
58
+
@@ -1351,9 +1351,14 @@ class TypeRegistry(Registry):
1351
1351
  key: self.access(branch)
1352
1352
  for key, branch in schema.items()}
1353
1353
 
1354
- elif isinstance(schema, (tuple, int)):
1355
- if isinstance(schema, int):
1356
- schema = tuple([schema])
1354
+ elif isinstance(schema, int):
1355
+ return schema
1356
+
1357
+ elif isinstance(schema, tuple):
1358
+ # import ipdb; ipdb.set_trace()
1359
+
1360
+ # if isinstance(schema, int):
1361
+ # schema = tuple([schema])
1357
1362
 
1358
1363
  tuple_schema = {
1359
1364
  '_type': 'tuple',
@@ -1239,7 +1239,13 @@ class TypeSystem:
1239
1239
  if descendant is None:
1240
1240
  return ancestor is None
1241
1241
 
1242
- if '_type' in ancestor and ancestor['_type'] == 'any':
1242
+ if isinstance(ancestor, int):
1243
+ if isinstance(descendant, int):
1244
+ return ancestor == descendant
1245
+ else:
1246
+ return False
1247
+
1248
+ elif '_type' in ancestor and ancestor['_type'] == 'any':
1243
1249
  return True
1244
1250
 
1245
1251
  elif '_type' in descendant:
@@ -2112,7 +2118,7 @@ def serialize_map(schema, value, core=None):
2112
2118
  return {
2113
2119
  key: core.serialize(
2114
2120
  value_type,
2115
- subvalue)
2121
+ subvalue) if not is_schema_key(key) else subvalue
2116
2122
  for key, subvalue in value.items()}
2117
2123
 
2118
2124
 
@@ -2345,10 +2351,12 @@ def apply_array(schema, current, update, core):
2345
2351
 
2346
2352
 
2347
2353
  def serialize_array(schema, value, core):
2348
- """ Serialize numpy array to bytes """
2354
+ """ Serialize numpy array to list """
2349
2355
 
2350
2356
  if isinstance(value, dict):
2351
2357
  return value
2358
+ elif isinstance(value, str):
2359
+ import ipdb; ipdb.set_trace()
2352
2360
  else:
2353
2361
  array_data = 'string'
2354
2362
  dtype = value.dtype.name
@@ -2358,7 +2366,7 @@ def serialize_array(schema, value, core):
2358
2366
  array_data = 'float'
2359
2367
 
2360
2368
  return {
2361
- 'bytes': value.tobytes(),
2369
+ 'list': value.tolist(),
2362
2370
  'data': array_data,
2363
2371
  'shape': value.shape}
2364
2372
 
@@ -2399,9 +2407,9 @@ def deserialize_array(schema, encoded, core):
2399
2407
  core.parameters_for(
2400
2408
  schema['_shape']))
2401
2409
 
2402
- if 'bytes' in encoded:
2403
- return np.frombuffer(
2404
- encoded['bytes'],
2410
+ if 'list' in encoded:
2411
+ return np.array(
2412
+ encoded['list'],
2405
2413
  dtype=dtype).reshape(
2406
2414
  shape)
2407
2415
  else:
@@ -1,10 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bigraph-schema
3
- Version: 0.0.42
3
+ Version: 0.0.43
4
4
  Summary: A serializable type schema for compositional systems biology
5
5
  Home-page: https://github.com/vivarium-collective/bigraph-schema
6
6
  Author: Eran Agmon, Ryan Spangler
7
7
  Author-email: agmon.eran@gmail.com, ryan.spangler@gmail.com
8
+ License: UNKNOWN
9
+ Platform: UNKNOWN
8
10
  Classifier: Development Status :: 3 - Alpha
9
11
  Classifier: Intended Audience :: Developers
10
12
  Classifier: License :: OSI Approved :: MIT License
@@ -52,3 +54,5 @@ This resource will guide you through the core concepts and methods, helping you
52
54
  ## License
53
55
 
54
56
  Bigraph-schema is open-source software released under the [Apache 2 License](https://github.com/vivarium-collective/bigraph-schema/blob/main/LICENSE).
57
+
58
+
@@ -1,7 +1,7 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
3
 
4
- VERSION = '0.0.42'
4
+ VERSION = '0.0.43'
5
5
 
6
6
 
7
7
  with open("README.md", "r") as readme:
File without changes