From 9e98ca4a6c46aa24f764a8d689db1ae3cf03a6d5 Mon Sep 17 00:00:00 2001 From: Cyprian Laskowski Date: Thu, 20 Mar 2025 10:25:48 +0100 Subject: [PATCH] Redmine #1487: extended generated structure labels to include dependencies --- setup.py | 2 +- structure_assignment/assign_other_structures.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f28c5cd..2e4298a 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup(name='structure_assignment', author_email='cyp@cjvt.si', packages=['structure_assignment'], install_requires=['lxml>=4.9', - 'classla>=2.1', + 'classla==2.1.1', 'cjvt_conversion_utils>=0.3', 'cordex>=1.0.0' ], diff --git a/structure_assignment/assign_other_structures.py b/structure_assignment/assign_other_structures.py index 997e343..972e10d 100644 --- a/structure_assignment/assign_other_structures.py +++ b/structure_assignment/assign_other_structures.py @@ -181,7 +181,6 @@ def create_xml_structure(syntactic_structure): component.set('cid', str(index)) component.set('type', 'core') component.set('label', component_map['label']) - structure_element.set('label', '-'.join([c.get('label') for c in components])) dependencies = lxml.SubElement(structure_element, 'dependencies') for dependency_map in syntactic_structure.dependencies: dependency = lxml.SubElement(dependencies, 'dependency') @@ -191,6 +190,7 @@ def create_xml_structure(syntactic_structure): dependency.set('from', from_index) dependency.set('label', label) dependency.set('to', to_index) + structure_element.set('label', '-'.join([c.get('label') for c in components]) + ';' + '-'.join([d.get('from') + '_' + d.get('to') + '_' + d.get('label') for d in dependencies])) definition = lxml.SubElement(structure_element, 'definition') for (index, component_map) in enumerate(syntactic_structure.components, start=1): component = lxml.SubElement(definition, 'component')