bigraph-schema 0.0.17__tar.gz → 0.0.18__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bigraph-schema
3
- Version: 0.0.17
3
+ Version: 0.0.18
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
@@ -204,8 +204,9 @@ class TypeSystem:
204
204
 
205
205
  state[key] = subupdate
206
206
  else:
207
- raise Exception(f'trying to apply update\n {update}\nto state\n {state}\nwith '
208
- f'schema\n{schema}, but the update is not a dict')
207
+ raise Exception(
208
+ f'trying to apply update\n {update}\nto state\n {state}\n'
209
+ f'with schema\n{schema}, but the update is not a dict')
209
210
 
210
211
  return state
211
212
 
@@ -244,8 +245,9 @@ class TypeSystem:
244
245
 
245
246
  state[key] = subupdate
246
247
  else:
247
- raise Exception(f'trying to apply update\n {update}\nto state\n {state}\nwith '
248
- f'schema\n{schema}, but the update is not a dict')
248
+ raise Exception(
249
+ f'trying to apply update\n {update}\nto state\n {state}\n'
250
+ f'with schema\n{schema}, but the update is not a dict')
249
251
 
250
252
  return state
251
253
 
@@ -294,6 +296,9 @@ class TypeSystem:
294
296
  raise Exception(
295
297
  f'deserialize function not in the registry: {deserialize}')
296
298
 
299
+ if encoded is None:
300
+ encoded = self.default(schema)
301
+
297
302
  return deserialize_function(
298
303
  encoded,
299
304
  found.get('_bindings'),
@@ -439,15 +444,15 @@ class TypeSystem:
439
444
  result = get_path(instance, list(path) + list(wires))
440
445
  elif isinstance(wires, dict):
441
446
  result = {}
442
- for port_key in wires:
443
- if port_key in instance:
447
+ for port_key, port_path in wires.items():
448
+ if isinstance(port_path, dict) or get_path(instance, port_path) is not None:
444
449
  inner_view = self.view(
445
450
  schema[port_key],
446
- wires[port_key],
451
+ port_path,
447
452
  path,
448
453
  instance)
449
454
 
450
- if inner_view:
455
+ if inner_view is not None:
451
456
  result[port_key] = inner_view
452
457
  else:
453
458
  raise Exception(f'trying to project state with these ports:\n{schema}\nbut not sure what these wires are:\n{wires}')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bigraph-schema
3
- Version: 0.0.17
3
+ Version: 0.0.18
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
@@ -1,7 +1,7 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
3
 
4
- VERSION = '0.0.17'
4
+ VERSION = '0.0.18'
5
5
 
6
6
 
7
7
  with open("README.md", "r") as readme:
File without changes