bigraph-schema 0.0.51__tar.gz → 0.0.52__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.
- {bigraph-schema-0.0.51/bigraph_schema.egg-info → bigraph-schema-0.0.52}/PKG-INFO +1 -1
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema/__init__.py +1 -1
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema/edge.py +0 -5
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema/registry.py +3 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema/type_functions.py +14 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema/type_system.py +5 -4
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52/bigraph_schema.egg-info}/PKG-INFO +1 -1
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/setup.py +1 -1
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/AUTHORS.md +0 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/LICENSE +0 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/README.md +0 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema/parse.py +0 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema/protocols.py +0 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema/type_system_tests.py +0 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema/units.py +0 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema/utilities.py +0 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema.egg-info/SOURCES.txt +0 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema.egg-info/dependency_links.txt +0 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema.egg-info/requires.txt +0 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema.egg-info/top_level.txt +0 -0
- {bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/setup.cfg +0 -0
|
@@ -3,4 +3,4 @@ from bigraph_schema.registry import (
|
|
|
3
3
|
strip_schema_keys, type_parameter_key, non_schema_keys, set_path, transform_path)
|
|
4
4
|
from bigraph_schema.utilities import get_path, visit_method
|
|
5
5
|
from bigraph_schema.edge import Edge
|
|
6
|
-
from bigraph_schema.type_system import TypeSystem, type_schema_keys
|
|
6
|
+
from bigraph_schema.type_system import TypeSystem, type_schema_keys, resolve_path
|
|
@@ -32,6 +32,9 @@ def deep_merge(dct, merge_dct):
|
|
|
32
32
|
dct = {}
|
|
33
33
|
if merge_dct is None:
|
|
34
34
|
merge_dct = {}
|
|
35
|
+
if not isinstance(merge_dct, dict):
|
|
36
|
+
return merge_dct
|
|
37
|
+
|
|
35
38
|
for k, v in merge_dct.items():
|
|
36
39
|
if (k in dct and isinstance(dct[k], dict)
|
|
37
40
|
and isinstance(merge_dct[k], collections.abc.Mapping)):
|
|
@@ -1915,6 +1915,18 @@ def generate_any(core, schema, state, top_schema=None, top_state=None, path=None
|
|
|
1915
1915
|
def generate_quote(core, schema, state, top_schema=None, top_state=None, path=None):
|
|
1916
1916
|
return schema, state, top_schema, top_state
|
|
1917
1917
|
|
|
1918
|
+
|
|
1919
|
+
def default_quote(schema, core):
|
|
1920
|
+
if '_default' in schema:
|
|
1921
|
+
return copy.deepcopy(schema['_default'])
|
|
1922
|
+
else:
|
|
1923
|
+
return None
|
|
1924
|
+
|
|
1925
|
+
|
|
1926
|
+
def deserialize_quote(schema, state, core):
|
|
1927
|
+
return state
|
|
1928
|
+
|
|
1929
|
+
|
|
1918
1930
|
def generate_map(core, schema, state, top_schema=None, top_state=None, path=None):
|
|
1919
1931
|
schema = schema or {}
|
|
1920
1932
|
state = state or core.default(schema)
|
|
@@ -2516,6 +2528,8 @@ registry_types = {
|
|
|
2516
2528
|
|
|
2517
2529
|
'quote': {
|
|
2518
2530
|
'_type': 'quote',
|
|
2531
|
+
'_deserialize': deserialize_quote,
|
|
2532
|
+
'_default': default_quote,
|
|
2519
2533
|
'_generate': generate_quote,
|
|
2520
2534
|
'_sort': sort_quote,
|
|
2521
2535
|
'_description': 'protect a schema from generation, ie in the config for a nested composite which has type information we only want to evaluate inside of the composite'},
|
|
@@ -609,7 +609,6 @@ class TypeSystem(Registry):
|
|
|
609
609
|
* intended to be the inverse of parse_expression()
|
|
610
610
|
'''
|
|
611
611
|
|
|
612
|
-
|
|
613
612
|
path = path or []
|
|
614
613
|
parents = parents or []
|
|
615
614
|
schema_id = id(schema)
|
|
@@ -1095,6 +1094,8 @@ class TypeSystem(Registry):
|
|
|
1095
1094
|
|
|
1096
1095
|
|
|
1097
1096
|
def apply_update(self, schema, state, update):
|
|
1097
|
+
schema = self.access(schema)
|
|
1098
|
+
|
|
1098
1099
|
if isinstance(update, dict) and '_react' in update:
|
|
1099
1100
|
new_state = self.react(
|
|
1100
1101
|
schema,
|
|
@@ -1143,7 +1144,7 @@ class TypeSystem(Registry):
|
|
|
1143
1144
|
for key, branch in update.items():
|
|
1144
1145
|
if key not in schema:
|
|
1145
1146
|
raise Exception(
|
|
1146
|
-
f'trying to update a key that is not in the schema'
|
|
1147
|
+
f'trying to update a key that is not in the schema '
|
|
1147
1148
|
f'for state: {key}\n{state}\nwith schema:\n{schema}')
|
|
1148
1149
|
else:
|
|
1149
1150
|
subupdate = self.apply_update(
|
|
@@ -1312,6 +1313,8 @@ class TypeSystem(Registry):
|
|
|
1312
1313
|
returns the top_schema and top_state
|
|
1313
1314
|
'''
|
|
1314
1315
|
|
|
1316
|
+
path = resolve_path(path)
|
|
1317
|
+
|
|
1315
1318
|
if len(path) == 0:
|
|
1316
1319
|
# deal with paths of length 0
|
|
1317
1320
|
# this should never happen?
|
|
@@ -1356,8 +1359,6 @@ class TypeSystem(Registry):
|
|
|
1356
1359
|
result_state)
|
|
1357
1360
|
|
|
1358
1361
|
else:
|
|
1359
|
-
path = resolve_path(path)
|
|
1360
|
-
|
|
1361
1362
|
head = path[0]
|
|
1362
1363
|
tail = path[1:]
|
|
1363
1364
|
|
|
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
|
{bigraph-schema-0.0.51 → bigraph-schema-0.0.52}/bigraph_schema.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|