From 39aeea3bd25584e42f73361f21425aa0e1d2c53e Mon Sep 17 00:00:00 2001 From: Geert Hesselink Date: Fri, 20 Dec 2024 17:48:37 +0100 Subject: [PATCH 1/5] schema -> schema_identifier in behave output --- features/steps/validation_handling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/steps/validation_handling.py b/features/steps/validation_handling.py index eb4a9f6c6..a6880d9b9 100644 --- a/features/steps/validation_handling.py +++ b/features/steps/validation_handling.py @@ -360,7 +360,7 @@ def expected_behave_output(context: Context, data: Any, is_observed : bool = Fal # step name is a good proxy for expected, but not for observed return context.step.name case str(): - if data in [x.name() for x in ifcopenshell.ifcopenshell_wrapper.schema_by_name(context.model.schema).entities()]: + if data in [x.name() for x in ifcopenshell.ifcopenshell_wrapper.schema_by_name(context.model.schema_identifier).entities()]: return {'entity': data} # e.g. 'the type must be IfcCompositeCurve' else: return {'value': data} # e.g. "The value must be 'Body'" From 75cf4ac385ed6ae267fc99c7728faf608b14fc08 Mon Sep 17 00:00:00 2001 From: Geert Hesselink Date: Fri, 20 Dec 2024 18:03:41 +0100 Subject: [PATCH 2/5] Remove 'at depth 1' from expected output --- features/steps/validation_handling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/steps/validation_handling.py b/features/steps/validation_handling.py index a6880d9b9..97ef5c1ee 100644 --- a/features/steps/validation_handling.py +++ b/features/steps/validation_handling.py @@ -358,7 +358,7 @@ def expected_behave_output(context: Context, data: Any, is_observed : bool = Fal return None else: # step name is a good proxy for expected, but not for observed - return context.step.name + return context.step.name.replace(' at depth 1', '') case str(): if data in [x.name() for x in ifcopenshell.ifcopenshell_wrapper.schema_by_name(context.model.schema_identifier).entities()]: return {'entity': data} # e.g. 'the type must be IfcCompositeCurve' From 8771adfeef4062c49e5ed1cd1062e23e44301c5d Mon Sep 17 00:00:00 2001 From: Geert Hesselink Date: Fri, 20 Dec 2024 19:39:25 +0100 Subject: [PATCH 3/5] Remove 'at depth 1' from output 'last step' --- features/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/environment.py b/features/environment.py index db412d288..4dd943c56 100644 --- a/features/environment.py +++ b/features/environment.py @@ -153,5 +153,5 @@ def update_outcomes_with_scenario_data(context, outcomes): if sls is not None: outcome['scenario'] = sls['scenario'] - outcome['last_step'] = sls['last_step'].name + outcome['last_step'] = sls['last_step'].name.replace(' at depth 1', '') outcome['instance_id'] = sls.get('instance_id') \ No newline at end of file From aef090fd5d612bb852a80a6c71ec13adcfa35c44 Mon Sep 17 00:00:00 2001 From: Geert Hesselink Date: Fri, 20 Dec 2024 19:39:45 +0100 Subject: [PATCH 4/5] modify identica/unique output message --- features/steps/thens/values.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/steps/thens/values.py b/features/steps/thens/values.py index eaa784e8f..d96429369 100644 --- a/features/steps/thens/values.py +++ b/features/steps/thens/values.py @@ -78,13 +78,13 @@ def step_impl(context, inst, constraint, num=None): continue if constraint == 'identical': if not all([values[0] == i for i in values]): - yield ValidationOutcome(inst=inst, expected= constraint, observed = f"Not {constraint}", severity=OutcomeSeverity.ERROR) + yield ValidationOutcome(inst=inst, observed = values, severity=OutcomeSeverity.ERROR) if constraint == 'unique': seen = set() duplicates = [x for x in values if x in seen or seen.add(x)] if not duplicates: continue - yield ValidationOutcome(inst=inst, expected= constraint, observed = f"Not {constraint}", severity=OutcomeSeverity.ERROR) + yield ValidationOutcome(inst=inst, observed = values, severity=OutcomeSeverity.ERROR) def recursive_unpack_value(item): From dcbbcd329a1eac4bb3d92a36191dd978d0567808 Mon Sep 17 00:00:00 2001 From: Geert Hesselink Date: Fri, 20 Dec 2024 19:40:33 +0100 Subject: [PATCH 5/5] update ifcopenshell --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2e1ee160..473de25d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - name: Install dependencies run: | pip install behave pytest tabulate pyparsing sqlalchemy numpy pydantic pydot sqlalchemy_utils django python-dotenv deprecated pandas pyspellchecker rtree - wget -O /tmp/ifcopenshell_python.zip https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-`python3 -c 'import sys;print("".join(map(str, sys.version_info[0:2])))'`-v0.8.1-0267e2b-linux64.zip + wget -O /tmp/ifcopenshell_python.zip https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-`python3 -c 'import sys;print("".join(map(str, sys.version_info[0:2])))'`-v0.8.1-1d27161-linux64.zip mkdir -p `python3 -c 'import site; print(site.getusersitepackages())'` unzip -d `python3 -c 'import site; print(site.getusersitepackages())'` /tmp/ifcopenshell_python.zip - name: Lint with flake8