Skip to content

Commit

Permalink
Merge branch 'release/0.6.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
bSI-Bot committed Oct 22, 2024
2 parents 31df653 + c3a532c commit f60531d
Show file tree
Hide file tree
Showing 263 changed files with 21,656 additions and 378 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
with:
fetch-depth: 0

- name: Warn if PR is to main
if: github.event_name == 'pull_request' && github.base_ref == 'main'
run: |
echo "::warning::This pull request is targeting the 'main' branch. Please ensure this is intended."
- name: Update submodule
run: |
git submodule init && git submodule update --recursive --remote
Expand All @@ -27,7 +32,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 pandas pyspellchecker
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.0-90ae709-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
15 changes: 15 additions & 0 deletions features/ALB010_Alignment-nesting-referents.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@industry-practice
@ALB
@version1
@E00100
Feature: ALB010 - Alignment Nesting Referents
The rule verifies that each alignment nests at least one IfcReferent, such as stations or mileage points.
These can be used as semantic entities holding information about locations along the alignment.
IfcReferent is associated to IfcAlignment via the IfcRelNests relationship.

Scenario: Agreement on each IfcAlignment nesting at least one IfcReferent

Given A model with Schema "IFC4.3"
Given An IfcAlignment

Then A relationship IfcRelNests must exist from IfcAlignment to IfcReferent
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
@implementer-agreement
@ALA
@ALB
@version1
@E00010
Feature: ALA001 - Alignment overall agreement of business logic and geometry
The rule verifies that when an Alignment has both business logic and geometry (representation), the representation entity type must correspond to the layouts present in the business logic.
Feature: ALB021 - Alignment overall agreement of business logic and geometry
The rule verifies that when an Alignment has both business logic and geometry (representation),
the representation entity type must correspond to the layouts present in the business logic.

Background: Validating overall agreement on presence of cant in business logic
Given A model with Schema "IFC4.3"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@implementer-agreement
@ALA
@ALB
@version1
@E00040
Feature: ALA002 - Alignment agreement on number of segments
Feature: ALB022 - Alignment agreement on number of segments
The rule verifies that when an Alignment has both business logic and geometry (representation),
the number of segments in the representation must correspond to the number of segments indicated by the business logic.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@implementer-agreement
@ALA
@ALB
@version2
@E00040
Feature: ALA003 - Alignment same segment types in business logic and geometry
Feature: ALB023 - Alignment same segment types in business logic and geometry
The rule verifies that when an Alignment has both business logic and geometry (representation),
the geometry type of each segments in the business logic must be the same as its corresponding segment in the representation.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@implementer-agreement
@BLT
@version1
@E00020

Feature: BLT002 - Correct use of partitioning type attributes for windows

The rule verifies that attribute UserDefinedPartitioningType is provided only when
the value of the attribute PartitioningType is set to USERDEFINED.

Scenario Outline: Correct values for PartitioningType and UserDefinedPartitioningType

Given an <entity>
Given UserDefinedPartitioningType = not empty
Given IsTypedBy = empty

Then PartitioningType = 'USERDEFINED'

Examples:
| entity |
| IfcWindow |
| IfcWindowType |


Scenario: Correct IfcPartitioningType with relating type object

Given an IfcWindow
Given a relationship IfcRelDefinesByType to IfcWindow from IfcWindowType

Then PartitioningType is empty
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@informal-proposition
@GEM
@BRP
@version1
@E00050
Feature: BRP001 - Polyhedral IfcFace boundary no self-intersections
The rule verifies that IfcFace instances do not have any self-intersections in their boundaries.
IfcFace with polygonal loops are used in IFC's Boundary Representation (BRep) mechanism.

Scenario: Validating that polyhedral IfcFace instances do not have self-intersections in their boundaries

Given An IfcFace
Given Its attribute Bounds
Given Its attribute Bound
Given Its Entity Type is 'IfcPolyLoop'

Then There must be no self-intersections
21 changes: 21 additions & 0 deletions features/CLS000_Classification-association.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@implementer-agreement
@CLS
@version1
@E00020

Feature: CLS000 - Classification Association
The rule verifies the presence of IFC entities used to classify elements, materials, and systems according to various classification systems,
such as the UNIFORMAT or Omniclass classification systems.
https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/concepts/Object_Association/Classification_Association/content.html


