Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/val-247 readme adjustments #177

Merged
merged 10 commits into from
May 2, 2024
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
pip install behave pytest tabulate pyparsing sqlalchemy numpy pydantic pydot sqlalchemy_utils django python-dotenv deprecated
pip install behave pytest tabulate pyparsing sqlalchemy numpy pydantic pydot sqlalchemy_utils django python-dotenv deprecated pandas
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.7.0-f7c03db-linux64.zip
mkdir -p `python3 -c 'import site; print(site.getusersitepackages())'`
unzip -d `python3 -c 'import site; print(site.getusersitepackages())'` /tmp/ifcopenshell_python.zip
Expand Down
102 changes: 76 additions & 26 deletions test/files/ala001/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,76 @@
# ALA001 - Alignment overall agreement of business logic and presentation

These tests validate the overall agreement of the presence or absence of
vertical and cant alignment
between the business geometry and the representation.

This test is performed at the overall level and does not compare individual
segments of business logic or representations.

| File name | Expected result | Error log / further info |
|------------------------------------------------------|-----------------|----------------------------------------------------------------------------------------------------------------------------------|
| fail-ala001-scenario01-segmented_reference_curve.ifc | E00010 | Missing `IfcAlignmentCant` but uses `IfcSegmentedReferenceCurve` as representation |
| fail-ala001-scenario02-gradient_curve.ifc | E00010 | Missing `IfcAlignmentVertical` but `IfcGradientCurve` used as representation |
| fail-ala001-scenario03-polycurve_linear_order_3.ifc | E00010 | `IfcAlignmentVertical` not present but 3D `IfcIndexedPolyCurve` used as representation |
| fail-ala001-scenario04-polyline_order_3.ifc | E00010 | `IfcAlignmentVertical` not present but 3D `IfcPolyline` used as representation |
| fail-ala001-scenario05-composite_curve_axis.ifc | E00010 | `IfcAlignmentVertical` and `IfcAlignmentCant` are present but `IfcCompositeCurve` used as representation |
| fail-ala001-scenario06-gradient_curve.ifc | E00010 | `IfcAlignmentVertical` and `IfcAlignmentCant` are present but `IfcGradientCurve` used as representation |
| | | |
| pass-ala001-composite_curve.ifc | P00010 | `IfcAlignmentVertical` and `IfcAlignmentCant` not present and `IfcCompositeCurve` used as representation |
| pass-ala001-gradient_curve.ifc | P00010 | IfcAlignmentVertical` present and `IfcGradientCurve` used as representation |
| pass-ala001-polycurve_arcs_order_2.ifc | P00010 | IfcAlignmentVertical` and `IfcAlignmentCant` not present and 2D `IfcIndexedPolyCurve` with arcs and lines used as representation |
| pass-ala001-polycurve_linear_order_3.ifc | P00010 | IfcAlignmentVertical` is present and 3D `IfcPolyCurve` with lines only is used as representation |
| pass-ala001-polyline_order_2.ifc | P00010 | IfcAlignmentVertical` and `IfcAlignmentCant` not present and 2D `IfcPolyline` used as representation |
| pass-ala001-polyline_order_3.ifc | P00010 | IfcAlignmentVertical` present and 3D `IfcPolyline` used as representation |
| pass-ala001-segmented_reference_curve.ifc | P00010 | IfcAlignmentVertical` and `IfcAlignmentCant` present and `IfcSegmentedReferenceCurve` used as representation |

<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th>File name</th>
<th>Expected result</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>pass-ala001-polyline-order-3.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala001-gradient_curve.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala001-composite_curve.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala001-polycurve_arcs_order_2.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala001-segmented_reference_curve.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala001-polycurve_linear_order_3.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala001-polyline_order_2.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>fail-ala001-scenario06-gradient_curve.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2278', 'Expected': '', 'Observed': "{'entity': 'IfcAlignmentCant'}"}</td>
</tr>
<tr>
<td>fail-ala001-scenario04-polyline_order_3.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '118', 'Expected': "{'entity': 'IfcAlignmentVertical'}", 'Observed': ''}</td>
</tr>
<tr>
<td>fail-ala001-scenario05-composite_curve_axis.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2278', 'Expected': '', 'Observed': '{\\\'value\\\': "IfcAlignmentVertical\\\', \\\'IfcAlignmentCant"}'}</td>
</tr>
<tr>
<td>fail-ala001-scenario01-segmented_reference_curve.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2278', 'Expected': "{'entity': 'IfcAlignmentCant'}", 'Observed': ''}</td>
</tr>
<tr>
<td>fail-ala001-scenario02-gradient_curve.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2278', 'Expected': "{'entity': 'IfcAlignmentVertical'}", 'Observed': ''}</td>
</tr>
<tr>
<td>fail-ala001-scenario03-polycurve_linear_order_3.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '118', 'Expected': "{'entity': 'IfcAlignmentVertical'}", 'Observed': ''}</td>
</tr>
</tbody>
</table>
94 changes: 76 additions & 18 deletions test/files/ala002/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,76 @@
# ALA002 - Alignment Number of Segments

