Skip to content

Validate data element constraints #81

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
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 41 additions & 32 deletions examples/fan_spec/schema/RS0003.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ RS0003:
metadata:
Description: "Metadata data group"
Data Type: "{Metadata}"
Constraints: "schema=RS0003"
Constraints: schema_name="RS0003"
Required: True
description:
Description: "Data group describing product and rating information"
Expand Down Expand Up @@ -156,17 +156,23 @@ Performance:
Description: "Type of performance map"
Data Type: "<SpeedControlType>"
Required: True
Notes: ["Determines which performance map data group is used for `performance_map`",
"If `operation_speed_control_type` is `DISCRETE` performance map data is provided at individual impeller speeds",
"If `operation_speed_control_type` is `CONTINUOUS` performance map data is provided over a range of impeller speeds"]
Notes:
[
"Determines which performance map data group is used for `performance_map`",
"If `operation_speed_control_type` is `DISCRETE` performance map data is provided at individual impeller speeds",
"If `operation_speed_control_type` is `CONTINUOUS` performance map data is provided over a range of impeller speeds",
]
installation_speed_control_type:
Description: "Type of fan impeller speed control"
Data Type: "<InstallationSpeedControlType>"
Required: True
Notes: ["If `operation_speed_control_type` is `DISCRETE` and `installation_speed_control_type` is `FIXED`, impeller speed shall be restricted to a single discrete speed",
"If `operation_speed_control_type` is `DISCRETE` and `installation_speed_control_type` is `VARIABLE`, impeller speed shall be restricted to a set of two or more discrete speeds",
"If `operation_speed_control_type` is `CONTINUOUS` and `installation_speed_control_type` is `FIXED`, impeller speed shall be restricted to a single speed (which may be interpolated from `impeller_speed` values provided in the performance map)",
"If `operation_speed_control_type` is `CONTINUOUS` and `installation_speed_control_type` is `VARIABLE`, impeller speed shall be unrestricted within operational limits"]
Notes:
[
"If `operation_speed_control_type` is `DISCRETE` and `installation_speed_control_type` is `FIXED`, impeller speed shall be restricted to a single discrete speed",
"If `operation_speed_control_type` is `DISCRETE` and `installation_speed_control_type` is `VARIABLE`, impeller speed shall be restricted to a set of two or more discrete speeds",
"If `operation_speed_control_type` is `CONTINUOUS` and `installation_speed_control_type` is `FIXED`, impeller speed shall be restricted to a single speed (which may be interpolated from `impeller_speed` values provided in the performance map)",
"If `operation_speed_control_type` is `CONTINUOUS` and `installation_speed_control_type` is `VARIABLE`, impeller speed shall be unrestricted within operational limits",
]
motor_representation:
Description: "The corresponding Standard 205 motor representation"
Notes: "If the fan assembly is packaged with a motor, a motor representation shall be provided"
Expand Down Expand Up @@ -204,8 +210,11 @@ AssemblyComponent:
Data Type: "Numeric"
Constraints: ">=0.0"
Units: "Pa"
Notes: ["Corresponds to additional pressure difference at `nominal_standard_air_volumetric_flow_rate`",
"If unknown, a value of 75 Pa shall be used"]
Notes:
[
"Corresponds to additional pressure difference at `nominal_standard_air_volumetric_flow_rate`",
"If unknown, a value of 75 Pa shall be used",
]
Required: True
Scalable: True

Expand All @@ -216,17 +225,17 @@ SystemCurve:
Description: "Volumetric air flow rate through an air distribution system at standard air conditions"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[2..]"
- ">=0.0"
- "[2..]"
Units: "m3/s"
Required: True
Scalable: True
static_pressure_difference:
Description: "Static pressure difference of an air distribution system"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[2..]"
- ">=0.0"
- "[2..]"
Units: "Pa"
Required: True
Scalable: True
Expand All @@ -252,17 +261,17 @@ GridVariablesContinuous:
Description: "Volumetric air flow rate through fan assembly at standard air conditions"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[1..]"
- ">=0.0"
- "[1..]"
Units: "m3/s"
Required: True
Scalable: True
static_pressure_difference:
Description: "External static pressure across fan assembly at dry coil conditions"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[1..]"
- ">=0.0"
- "[1..]"
Units: "Pa"
Notes: "Any static pressure deduction (or addition) for wet coil is specified by `wet_pressure_difference` in 'assembly_components' data group"
Required: True
Expand All @@ -275,16 +284,16 @@ LookupVariablesContinuous:
Description: "Rotational speed of fan impeller"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[1..]"
- ">=0.0"
- "[1..]"
Units: "rev/s"
Required: True
shaft_power:
Description: "Mechanical shaft power input to fan assembly"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[1..]"
- ">=0.0"
- "[1..]"
Units: "W"
Notes: "Does not include the mechanical efficiency of any mechanical drive used to modify rotational speed between the motor and impeller"
Required: True
Expand Down Expand Up @@ -316,17 +325,17 @@ GridVariablesDiscrete:
Description: "Number indicating discrete speed of fan impeller in rank order (with 1 being the lowest speed)"
Data Type: "[Integer]"
Constraints:
- ">=0"
- "[1..]"
- ">=0"
- "[1..]"
Units: "-"
Notes: "Data shall be provided for all allowable discrete speeds or settings"
Required: True
static_pressure_difference:
Description: "External static pressure across fan assembly at dry coil conditions"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[1..]"
- ">=0.0"
- "[1..]"
Units: "Pa"
Notes: "Any static pressure deduction (or addition) for wet coil is specified by `wet_pressure_difference` in 'assembly_components' data group"
Required: True
Expand All @@ -339,17 +348,17 @@ LookupVariablesDiscrete:
Description: "Volumetric air flow rate through fan assembly at standard air conditions"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[1..]"
- ">=0.0"
- "[1..]"
Units: "m3/s"
Required: True
Scalable: True
shaft_power:
Description: "Mechanical shaft power input to fan assembly"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[1..]"
- ">=0.0"
- "[1..]"
Units: "W"
Notes: "Does not include the mechanical efficiency of any mechanical drive used to modify rotational speed between the motor and impeller"
Required: True
Expand All @@ -358,8 +367,8 @@ LookupVariablesDiscrete:
Description: "Rotational speed of fan impeller"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[1..]"
- ">=0.0"
- "[1..]"
Units: "rev/s"
Required: True
operation_state:
Expand Down
29 changes: 16 additions & 13 deletions examples/fan_spec/schema/RS0005.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RS0005:
metadata:
Description: "Metadata data group"
Data Type: "{Metadata}"
Constraints: "schema=RS0005"
Constraints: schema_name="RS0005"
Required: True
description:
Description: "Data group describing product and rating information"
Expand Down Expand Up @@ -87,8 +87,11 @@ Performance:
performance_map:
Description: "Data group describing motor performance when operating"
Data Type: "{PerformanceMap}"
Notes: ["If no performance map is defined, the motor shall be assumed to transfer all electric power directly to mechanical shaft power",
"***Informative note:*** This field may be omitted for motor-driven equipment where motor efficiencies are incorporated into their performance data"]
Notes:
[
"If no performance map is defined, the motor shall be assumed to transfer all electric power directly to mechanical shaft power",
"***Informative note:*** This field may be omitted for motor-driven equipment where motor efficiencies are incorporated into their performance data",
]

