-
Notifications
You must be signed in to change notification settings - Fork 21
PJS001 conversion based units (IVS-680) #471
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
Open
civilx64
wants to merge
15
commits into
development
Choose a base branch
from
IVS-680-PJS001-conversion-based-units
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d2652bf
create schema-specific resource files for conversion-based-units
civilx64 7c8ba3c
initial WIP commit for PJS001 gherkin logic
civilx64 683cbc9
re-order tables so that name comes first
civilx64 de71fa0
pass files and fail files for scenario 1
civilx64 b5c37d0
pass files and fail files for scenario 1
civilx64 2943fba
updated step implementation so CI/CD passes
civilx64 3bd7d17
scenario 2 unit test files
civilx64 f55574e
Clarify scope of activation (entire model, not just context assignment)
civilx64 e6924de
Update features/steps/steps/propertysets_qtys_units.py
civilx64 89389c1
Update features/steps/steps/propertysets_qtys_units.py
civilx64 d695329
Merge remote-tracking branch 'origin/IVS-680-PJS001-conversion-based-…
civilx64 bb1f0af
header -> "Name" for consistency with unit definitions
civilx64 b433f72
clean up file names in test suite
civilx64 d0f5ef1
address review comments
civilx64 24ec018
add scenarios per review comments
civilx64 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| Name,UnitType,ConversionFactor,SIUnitPrefix,SIUnitName,Description | ||
| inch,LENGTHUNIT,25.4,MILLI,METRE | ||
| foot,LENGTHUNIT,304.8,MILLI,METRE | ||
| yard,LENGTHUNIT,914.,MILLI,METRE | ||
| mile,LENGTHUNIT,1609.,,METRE | ||
| acre,AREAUNIT,4046.86,,SQUARE_METRE | ||
| litre,VOLUMEUNIT,0.001,,CUBIC_METRE | ||
| pint UK,VOLUMEUNIT,0.000568,,CUBIC_METRE | ||
| pint US,VOLUMEUNIT,0.000473,,CUBIC_METRE | ||
| gallon UK,VOLUMEUNIT,0.00454,,CUBIC_METRE | ||
| gallon US,VOLUMEUNIT,0.003785,,CUBIC_METRE | ||
| ounce,MASSUNIT,28.35,,GRAM | ||
| pound,MASSUNIT,0.454,KILO,GRAM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| Name,UnitType,ConversionFactor,SIUnitPrefix,SIUnitName,Description | ||
| inch,LENGTHUNIT,25.4,MILLI,METRE | ||
| foot,LENGTHUNIT,304.8,MILLI,METRE | ||
| yard,LENGTHUNIT,914.,MILLI,METRE | ||
| mile,LENGTHUNIT,1609.,,METRE | ||
| square inch,AREAUNIT,0.0006452,,SQUARE_METRE | ||
| square foot,AREAUNIT,0.09290,,SQUARE_METRE | ||
| square yard,AREAUNIT,0.83612736,,SQUARE_METRE | ||
| acre,AREAUNIT,4046.86,,SQUARE_METRE | ||
| square mile,AREAUNIT,2588881.,,SQUARE_METRE | ||
| cubic inch,VOLUMEUNIT,0.00001639,,CUBIC_METRE | ||
| cubic foot,VOLUMEUNIT,0.02832,,CUBIC_METRE | ||
| cubic yard,VOLUMEUNIT,0.7636,,CUBIC_METRE | ||
| litre,VOLUMEUNIT,0.001,,CUBIC_METRE | ||
| fluid ounce UK,VOLUMEUNIT,0.0000284130625,,CUBIC_METRE | ||
| fluid ounce US,VOLUMEUNIT,0.00002957353,,CUBIC_METRE | ||
| pint UK,VOLUMEUNIT,0.000568,,CUBIC_METRE | ||
| pint US,VOLUMEUNIT,0.000473,,CUBIC_METRE | ||
| gallon UK,VOLUMEUNIT,0.004546,,CUBIC_METRE | ||
| gallon US,VOLUMEUNIT,0.003785,,CUBIC_METRE | ||
| degree,PLANEANGLEUNIT,0.017453292519943295,,RADIAN | ||
| ounce,MASSUNIT,28.35,,GRAM | ||
| pound,MASSUNIT,0.454,KILO,GRAM | ||
| ton UK,MASSUNIT,1016.0469088,KILO,GRAM,also known as long ton or gross ton or shipper's ton | ||
| ton US,MASSUNIT,907.18474,KILO,GRAM,also known as short ton or net ton | ||
| lbf,FORCEUNIT,4.4482216153,,NEWTON,also known as pound-force | ||
| kip,FORCEUNIT,4448.2216153,,NEWTON,also known as kilopound-force | ||
| psi,PRESSUREUNIT,6894.7572932,,PASCAL,also known as pound-force per square inch | ||
| ksi,PRESSUREUNIT,6894757.2932,,PASCAL,also known as kilopound-force per square inch | ||
| minute,TIMEUNIT,60.,,SECOND | ||
| hour,TIMEUNIT,3600.,,SECOND | ||
| day,TIMEUNIT,86400.,,SECOND | ||
| btu,ENERGYUNIT,1055.056,,JOULE, also known as British Thermal Unit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| Name,UnitType,ConversionFactor,SIUnitPrefix,SIUnitName,Description | ||
| inch,LENGTHUNIT,25.4,MILLI,METRE | ||
| foot,LENGTHUNIT,304.8,MILLI,METRE | ||
| US survey foot,LENGTHUNIT,304.80060960122,MILLI,METRE,the approximate value of 1200/3937 meters | ||
| yard,LENGTHUNIT,914.,MILLI,METRE | ||
| mile,LENGTHUNIT,1609.,,METRE | ||
| square inch,AREAUNIT,0.0006452,,SQUARE_METRE | ||
| square foot,AREAUNIT,0.09290,,SQUARE_METRE | ||
| square yard,AREAUNIT,0.83612736,,SQUARE_METRE | ||
| acre,AREAUNIT,4046.86,,SQUARE_METRE | ||
| square mile,AREAUNIT,2588881.,,SQUARE_METRE | ||
| cubic inch,VOLUMEUNIT,0.00001639,,CUBIC_METRE | ||
| cubic foot,VOLUMEUNIT,0.02832,,CUBIC_METRE | ||
| cubic yard,VOLUMEUNIT,0.7636,,CUBIC_METRE | ||
| litre,VOLUMEUNIT,0.001,,CUBIC_METRE | ||
| fluid ounce UK,VOLUMEUNIT,0.0000284130625,,CUBIC_METRE | ||
| fluid ounce US,VOLUMEUNIT,0.00002957353,,CUBIC_METRE | ||
| pint UK,VOLUMEUNIT,0.000568,,CUBIC_METRE | ||
| pint US,VOLUMEUNIT,0.000473,,CUBIC_METRE | ||
| gallon UK,VOLUMEUNIT,0.004546,,CUBIC_METRE | ||
| gallon US,VOLUMEUNIT,0.003785,,CUBIC_METRE | ||
| degree,PLANEANGLEUNIT,0.017453292519943295,,RADIAN | ||
| ounce,MASSUNIT,28.35,,GRAM | ||
| pound,MASSUNIT,0.454,KILO,GRAM | ||
| ton UK,MASSUNIT,1016.0469088,KILO,GRAM,also known as long ton or gross ton or shipper's ton | ||
| ton US,MASSUNIT,907.18474,KILO,GRAM,also known as short ton or net ton | ||
| lbf,FORCEUNIT,4.4482216153,,NEWTON,also known as pound-force | ||
| kip,FORCEUNIT,4448.2216153,,NEWTON,also known as kilopound-force | ||
| psi,PRESSUREUNIT,6894.7572932,,PASCAL,also known as pound-force per square inch | ||
| ksi,PRESSUREUNIT,6894757.2932,,PASCAL,also known as kilopound-force per square inch | ||
| minute,TIMEUNIT,60.,,SECOND | ||
| hour,TIMEUNIT,3600.,,SECOND | ||
| day,TIMEUNIT,86400.,,SECOND | ||
| btu,ENERGYUNIT,1055.056,,JOULE, also known as British Thermal Unit |
42 changes: 42 additions & 0 deletions
42
features/rules/PJS/PJS001_Correct-conversion-based-units.feature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| @implementer-agreement | ||
| @PJS | ||
| @version1 | ||
| Feature: PJS001 - Correct conversion based units | ||
|
|
||
| The rule verifies that conversion-based units used per Concept Template 4.1.9.9 | ||
| (https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/concepts/Project_Context/Project_Units/content.html) | ||
| have names and corresponding conversion factors per the table of recommended values for each schema version. | ||
| IFC 4X3: https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcConversionBasedUnit.htm | ||
| IFC 4: https://standards.buildingsmart.org/IFC/RELEASE/IFC4/FINAL/HTML/schema/ifcmeasureresource/lexical/ifcconversionbasedunit.htm | ||
| IFC 2X3: https://standards.buildingsmart.org/IFC/RELEASE/IFC2x3/FINAL/HTML/ifcmeasureresource/lexical/ifcconversionbasedunit.htm | ||
|
|
||
| Background: Selection of conversion-based units in default unit assignment | ||
| Given an .IfcProject. | ||
| Given its attribute .UnitsInContext. | ||
| Given its attribute .Units. | ||
| Given [its entity type] ^is^ 'IfcConversionBasedUnit' | ||
|
|
||
| Scenario: Validating correct names for area, length, and volume units | ||
| Given .UnitType. ^is^ 'AREAUNIT' or 'LENGTHUNIT' or 'VOLUMEUNIT' or 'PLANEANGLEUNIT' | ||
| Then its attribute .Name. must be defined [according to the table] 'valid_ConversionBasedUnits' | ||
|
|
||
civilx64 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Scenario: Validating correct conversion factors | ||
| Then its attribute .ConversionFactor. must be defined [according to the table] 'valid_ConversionBasedUnits' | ||
|
|
||
| Scenario: Validating that the conversion is based on SI units | ||
| Given its attribute .ConversionFactor. | ||
| Given its attribute .UnitComponent. | ||
| Then [its entity type] ^is^ 'IfcSIUnit' | ||
|
|
||
| Scenario Outline: Validating that the conversion is based on the correct SI unit | ||
| Given .UnitType. ^is^ '<UnitType>' | ||
| Given its attribute .ConversionFactor. | ||
| Given its attribute .UnitComponent. | ||
| Then the value of attribute .Name. must be '<CorrespondingSIUnit>' | ||
|
|
||
| Examples: | ||
| | UnitType | CorrespondingSIUnit | | ||
| | AREAUNIT | SQUARE_METRE | | ||
| | LENGTHUNIT | METRE | | ||
| | VOLUMEUNIT | CUBIC_METRE | | ||
| | PLANEANGLEUNIT | RADIAN | | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| from givens import attributes, entities, relationships, values | ||
| from thens import alignment, attributes, geometry, nesting, reference, relations, values, existence | ||
| from steps import attribute_selection, attribute_value, entity_selection, model_traversal, representation, \ | ||
| propertysets_and_qtys, crs | ||
| propertysets_qtys_units, crs |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.