Scenario: Check for activation of Classification Association

Given an IfcObjectDefinition
Given its attribute HasAssociations
Given its entity type is 'IfcRelAssociatesClassification'
Given its attribute RelatingClassification
Given its entity type is 'IfcClassificationReference'

Then The IFC model contains information on the selected functional part

13 changes: 5 additions & 8 deletions features/IFC102_Absence-of-deprecated-entities.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@IFC
@version2
@version3
@E00030
@implementer-agreement
Feature: IFC102 - Absence of deprecated entities
Expand All @@ -17,7 +17,7 @@ IFC4: https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/
Given A model with Schema "IFC4.3"
Given An IFC model

Then There must be less than 1 instance(s) of <Entity>
Then There must be less than 1 instance(s) of <Entity> excluding subtypes

Examples:
| Entity |
Expand All @@ -33,7 +33,6 @@ IFC4: https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/
| IfcMaterialList |
| IfcPermeableCoveringProperties |
| IfcPostalAddress |
| IfcPresentationStyleSelect |
| IfcRelConnectsPortToElement |
| IfcRelCoversBldgElements |
| IfcRelServicesBuildings |
Expand All @@ -52,7 +51,7 @@ IFC4: https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/
Given An IFC model
Given A model with Schema "IFC4"

Then There must be less than 1 instance(s) of <Entity>
Then There must be less than 1 instance(s) of <Entity> excluding subtypes

Examples:
| Entity |
Expand All @@ -74,13 +73,11 @@ IFC4: https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/
| IfcOpeningStandardCase |
| IfcPlateStandardCase |
| IfcPresentationStyleAssignment |
| IfcPresentationStyleSelect |
| IfcProxy |
| IfcRelCoversBldgElements |
| IfcRelCoversSpaces |
| IfcSlabElementedCase |
| IfcSlabStandardCase |
| IfcStyleAssignmentSelect |
| IfcTextLiteral |
| IfcWallElementedCase |
| IfcWallStandardCase |
Expand All @@ -94,7 +91,7 @@ IFC4: https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/
Given An IFC model
Given A model with Schema "IFC2X3"

Then There must be less than 1 instance(s) of <Entity>
Then There must be less than 1 instance(s) of <Entity> excluding subtypes

Examples:
| Entity |
Expand Down Expand Up @@ -334,4 +331,4 @@ IFC4: https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/
Given A model with Schema "IFC2X3"
Given an IfcPropertySet

Then Name is not 'Pset_Draughting'
Then Name is not 'Pset_Draughting'
31 changes: 31 additions & 0 deletions features/LAY000_Presentation-layer-assignment.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@implementer-agreement
@LAY
@version1
@E00020

Feature: LAY000 - Presentation Layer Assignment
The rule verifies the presence of IFC entities used to assign layers (also known as, CAD layer) to collection of elements.
This is used mainly for grouping and visibility control, and in general to organise geometry into groups that may be shown or hidden.
https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/concepts/Product_Shape/Product_Geometry_Layer/content.html


Scenario: Layer assignment to representation

Given an IfcProduct
Given its attribute Representation
Given its attribute Representations
Given its attribute LayerAssignments

Then The IFC model contains information on the selected functional part


Scenario: Layer assignment to representation items

Given an IfcProduct
Given its attribute Representation
Given its attribute Representations
Given its attribute Items
Given its attribute LayerAssignment

Then The IFC model contains information on the selected functional part

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@implementer-agreement
@PJS
@BLT
@version2
@E00010
Feature: PJS002 - Correct elements related to project
Expand Down
25 changes: 25 additions & 0 deletions features/PJS003_Globally-Unique-Identifiers.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@implementer-agreement
@PJS
@version1
@E00010
Feature: PJS003 - Globally Unique Identifiers
The rule verifies that the GUID of each element adheres to the Global Unique Identifier format
and ensures compliance with constraints that are not yet validated by other methods.
Specifically, the characters must be within the official encoding character set
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$,"
, the resulting string must be exactly 22 characters in length, and the first character must be either 0, 1, 2, or 3.

https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcGloballyUniqueId.htm


