diff --git a/nexus_constructor/json/load_from_json.py b/nexus_constructor/json/load_from_json.py index 56051ef0c..eac380d67 100644 --- a/nexus_constructor/json/load_from_json.py +++ b/nexus_constructor/json/load_from_json.py @@ -376,10 +376,16 @@ def _add_transform_and_shape_to_component(self, component, children_dict): ) transformation_reader.add_transformations_to_component() self.warnings += transformation_reader.warnings - depends_on_path = _find_depends_on_path(children_dict, component.name) - if depends_on_path not in DEPENDS_ON_IGNORE: + depends_on = _find_depends_on_path(children_dict, component.name) + if depends_on not in [".", ""]: + if depends_on[0] != "/": + if depends_on.split("/")[0].startswith('transform'): + depends_on = depends_on.split("/")[1] + depends_on = component.absolute_path + "/transformations/" + depends_on + + if depends_on not in DEPENDS_ON_IGNORE: depends_on_id = TransformId( - *get_component_and_transform_name(depends_on_path) + *get_component_and_transform_name(depends_on) ) self._components_depends_on[component.name] = (component, depends_on_id) else: diff --git a/nexus_constructor/json/transformation_reader.py b/nexus_constructor/json/transformation_reader.py index 6cf397506..bb7086667 100644 --- a/nexus_constructor/json/transformation_reader.py +++ b/nexus_constructor/json/transformation_reader.py @@ -306,6 +306,10 @@ def _create_transformations(self, json_transformations: list): depends_on = _find_attribute_from_list_or_dict( CommonAttrs.DEPENDS_ON, attributes ) + if depends_on not in [".", ""]: + if depends_on[0] != "/": + depends_on = self.parent_component.absolute_path + "/transformations/" + depends_on + if module == DATASET: values = self._get_transformation_attribute( CommonKeys.VALUES, config, name diff --git a/nexus_constructor/link_transformation.py b/nexus_constructor/link_transformation.py index a1f7361f6..807fc2446 100644 --- a/nexus_constructor/link_transformation.py +++ b/nexus_constructor/link_transformation.py @@ -9,7 +9,7 @@ class LinkTransformation: """ Used for keeping track of links (depends_on) to transformations outside the current component and for keeping track of the parent transformation list - Not a "link" in the NeXus/HDF5 sense + Not a "link" in the NeXus/HDF5 sense so the name should be changed """ def __init__(self, parent: TransformationsList):