From 276b6340fb41428971702402e1edc1f3463fbbb0 Mon Sep 17 00:00:00 2001 From: Ryan Spangler Date: Fri, 13 Dec 2024 15:26:59 -0800 Subject: [PATCH] apply -> apply_update --- bigraph_schema/__init__.py | 2 +- bigraph_schema/type_functions.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bigraph_schema/__init__.py b/bigraph_schema/__init__.py index 20da09a..0ef6e1c 100644 --- a/bigraph_schema/__init__.py +++ b/bigraph_schema/__init__.py @@ -3,4 +3,4 @@ strip_schema_keys, type_parameter_key, non_schema_keys, set_path, transform_path) from bigraph_schema.utilities import get_path, visit_method from bigraph_schema.edge import Edge -from bigraph_schema.type_system import TypeSystem +from bigraph_schema.type_system import TypeSystem, type_schema_keys diff --git a/bigraph_schema/type_functions.py b/bigraph_schema/type_functions.py index 0718318..2f247e5 100644 --- a/bigraph_schema/type_functions.py +++ b/bigraph_schema/type_functions.py @@ -116,7 +116,7 @@ def apply_tuple(schema, current, update, core): result = [] for parameter, current_value, update_value in zip(parameters, current, update): - element = core.apply( + element = core.apply_update( parameter, current_value, update_value) @@ -143,7 +143,7 @@ def apply_union(schema, current, update, core): # TODO: throw an exception if current_type is incompatible with update_type - return core.apply( + return core.apply_update( update_type, current, update) @@ -215,13 +215,13 @@ def apply_tree(schema, current, update, core): if key in schema: subschema = schema[key] - current[key] = core.apply( + current[key] = core.apply_update( subschema, current.get(key), branch) elif core.check(leaf_type, branch): - current[key] = core.apply( + current[key] = core.apply_update( leaf_type, current.get(key), branch) @@ -232,7 +232,7 @@ def apply_tree(schema, current, update, core): return current elif core.check(leaf_type, current): - return core.apply( + return core.apply_update( leaf_type, current, update) @@ -308,7 +308,7 @@ def apply_map(schema, current, update, core=None): # raise Exception(f'trying to update a key that does not exist:\n value: {current}\n update: {update}') else: - result[key] = core.apply( + result[key] = core.apply_update( value_type, result[key], update_value) @@ -323,7 +323,7 @@ def apply_maybe(schema, current, update, core): schema, 'value') - return core.apply( + return core.apply_update( value_type, current, update) @@ -334,12 +334,12 @@ def apply_path(schema, current, update, core): def apply_edge(schema, current, update, core): result = current.copy() - result['inputs'] = core.apply( + result['inputs'] = core.apply_update( 'wires', current.get('inputs'), update.get('inputs')) - result['outputs'] = core.apply( + result['outputs'] = core.apply_update( 'wires', current.get('outputs'), update.get('outputs'))