Scenario Outline: Valid globally unique identifiers
Given An IfcRoot
Given Its attribute GlobalId

Then <Constraint>

Examples:
| Constraint |
| The string length must be exactly "22" characters |
| The characters must be within the official encoding character set |
| Its value starts with 0 or 1 or 2 or 3 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@disabled
@informal-proposition
@SWE
@version1
@E00050
Feature: SWE001 - Arbitrary profile boundary no self-intersections
The rule verifies that IfcArbitraryClosedProfileDefs and IfcArbitraryProfileDefWithVoids do
not have any self-intersections in their boundaries. Profile definitions are the basis of
geometrical sweeps such as extrusions.

Scenario: Validating that IfcArbitraryClosedProfileDef instances do not have self-intersections in their boundaries

Given An IfcArbitraryClosedProfileDef
Given Its attribute OuterCurve

Then There must be no self-intersections

Scenario: Validating that IfcArbitraryProfileDefWithVoids instances do not have self-intersections in their inner boundaries

Given An IfcArbitraryClosedProfileDef
Given Its attribute InnerCurves

Then There must be no self-intersections
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@informal-proposition
@TAS
@version1
@E00050
Feature: TAS001 - Polygonal face boundary no self-intersections
The rule verifies that IfcFace instances do not have any self-intersections in their boundaries.
IfcFace with polygonal loops are used in IFC's Boundary Representation (BRep) mechanism.

Scenario: Validating that tessellated face instances do not have self-intersections in their boundaries

Given An IfcPolygonalFaceSet
Given Its attribute Faces

Then There must be no self-intersections for attribute CoordIndex

Scenario: Validating that tessellated face instances with voids do not have self-intersections in their inner boundaries

Given An IfcPolygonalFaceSet
Given Its attribute Faces
Given Its Entity Type is 'IfcIndexedPolygonalFaceWithVoids'

Then There must be no self-intersections for attribute InnerCoordIndices
20 changes: 8 additions & 12 deletions features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,9 @@ def before_feature(context, feature):
}
protocol_errors = protocol.enforce(convention_attrs)
for error in protocol_errors:
validation_outcome = ValidationOutcome(
outcome_code=ValidationOutcomeCode.EXECUTED,
observed=error,
expected=error,
feature=context.feature.name,
feature_version=1,
severity=OutcomeSeverity.ERROR,
)
context.protocol_errors.append(validation_outcome)

context.gherkin_outcomes = context.protocol_errors
context.protocol_errors.append(error)

context.gherkin_outcomes = []


def before_scenario(context, scenario):
Expand Down Expand Up @@ -130,4 +122,8 @@ def get_or_create_instance_when_set(spf_id):
outcomes_json_str = json.dumps(outcomes) #ncodes to utf-8
outcomes_bytes = outcomes_json_str.encode("utf-8")
for formatter in filter(lambda f: hasattr(f, "embedding"), context._runner.formatters):
formatter.embedding(mime_type="application/json", data=outcomes_bytes, target='feature', attribute_name='validation_outcomes')
formatter.embedding(mime_type="application/json", data=outcomes_bytes, target='feature', attribute_name='validation_outcomes')

# embed protocol errors
protocol_errors_bytes = json.dumps(context.protocol_errors).encode("utf-8")
formatter.embedding(mime_type="application/json", data=protocol_errors_bytes, target='feature', attribute_name='protocol_errors')
10 changes: 6 additions & 4 deletions features/rule_creation_protocol/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@ def validate_separators(cls, value, values):
valid_separators = values.data['valid_separators']
unvalid_separators = [separator for separator in separators if separator != valid_separators]
if any(unvalid_separators):
raise ProtocolError(
value = separators,
message = f"expected {valid_separators} but found the following unvalid seperators {unvalid_separators} for name {values.data['name']}"
)
# For feature descriptions in the feature file, we also allow hyphens as separators. For example, "self-intersection" in SWE001.
if not set(unvalid_separators).issubset('-') and not valid_separators == ' ':
raise ProtocolError(
value = separators,
message = f"expected {valid_separators} but found the following unvalid seperators {unvalid_separators} for name {values.data['name']}"
)
return value, values


Expand Down
Loading

0 comments on commit f60531d

Please sign in to comment.