These tests validate a matching count of segments for the business logic and the geometry.

| File name | Expected result | Error log / further info |
|--------------------------------------------------------------|-----------------|----------------------------------------------------------------|
| fail-ala002-scenario01-helmert_curve.ifc | E00040 | Helmert curve segment #30 has a single geometry representation |
| fail-ala002-scenario01-segment_count_horizontal_geometry.ifc | E00040 | 2 fewer segments in horizontal geometry representation |
| fail-ala002-scenario01-segment_count_horizontal_logic.ifc | E00040 | 2 fewer segments in horizontal business logic |
| fail-ala002-scenario02-segment_count_vertical_geometry.ifc | E00040 | 2 fewer segments in vertical geometry representation |
| fail-ala002-scenario02-segment_count_vertical_logic.ifc | E00040 | 2 fewer segments in vertical business logic |
| fail-ala002-scenario03-segment_count_cant_geometry.ifc | E00040 | 2 fewer segments in cant geometry representation |
| fail-ala002-scenario03-segment_count_cant_logic.ifc | E00040 | 2 fewer segments in cant business logic |
| pass-ala002-business_logic_only.ifc | P00010 | No representation |
| pass-ala002-representation_only.ifc | P00010 | No business logic |
| pass-ala002-segment_count_h+v+c.ifc | P00010 | Passing test for alignment with horizontal, vertical, and cant |
| pass-ala002-segment_count_h+v.ifc | P00010 | Passing test for alignment with horizontal and vertical only |
| pass-ala002-segment_count_h.ifc | P00010 | Passing test for alignment with horizontal only |
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th>File name</th>
<th>Expected result</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>pass-ala002-segment_count_h+v+c.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala002-business_logic_only.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala002-representation_only.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala002-helmert_curve.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala002-segment_count_h.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala002-segment_count_h+v.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>fail-ala002-scenario01-segment_count_horizontal_logic.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2283', 'Expected': "{'value': 'same count of segments'}", 'Observed': "{'value': '8 segments in business logic and 10 segments in representation'}"}</td>
</tr>
<tr>
<td>fail-ala002-scenario02-segment_count_vertical_logic.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2352', 'Expected': "{'value': 'same count of segments'}", 'Observed': "{'value': '4 segments in business logic and 6 segments in representation'}"}</td>
</tr>
<tr>
<td>fail-ala002-scenario01-segment_count_horizontal_geometry.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2283', 'Expected': "{'value': 'same count of segments'}", 'Observed': "{'value': '10 segments in business logic and 8 segments in representation'}"}</td>
</tr>
<tr>
<td>fail-ala002-scenario01-helmert_curve.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '21', 'Expected': "{'value': 'same count of segments'}", 'Observed': "{'value': '3 segments in business logic and 2 segments in representation'}"}</td>
</tr>
<tr>
<td>fail-ala002-scenario03-segment_count_cant_geometry.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2388', 'Expected': "{'value': 'same count of segments'}", 'Observed': "{'value': '10 segments in business logic and 8 segments in representation'}"}</td>
</tr>
<tr>
<td>fail-ala002-scenario03-segment_count_cant_logic.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2388', 'Expected': "{'value': 'same count of segments'}", 'Observed': "{'value': '7 segments in business logic and 10 segments in representation'}"}</td>
</tr>
<tr>
<td>fail-ala002-scenario02-segment_count_vertical_geometry.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2352', 'Expected': "{'value': 'same count of segments'}", 'Observed': "{'value': '6 segments in business logic and 4 segments in representation'}"}</td>
</tr>
</tbody>
</table>
84 changes: 66 additions & 18 deletions test/files/ala003/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,66 @@
# ALA003 - Alignment Agreement of Geometry Types

These tests validate that the geometry type of each segment in the business logic
matches its counterpart in the geometry.