PerformanceMap:
Object Type: "Data Group"
Expand All @@ -111,17 +114,17 @@ GridVariables:
Description: "Delivered rotational shaft power"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[1..]"
- ">=0.0"
- "[1..]"
Units: "W"
Required: True
Scalable: True
shaft_rotational_speed:
Description: "Rotational speed of shaft"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[1..]"
- ">=0.0"
- "[1..]"
Units: "rev/s"
Required: True

Expand All @@ -133,19 +136,19 @@ LookupVariables:
Description: "Efficiency of motor"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "<=1.0"
- "[1..]"
- ">=0.0"
- "<=1.0"
- "[1..]"
Units: "-"
Notes: "Defined as the ratio of mechanical shaft power to electrical input power of the motor"
Required: True
power_factor:
Description: "Power factor of the motor"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "<=1.0"
- "[1..]"
- ">=0.0"
- "<=1.0"
- "[1..]"
Units: "-"
Required: True
operation_state:
Expand Down
51 changes: 30 additions & 21 deletions examples/fan_spec/schema/RS0006.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ CoolingMethod:
ACTIVE_AIR_COOLED:
Description: "Drive is cooled using forced air convection within the surrounding environment"
Display Text: "Active Air Cooled"
Notes: ["Electrical power required for the active cooling system shall be included in the efficiency of the drive",
"All drive efficiency losses are assumed to be added as heat to the surrounding environment"]
Notes:
[
"Electrical power required for the active cooling system shall be included in the efficiency of the drive",
"All drive efficiency losses are assumed to be added as heat to the surrounding environment",
]
ACTIVE_LIQUID_COOLED:
Description: "Drive is cooled using forced liquid convection, transferring heat to the liquid"
Display Text: "Active Liquid Cooled"
Notes: ["Any liquid pumping power shall be modeled external to the drive by the application software",
"All drive efficiency losses are assumed to be added as heat to the liquid stream"]
Notes:
[
"Any liquid pumping power shall be modeled external to the drive by the application software",
"All drive efficiency losses are assumed to be added as heat to the liquid stream",
]

# Data Groups
RS0006:
Expand All @@ -34,7 +40,7 @@ RS0006:
metadata:
Description: "Metadata data group"
Data Type: "{Metadata}"
Constraints: "schema=RS0006"
Constraints: schema_name="RS0006"
Required: True
description:
Description: "Data group describing product and rating information"
Expand All @@ -54,13 +60,13 @@ Description:
ProductInformation:
Object Type: "Data Group"
Data Elements:
manufacturer:
Description: "Manufacturer name"
Data Type: "String"
model_number:
Description: "Model number"
Data Type: "Pattern"
Notes: "Pattern shall match all model numbers that can be represented by the representation"
manufacturer:
Description: "Manufacturer name"
Data Type: "String"
model_number:
Description: "Model number"
Data Type: "Pattern"
Notes: "Pattern shall match all model numbers that can be represented by the representation"

Performance:
Object Type: "Data Group"
Expand Down Expand Up @@ -113,17 +119,17 @@ GridVariables:
Description: "Power delivered to the motor"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[1..]"
- ">=0.0"
- "[1..]"
Units: "W"
Required: True
Scalable: True
output_frequency:
Description: "Frequency delivered to the motor"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "[1..]"
- ">=0.0"
- "[1..]"
Units: "Hz"
Required: True

Expand All @@ -135,12 +141,15 @@ LookupVariables:
Description: "Efficiency of drive"
Data Type: "[Numeric]"
Constraints:
- ">=0.0"
- "<=1.0"
- "[1..]"
- ">=0.0"
- "<=1.0"
- "[1..]"
Units: "-"
Notes: ["Defined as the ratio of electrical output power (to the motor) to electrical input power (to the drive)",
"Input power shall include any power required to provide active air cooling for the drive"]
Notes:
[
"Defined as the ratio of electrical output power (to the motor) to electrical input power (to the drive)",
"Input power shall include any power required to provide active air cooling for the drive",
]
Required: True
operation_state:
Description: "The operation state at the operating conditions"
Expand Down
Loading