From de2bad1ca2b011de2defeb1aa9d4baaa6d04cde7 Mon Sep 17 00:00:00 2001 From: DeltaDaniel <139119540+DeltaDaniel@users.noreply.github.com> Date: Tue, 18 Jun 2024 09:40:11 +0200 Subject: [PATCH 1/3] add conditions to flatahbtable output --- src/kohlrahbi/unfoldedahb/unfoldedahbtable.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/kohlrahbi/unfoldedahb/unfoldedahbtable.py b/src/kohlrahbi/unfoldedahb/unfoldedahbtable.py index ab1a1c48..9dd1146d 100644 --- a/src/kohlrahbi/unfoldedahb/unfoldedahbtable.py +++ b/src/kohlrahbi/unfoldedahb/unfoldedahbtable.py @@ -352,6 +352,7 @@ def convert_to_flat_ahb(self) -> FlatAnwendungshandbuch: value_pool_entry=unfolded_ahb_line.code, name=unfolded_ahb_line.beschreibung or unfolded_ahb_line.qualifier, ahb_expression=unfolded_ahb_line.bedingung_ausdruck, + conditions=unfolded_ahb_line.bedingung, section_name=unfolded_ahb_line.segment_name, index=unfolded_ahb_line.index, ) From 0216812429a753956fc6f7cec9f9eb3f676b1b58 Mon Sep 17 00:00:00 2001 From: DeltaDaniel <139119540+DeltaDaniel@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:22:14 +0200 Subject: [PATCH 2/3] updated maus dependency --- pyproject.toml | 2 +- requirements.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b4397720..2e4a924b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ build-backend = "hatchling.build" dependencies = [ "click>=8.0.0", "colorlog>=6.7.0", - "maus>=0.5.0", + "maus>=0.5.2", "openpyxl>=3.1.1", "pandas>=1.5.3", "python-docx>=1.0.0", diff --git a/requirements.txt b/requirements.txt index 2cfce48f..81b0e7de 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.12 # by the following command: # -# pip-compile pyproject.toml +# pip-compile '.\pyproject.toml' # annotated-types==0.7.0 # via pydantic @@ -22,7 +22,7 @@ lxml==5.2.2 # via python-docx marshmallow==3.21.3 # via maus -maus==0.5.0 +maus==0.5.2 # via kohlrahbi (pyproject.toml) more-itertools==10.3.0 # via maus From a184588f6d4f8cd524ccc84b4cfcad85b853f810 Mon Sep 17 00:00:00 2001 From: DeltaDaniel <139119540+DeltaDaniel@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:39:32 +0200 Subject: [PATCH 3/3] modified test --- src/kohlrahbi/unfoldedahb/unfoldedahbtable.py | 2 +- unittests/test_unfolded_ahb_table.py | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/kohlrahbi/unfoldedahb/unfoldedahbtable.py b/src/kohlrahbi/unfoldedahb/unfoldedahbtable.py index 9dd1146d..b766ee49 100644 --- a/src/kohlrahbi/unfoldedahb/unfoldedahbtable.py +++ b/src/kohlrahbi/unfoldedahb/unfoldedahbtable.py @@ -353,7 +353,7 @@ def convert_to_flat_ahb(self) -> FlatAnwendungshandbuch: name=unfolded_ahb_line.beschreibung or unfolded_ahb_line.qualifier, ahb_expression=unfolded_ahb_line.bedingung_ausdruck, conditions=unfolded_ahb_line.bedingung, - section_name=unfolded_ahb_line.segment_name, + section_name=unfolded_ahb_line.segment_name if unfolded_ahb_line.segment is not None else None, index=unfolded_ahb_line.index, ) ) diff --git a/unittests/test_unfolded_ahb_table.py b/unittests/test_unfolded_ahb_table.py index 2dee64e2..6cc29307 100644 --- a/unittests/test_unfolded_ahb_table.py +++ b/unittests/test_unfolded_ahb_table.py @@ -98,6 +98,18 @@ def test_convert_to_flat_ahb(self) -> None: bedingung_ausdruck="X", bedingung=None, ), + UnfoldedAhbLine( + index=5, + segment_name="Marktlokation", + segment_gruppe="SG5", + segment="LOC", + datenelement="3225", + code=None, + qualifier="ID der Marktlokation", + beschreibung=None, + bedingung_ausdruck="X[950]", + bedingung="[950] Format:\n Marktlokations-ID", + ), ] unfolded_ahb = UnfoldedAhb(meta_data=meta_data, unfolded_ahb_lines=unfolded_ahb_lines) @@ -164,6 +176,18 @@ def test_convert_to_flat_ahb(self) -> None: ahb_expression="X", index=4, ), + AhbLine( + guid=None, + section_name="Marktlokation", + conditions="[950] Format:\n Marktlokations-ID", + segment_group_key="SG5", + segment_code="LOC", + data_element="3225", + value_pool_entry=None, + name="ID der Marktlokation", + ahb_expression="X[950]", + index=5, + ), ], )