| File name | Expected result | Error log / further info |
|------------------------------------------------------------------------|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| fail-ala003-scenario01-helmert_curve.ifc | E00010 | #62 in cant business logic is `LINEARTRANSITION` and corresponds to representation by `IfcSecondOrderPolynomialSpiral` |
| fail-ala003-scenario02-different_horizontal_segment_geometry_types.ifc | E00010 | #2328 in horizontal business logic is `CIRCULARARC` and corresponds to representation by `IfcCLothoid` |
| fail-ala003-scenario03-different_vertical_segment_geometry_types.ifc | E00010 | #2380 in vertical business logic is `PARABOLIC` and corresponds to representation by `IfcCircle` |
| fail-ala003-scenario04-different_cant_segment_geometry_types.ifc | E00010 | #2399 in cant business logic is `LINEARTRANSITION` and corresponds to representation by `IfcClothoid` |
| fail-ala003-scenario05-different_segment_geometry_types.ifc | E00010 | #2399 in cant business logic is `BLOSSCURVE` and corresponds to representation by `IfcLine` |
| pass-ala003-business_logic_only.ifc | P00010 | Alignment contains business logic only with no geometric representation |
| pass-ala003-helmert_curve.ifc | P00010 | All logic segments correspond to correct representation entity types, including helmert curve type having two representation segments |
| pass-ala003-multiple_alignments.ifc | P00010 | Model contains multiple alignments, all of which have correct agreement of geometry type |
| pass-ala003-representation_only.ifc | P00010 | Alignment contains geometric representation only with no business logic |
| pass-ala003-same_segment_geometry_types.ifc | P00010 | All logic segments correspond to correct representation entity types, which are acquired via traversal of `IfcAlignment` representation |
| pass-ala003-without_segmented_reference_curve.ifc | P00010 | All logic segments correspond to correct representation entity types, which are acquired via `IfcAlignmentSegment` representation |
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th>File name</th>
<th>Expected result</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>pass-ala003-without_segmented_reference_curve.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala003-multiple_alignments.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala003-helmert_curve.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala003-business_logic_only.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala003-same_segment_geometry_types.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-ala003-representation_only.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>fail-ala003-scenario05-different_segment_geometry_types.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2399', 'Expected': "{'value': 'IFCTHIRDORDERPOLYNOMIALSPIRAL'}", 'Observed': "{'value': 'IFCLINE'}"}</td>
</tr>
<tr>
<td>fail-ala003-scenario04-different_cant_segment_geometry_types.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2399', 'Expected': "{'value': 'IFCLINE'}", 'Observed': "{'value': 'IFCCLOTHOID'}"}</td>
</tr>
<tr>
<td>fail-ala003-scenario01-helmert_curve.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '62', 'Expected': "{'value': 'IFCLINE'}", 'Observed': "{'value': 'IFCSECONDORDERPOLYNOMIALSPIRAL'}"}</td>
</tr>
<tr>
<td>fail-ala003-scenario03-different_vertical_segment_geometry_types.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2375', 'Expected': '', 'Observed': "{'value': 'IFCCIRCLE'}"}</td>
</tr>
<tr>
<td>fail-ala003-scenario02-different_horizontal_segment_geometry_types.ifc</td>
<td>fail</td>
<td>Result 1: {'Instance_id': '2323', 'Expected': "{'value': 'IFCCIRCLE'}", 'Observed': "{'value': 'IFCCLOTHOID'}"}</td>
</tr>
</tbody>
</table>
31 changes: 26 additions & 5 deletions test/files/alb001/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
| File name | Expected result | Error log | Description |
|-------------------------------------------------------------------|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| pass-alb001-alignment-in-spatial-structure | success | n.a. | |
| fail-alb001-scenario01-no_contained_relation | fail | The instance #23=IfcAlignment('2HT2$vx...FINED.) is not directly contained (in) the following (1) instances: IfcSite; The instance #426=IfcAlignment('1pJ$fx...FINED.) is not directly contained (in) the following (1) instances: IfcSite | There is no IFCRELCONTAINEDINSPATIALSTRUCTURE relation between IFCALIGNMENT and IFCSITE |
| fail-alb001-scenario01-contained_relation_not_directed_to_ifcsite | fail | The instance #23=IfcAlignment('2HT2$vx...FINED.) is not directly contained (in) the following (1) instances: IfcSite; The instance #426=IfcAlignment('1pJ$fx...FINED.) is not directly contained (in) the following (1) instances: IfcSite | The IFCRELCONTAINEDINSPATIALSTRUCTURE relation links IFCALIGNMENT to IFCBUILDING not IFCSITE |
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th>File name</th>
<th>Expected result</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>pass-alb001-scenario01-contained_relation_not_directed_to_ifcsite.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-alb001-scenario01-no_contained_relation.ifc</td>
<td>pass</td>
<td>NaN</td>
</tr>
<tr>
<td>pass-alb001-alignment_in_spatial_structure.ifc</td>
<td>pass</td>
<td></td>
</tr>
</tbody>
</table>