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

Updated QUDT to v2.1.32 #579

Merged
merged 54 commits into from
Jan 4, 2024
Merged

Updated QUDT to v2.1.32 #579

merged 54 commits into from
Jan 4, 2024

Conversation

steveraysteveray
Copy link
Collaborator

No description provided.

gtfierro and others added 30 commits September 27, 2023 14:34
…atio_Setpoint in setpoint.py.

# Aider chat conversation:

USER: For all subclasses of Current_Ratio_Setpoint in bricksrc/setpoint.py, add a BRICK.hasQuantity annotation (if it does not already have one) using the correct quantity from bricksrc/quantities.py. If one does not exist, use a QUDT quantity kind from the QUDTQK namespace. For "Demand", just use BRICK.Power

ASSISTANT: ```diff
--- bricksrc/setpoint.py
+++ bricksrc/setpoint.py
@@ ... @@
             "Current_Ratio_Setpoint": {
+                BRICK.hasQuantity: BRICK.Electric_Current,
                 "tags": [TAG.Point, TAG.Setpoint, TAG.Current, TAG.Electric, TAG.Ratio]
             },
             "Voltage_Ratio_Setpoint": {
+                BRICK.hasQuantity: BRICK.Voltage,
                 "tags": [TAG.Point, TAG.Setpoint, TAG.Voltage, TAG.Electric, TAG.Ratio]
             },
             "Frequency_Setpoint": {
                 "tags": [TAG.Point, TAG.Setpoint, TAG.Frequency],
                 BRICK.hasQuantity: BRICK.Frequency,
             },
             "Illuminance_Setpoint": {
+                BRICK.hasQuantity: BRICK.Illuminance,
                 "tags": [TAG.Point, TAG.Setpoint, TAG.Illuminance]
             },
             "Enthalpy_Setpoint": {
                 BRICK.hasQuantity: QUDTQK.Enthalpy,
                 "tags": [TAG.Point, TAG.Setpoint, TAG.Enthalpy],
             },
             "Dewpoint_Setpoint": {
                 BRICK.hasQuantity: BRICK.Dewpoint,
                 "tags": [TAG.Point, TAG.Dewpoint, TAG.Setpoint],
             },
             "Demand_Setpoint": {
+                BRICK.hasQuantity: BRICK.Power,
                 "tags": [TAG.Point, TAG.Demand, TAG.Setpoint],
                 "subclasses": {
                     "Cooling_Demand_Setpoint": {
+                        BRICK.hasQuantity: BRICK.Power,
                         "tags": [TAG.Point, TAG.Cool, TAG.Demand, TAG.Setpoint],
                     },
                     "Heating_Demand_Setpoint": {
+                        BRICK.hasQuantity: BRICK.Power,
                         "tags": [TAG.Point, TAG.Heat, TAG.Demand, TAG.Setpoint],
                     },
                     "Preheat_Demand_Setpoint": {
+                        BRICK.hasQuantity: BRICK.Power,
                         "tags": [TAG.Point, TAG.Preheat, TAG.Demand, TAG.Setpoint],
                     },
                     "Air_Flow_Demand_Setpoint": {
                         BRICK.hasSubstance: BRICK.Air,
                         BRICK.hasQuantity: BRICK.Flow,
                         "tags": [
                             TAG.Point,
                             TAG.Air,
                             TAG.Flow,
                             TAG.Demand,
                             TAG.Setpoint,
                         ],
                         "subclasses": {
                             "Supply_Air_Flow_Demand_Setpoint": {
                                 BRICK.hasSubstance: [
                                     BRICK.Supply_Air,
                                     BRICK.Discharge_Air,
                                 ],
                                 BRICK.hasQuantity: BRICK.Flow,
                                 "aliases": [
                                     BRICK["Discharge_Air_Flow_Demand_Setpoint"]
                                 ],
                                 "tags": [
                                     TAG.Point,
                                     TAG.Supply,
                                     TAG.Discharge,
                                     TAG.Air,
                                     TAG.Flow,
                                     TAG.Demand,
                                     TAG.Setpoint,
                                 ],
                             },
                         },
                     },
                 },
             },
```
…nt in setpoint.py.

# Aider chat conversation:

USER: For all subclasses of `Flow_Setpoint` in bricksrc/setpoint.py, add a BRICK.hasQuantity annotation (if it does not already have one) using the correct quantity from bricksrc/quantities.py. If one does not exist, use a QUDT quantity kind from the QUDTQK namespace. For "Demand", just use BRICK.Power

ASSISTANT: ```diff
--- bricksrc/setpoint.py
+++ bricksrc/setpoint.py
@@ ... @@
             "Flow_Setpoint": {
+                BRICK.hasQuantity: BRICK.VolumeFlowRate,
                 "tags": [TAG.Point, TAG.Flow, TAG.Setpoint],
                 "subclasses": {
                     "Air_Flow_Setpoint": {
+                        BRICK.hasQuantity: BRICK.VolumeFlowRate,
                         BRICK.hasSubstance: BRICK.Air,
                         "tags": [TAG.Point, TAG.Air, TAG.Flow, TAG.Setpoint],
                         "subclasses": {
@@ ... @@
                             "Air_Flow_Demand_Setpoint": {
+                                BRICK.hasQuantity: BRICK.Power,
                                 "tags": [
                                     TAG.Point,
                                     TAG.Air,
                                     TAG.Flow,
                                     TAG.Demand,
                                     TAG.Setpoint,
                                 ],
                             },
@@ ... @@
                             "Exhaust_Air_Flow_Setpoint": {
+                                BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                 BRICK.hasSubstance: BRICK.Exhaust_Air,
                                 "subclasses": {
                                     "Exhaust_Air_Stack_Flow_Setpoint": {
+                                        BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                         "tags": [
                                             TAG.Point,
                                             TAG.Exhaust,
                                             TAG.Air,
                                             TAG.Stack,
                                             TAG.Flow,
                                             TAG.Setpoint,
                                         ],
                                     }
                                 },
                                 "tags": [
                                     TAG.Point,
                                     TAG.Exhaust,
                                     TAG.Air,
                                     TAG.Flow,
                                     TAG.Setpoint,
                                 ],
                             },
                             "Outside_Air_Flow_Setpoint": {
+                                BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                 BRICK.hasSubstance: BRICK.Outside_Air,
                                 "tags": [
                                     TAG.Point,
                                     TAG.Outside,
                                     TAG.Air,
                                     TAG.Flow,
                                     TAG.Setpoint,
                                 ],
                             },
                             "Supply_Air_Flow_Setpoint": {
+                                BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                 BRICK.hasSubstance: [
                                     BRICK.Supply_Air,
                                     BRICK.Discharge_Air,
                                 ],
                                 "aliases": [BRICK["Discharge_Air_Flow_Setpoint"]],
                                 "subclasses": {
                                     "Supply_Air_Flow_Demand_Setpoint": {
+                                        BRICK.hasQuantity: BRICK.Power,
                                         "aliases": [
                                             BRICK["Discharge_Air_Flow_Demand_Setpoint"]
                                         ],
                                         "tags": [
                                             TAG.Point,
                                             TAG.Supply,
                                             TAG.Discharge,
                                             TAG.Air,
                                             TAG.Flow,
                                             TAG.Demand,
                                             TAG.Setpoint,
                                         ],
                                     },
                                     "Occupied_Supply_Air_Flow_Setpoint": {
                                         "aliases": [
                                             BRICK[
                                                 "Occupied_Discharge_Air_Flow_Setpoint"
                                             ]
                                         ],
                                         "subclasses": {
                                             "Occupied_Cooling_Supply_Air_Flow_Setpoint": {
                                                 "aliases": [
                                                     BRICK[
                                                         "Occupied_Cooling_Discharge_Air_Flow_Setpoint"
                                                     ]
                                                 ],
                                                 "tags": [
                                                     TAG.Point,
                                                     TAG.Occupied,
                                                     TAG.Cool,
                                                     TAG.Supply,
                                                     TAG.Discharge,
                                                     TAG.Air,
                                                     TAG.Flow,
                                                     TAG.Setpoint,
                                                 ],
                                                 "parents": [
                                                     BRICK.Cooling_Discharge_Air_Flow_Setpoint,
                                                     BRICK.Cooling_Supply_Air_Flow_Setpoint,
                                                 ],
                                             },
                                             "Occupied_Heating_Supply_Air_Flow_Setpoint": {
                                                 "aliases": [
                                                     BRICK[
                                                         "Occupied_Heating_Discharge_Air_Flow_Setpoint"
                                                     ]
                                                 ],
                                                 "tags": [
                                                     TAG.Point,
                                                     TAG.Occupied,
                                                     TAG.Heat,
                                                     TAG.Supply,
                                                     TAG.Discharge,
                                                     TAG.Air,
                                                     TAG.Flow,
                                                     TAG.Setpoint,
                                                 ],
                                                 "parents": [
                                                     BRICK.Heating_Discharge_Air_Flow_Setpoint,
                                                     BRICK.Heating_Supply_Air_Flow_Setpoint,
                                                 ],
                                             },
                                         },
                                         "tags": [
                                             TAG.Point,
                                             TAG.Occupied,
                                             TAG.Supply,
                                             TAG.Discharge,
                                             TAG.Air,
                                             TAG.Flow,
                                             TAG.Setpoint,
                                         ],
                                     },
                                     "Unoccupied_Supply_Air_Flow_Setpoint": {
                                         "aliases": [
                                             BRICK[
                                                 "Unoccupied_Discharge_Air_Flow_Setpoint"
                                             ]
                                         ],
                                         "subclasses": {
                                             "Unoccupied_Cooling_Supply_Air_Flow_Setpoint": {
                                                 "aliases": [
                                                     BRICK[
                                                         "Unoccupied_Cooling_Discharge_Air_Flow_Setpoint"
                                                     ]
                                                 ],
                                                 "tags": [
                                                     TAG.Point,
                                                     TAG.Unoccupied,
                                                     TAG.Cool,
                                                     TAG.Supply,
                                                     TAG.Discharge,
                                                     TAG.Air,
                                                     TAG.Flow,
                                                     TAG.Setpoint,
                                                 ],
                                                 "parents": [
                                                     BRICK.Cooling_Discharge_Air_Flow_Setpoint,
                                                     BRICK.Cooling_Supply_Air_Flow_Setpoint,
                                                 ],
                                             },
                                             "Unoccupied_Heating_Supply_Air_Flow_Setpoint": {
                                                 "aliases": [
                                                     BRICK[
                                                         "Unoccupied_Heating_Discharge_Air_Flow_Setpoint"
                                                     ]
                                                 ],
                                                 "tags": [
                                                     TAG.Point,
                                                     TAG.Unoccupied,
                                                     TAG.Heat,
                                                     TAG.Supply,
                                                     TAG.Discharge,
                                                     TAG.Air,
                                                     TAG.Flow,
                                                     TAG.Setpoint,
                                                 ],
                                                 "parents": [
                                                     BRICK.Heating_Discharge_Air_Flow_Setpoint,
                                                     BRICK.Heating_Supply_Air_Flow_Setpoint,
                                                 ],
                                             },
                                         },
                                         "tags": [
                                             TAG.Point,
                                             TAG.Unoccupied,
                                             TAG.Supply,
                                             TAG.Discharge,
                                             TAG.Air,
                                             TAG.Flow,
                                             TAG.Setpoint,
                                         ],
                                     },
                                     "Cooling_Supply_Air_Flow_Setpoint": {
                                         "aliases": [
                                             BRICK["Cooling_Discharge_Air_Flow_Setpoint"]
                                         ],
                                         "tags": [
                                             TAG.Point,
                                             TAG.Cool,
                                             TAG.Supply,
                                             TAG.Discharge,
                                             TAG.Air,
                                             TAG.Flow,
                                             TAG.Setpoint,
                                         ],
                                     },
                                     "Heating_Supply_Air_Flow_Setpoint": {
                                         "aliases": [
                                             BRICK["Heating_Discharge_Air_Flow_Setpoint"]
                                         ],
                                         "tags": [
                                             TAG.Point,
                                             TAG.Heat,
                                             TAG.Supply,
                                             TAG.Discharge,
                                             TAG.Air,
                                             TAG.Flow,
                                             TAG.Setpoint,
                                         ],
                                     },
                                 },
                                 "tags": [
                                     TAG.Point,
                                     TAG.Supply,
                                     TAG.Discharge,
                                     TAG.Air,
                                     TAG.Flow,
                                     TAG.Setpoint,
                                 ],
                             },
                         },
                     },
                     "Water_Flow_Setpoint": {
+                        BRICK.hasQuantity: BRICK.VolumeFlowRate,
                         BRICK.hasSubstance: BRICK.Water,
                         "tags": [
                             TAG.Point,
                             TAG.Water,
                             TAG.Flow,
                             TAG.Setpoint,
                         ],
                         "subclasses": {
                             "Condenser_Water_Flow_Setpoint": {
+                                BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                 BRICK.hasSubstance: BRICK.Condenser_Water,
                                 "tags": [
                                     TAG.Point,
                                     TAG.Condenser,
                                     TAG.Water,
                                     TAG.Flow,
                                     TAG.Setpoint,
                                 ],
                             },
                             "Entering_Water_Flow_Setpoint": {
+                                BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                 BRICK.hasSubstance: BRICK.Entering_Water,
                                 "tags": [
                                     TAG.Point,
                                     TAG.Entering,
                                     TAG.Water,
                                     TAG.Flow,
                                     TAG.Setpoint,
                                 ],
                                 "subclasses": {
                                     "Entering_Chilled_Water_Flow_Setpoint": {
+                                        BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                         BRICK.hasSubstance: BRICK.Entering_Chilled_Water,
                                         "tags": [
                                             TAG.Point,
                                             TAG.Chilled,
                                             TAG.Water,
                                             TAG.Entering,
                                             TAG.Flow,
                                             TAG.Setpoint,
                                         ],
                                         "parents": [BRICK.Chilled_Water_Flow_Setpoint],
                                     },
                                     "Entering_Hot_Water_Flow_Setpoint": {
+                                        BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                         BRICK.hasSubstance: BRICK.Entering_Hot_Water,
                                         "tags": [
                                             TAG.Point,
                                             TAG.Hot,
                                             TAG.Water,
                                             TAG.Entering,
                                             TAG.Flow,
                                             TAG.Setpoint,
                                         ],
                                         "parents": [BRICK.Hot_Water_Flow_Setpoint],
                                     },
                                 },
                             },
                             "Leaving_Water_Flow_Setpoint": {
+                                BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                 BRICK.hasSubstance: BRICK.Leaving_Water,
                                 "tags": [
                                     TAG.Point,
                                     TAG.Leaving,
                                     TAG.Water,
                                     TAG.Flow,
                                     TAG.Setpoint,
                                 ],
                                 "subclasses": {
                                     "Leaving_Chilled_Water_Flow_Setpoint": {
+                                        BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                         BRICK.hasSubstance: BRICK.Leaving_Chilled_Water,
                                         "tags": [
                                             TAG.Point,
                                             TAG.Chilled,
                                             TAG.Water,
                                             TAG.Leaving,
                                             TAG.Flow,
                                             TAG.Setpoint,
                                         ],
                                         "parents": [BRICK.Chilled_Water_Flow_Setpoint],
                                     },
                                     "Leaving_Hot_Water_Flow_Setpoint": {
+                                        BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                         BRICK.hasSubstance: BRICK.Leaving_Hot_Water,
                                         "tags": [
                                             TAG.Point,
                                             TAG.Hot,
                                             TAG.Water,
                                             TAG.Leaving,
                                             TAG.Flow,
                                             TAG.Setpoint,
                                         ],
                                         "parents": [BRICK.Hot_Water_Flow_Setpoint],
                                     },
                                 },
                             },
                             "Hot_Water_Flow_Setpoint": {
+                                BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                 BRICK.hasSubstance: BRICK.Hot_Water,
                                 "tags": [
                                     TAG.Point,
                                     TAG.Hot,
                                     TAG.Water,
                                     TAG.Flow,
                                     TAG.Setpoint,
                                 ],
                             },
                             "Chilled_Water_Flow_Setpoint": {
+                                BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                 BRICK.hasSubstance: BRICK.Chilled_Water,
                                 "tags": [
                                     TAG.Point,
                                     TAG.Chilled,
                                     TAG.Water,
                                     TAG.Flow,
                                     TAG.Setpoint,
                                 ],
                             },
                             "Bypass_Water_Flow_Setpoint": {
+                                BRICK.hasQuantity: BRICK.VolumeFlowRate,
                                 BRICK.hasSubstance: BRICK.Bypass_Water,
                                 "tags": [
                                     TAG.Point,
                                     TAG.Bypass,
                                     TAG.Water,
                                     TAG.Flow,
                                     TAG.Setpoint,
                                 ],
                             },
                         },
                     },
                 },
             },
```
…ith QUDTQK.VolumeFlowRate.

# Aider chat conversation:

USER: Replace BRICK.Flow_Loss, BRICK.Flow and BRICK.VolumeFlowRate with QUDTQK.VolumeFlowRate

ASSISTANT: ```diff
--- bricksrc/setpoint.py
+++ bricksrc/setpoint.py
@@ ... @@
             "Flow_Setpoint": {
-                BRICK.hasQuantity: BRICK.Flow,
-            "Flow_Setpoint": {
-                BRICK.hasQuantity: BRICK.VolumeFlowRate,
+                BRICK.hasQuantity: QUDTQK.VolumeFlowRate,
                 "tags": [TAG.Point, TAG.Flow, TAG.Setpoint],
                 "subclasses": {
                     "Air_Flow_Setpoint": {
-                        BRICK.hasQuantity: BRICK.VolumeFlowRate,
-                        BRICK.hasSubstance: BRICK.Air,
-                        BRICK.hasQuantity: BRICK.Flow,
+                        BRICK.hasQuantity: QUDTQK.VolumeFlowRate,
+                        BRICK.hasSubstance: BRICK.Air,
                         "tags": [TAG.Point, TAG.Air, TAG.Flow, TAG.Setpoint],
                         "subclasses": {
                             "Air_Flow_Demand_Setpoint": {
                                 BRICK.hasQuantity: BRICK.Power,
                                 "tags": [
                                     TAG.Point,
                                     TAG.Air,
                                     TAG.Flow,
                                     TAG.Demand,
                                     TAG.Setpoint,
                                 ],
                             },
                             "Exhaust_Air_Flow_Setpoint": {
-                                BRICK.hasQuantity: BRICK.VolumeFlowRate,
-                                BRICK.hasSubstance: BRICK.Exhaust_Air,
-                                BRICK.hasQuantity: BRICK.Flow,
+                                BRICK.hasQuantity: QUDTQK.VolumeFlowRate,
+                                BRICK.hasSubstance: BRICK.Exhaust_Air,
                                 "subclasses": {
                                     "Exhaust_Air_Stack_Flow_Setpoint": {
-                                        BRICK.hasQuantity: BRICK.VolumeFlowRate,
+                                        BRICK.hasQuantity: QUDTQK.VolumeFlowRate,
                                         "tags": [
                                             TAG.Point,
                                             TAG.Exhaust,
                                             TAG.Air,
                                             TAG.Stack,
                                             TAG.Flow,
                                             TAG.Setpoint,
                                         ],
                                     }
                                 },
                                 "tags": [
                                     TAG.Point,
                                     TAG.Exhaust,
                                     TAG.Air,
                                     TAG.Flow,
                                     TAG.Setpoint,
                                 ],
                             },
                             "Outside_Air_Flow_Setpoint": {
-                                BRICK.hasQuantity: BRICK.VolumeFlowRate,
-                                BRICK.hasSubstance: BRICK.Outside_Air,
-                                BRICK.hasQuantity: BRICK.Flow,
+                                BRICK.hasQuantity: QUDTQK.VolumeFlowRate,
+                                BRICK.hasSubstance: BRICK.Outside_Air,
                                 "tags": [
                                     TAG.Point,
                                     TAG.Outside,
                                     TAG.Air,
                                     TAG.Flow,
                                     TAG.Setpoint,
                                 ],
                             },
                             "Supply_Air_Flow_Setpoint": {
-                                BRICK.hasQuantity: BRICK.VolumeFlowRate,
-                                BRICK.hasSubstance: [
-                                    BRICK.Supply_Air,
-                                    BRICK.Discharge_Air,
-                                ],
-                                BRICK.hasQuantity: BRICK.Flow,
+                                BRICK.hasQuantity: QUDTQK.VolumeFlowRate,
+                                BRICK.hasSubstance: [
+                                    BRICK.Supply_Air,
+                                    BRICK.Discharge_Air,
+                                ],
                                 "aliases": [BRICK["Discharge_Air_Flow_Setpoint"]],
                                 "subclasses": {
                                     "Supply_Air_Flow_Demand_Setpoint": {
                                         BRICK.hasQuantity: BRICK.Power,
                                         "aliases": [
                                             BRICK["Discharge_Air_Flow_Demand_Setpoint"]
                                         ],
                                         "tags": [
                                             TAG.Point,
                                             TAG.Supply,
                                             TAG.Discharge,
                                             TAG.Air,
                                             TAG.Flow,
                                             TAG.Demand,
                                             TAG.Setpoint,
                                         ],
                                     },
                                     ...
                                 },
                                 "tags": [
                                     TAG.Point,
                                     TAG.Supply,
                                     TAG.Discharge,
                                     TAG.Air,
                                     TAG.Flow,
                                     TAG.Setpoint,
                                 ],
                             },
                         },
                     },
                     "Water_Flow_Setpoint": {
-                        BRICK.hasQuantity: BRICK.VolumeFlowRate,
-                        BRICK.hasSubstance: BRICK.Water,
-                        BRICK.hasQuantity: BRICK.Flow,
+                        BRICK.hasQuantity: QUDTQK.VolumeFlowRate,
+                        BRICK.hasSubstance: BRICK.Water,
                         "tags": [
                             TAG.Point,
                             TAG.Water,
                             TAG.Flow,
                             TAG.Setpoint,
                         ],
                         "subclasses": {
                             "Condenser_Water_Flow_Setpoint": {
-                                BRICK.hasQuantity: BRICK.VolumeFlowRate,
-                                BRICK.hasSubstance: BRICK.Condenser_Water,
-                                BRICK.hasQuantity: BRICK.Flow,
+                                BRICK.hasQuantity: QUDTQK.VolumeFlowRate,
+                                BRICK.hasSubstance: BRICK.Condenser_Water,
                                 "tags": [
                                     TAG.Point,
                                     TAG.Condenser,
                                     TAG.Water,
                                     TAG.Flow,
                                     TAG.Setpoint,
                                 ],
                             },
                             ...
                         },
                     },
                 },
             },
@@ ... @@
```
…uantity annotation from bricksrc/quantities.py or QUDTQK namespace.

# Aider chat conversation:

USER: For all subclasses of `Humidity_Setpoint` in bricksrc/setpoint.py, add a BRICK.hasQuantity annotation (if it does not already have one) using the correct quantity from bricksrc/quantities.py. If one does not exist, use a QUDT quantity kind from the QUDTQK namespace. For "Demand", just use BRICK.Power

ASSISTANT: ```diff
--- bricksrc/setpoint.py
+++ bricksrc/setpoint.py
@@ ... @@
             "Humidity_Setpoint": {
+                BRICK.hasQuantity: BRICK.Relative_Humidity,
                 "tags": [TAG.Point, TAG.Humidity, TAG.Setpoint],
                 "subclasses": {
                     "Unoccupied_Humidity_Setpoint": {
+                        BRICK.hasQuantity: BRICK.Relative_Humidity,
                         "tags": [TAG.Point, TAG.Humidity, TAG.Setpoint, TAG.Unoccupied],
                     },
                     "Occupied_Humidity_Setpoint": {
+                        BRICK.hasQuantity: BRICK.Relative_Humidity,
                         "tags": [TAG.Point, TAG.Humidity, TAG.Setpoint, TAG.Occupied],
                     },
                     "Bypass_Air_Humidity_Setpoint": {
+                        BRICK.hasQuantity: BRICK.Relative_Humidity,
                         BRICK.hasSubstance: BRICK.Bypass_Air,
                         "tags": [
                             TAG.Point,
                             TAG.Humidity,
                             TAG.Setpoint,
                             TAG.Air,
                             TAG.Bypass,
                         ],
                     },
                     "Outside_Air_Humidity_Setpoint": {
+                        BRICK.hasQuantity: BRICK.Relative_Humidity,
                         BRICK.hasSubstance: BRICK.Outside_Air,
                         "tags": [
                             TAG.Point,
                             TAG.Humidity,
                             TAG.Setpoint,
                             TAG.Air
^C KeyboardInterrupt

USER: For all subclasses of `Humidity_Setpoint` in bricksrc/setpoint.py ensure that the BRICK.hasQuantity value is QUDTQK.RelativeHumidity *unless* the class is an absolute humidity class, which should use QUDTQK.AbsoluteHumidity

ASSISTANT: ```diff
--- bricksrc/setpoint.py
+++ bricksrc/setpoint.py
@@ ... @@
             "Humidity_Setpoint": {
-                BRICK.hasQuantity: BRICK.Relative_Humidity,
+                BRICK.hasQuantity: QUDTQK.RelativeHumidity,
                 "tags": [TAG.Point, TAG.Humidity, TAG.Setpoint],
                 "subclasses": {
                     "Unoccupied_Humidity_Setpoint": {
-                        BRICK.hasQuantity: BRICK.Relative_Humidity,
+                        BRICK.hasQuantity: QUDTQK.RelativeHumidity,
                         "tags": [TAG.Point, TAG.Humidity, TAG.Setpoint, TAG.Unoccupied],
                     },
                     "Occupied_Humidity_Setpoint": {
-                        BRICK.hasQuantity: BRICK.Relative_Humidity,
+                        BRICK.hasQuantity: QUDTQK.RelativeHumidity,
                         "tags": [TAG.Point, TAG.Humidity, TAG.Setpoint, TAG.Occupied],
                     },
                     "Bypass_Air_Humidity_Setpoint": {
-                        BRICK.hasQuantity: BRICK.Relative_Humidity,
+                        BRICK.hasQuantity: QUDTQK.RelativeHumidity,
                         BRICK.hasSubstance: BRICK.Bypass_Air,
                         "tags": [
                             TAG.Point,
                             TAG.Humidity,
                             TAG.Setpoint,
                             TAG.Air,
                             TAG.Bypass,
                         ],
                     },
                     "Outside_Air_Humidity_Setpoint": {
-                        BRICK.hasQuantity: BRICK.Relative_Humidity,
+                        BRICK.hasQuantity: QUDTQK.RelativeHumidity,
                         BRICK.hasSubstance: BRICK.Outside_Air,
                         "tags": [
                             TAG.Point,
                             TAG.Humidity,
                             TAG.Setpoint,
                             TAG.Air,
                             TAG.Outside,
                         ],
                     },
                     "Zone_Air_Humidity_Setpoint": {
-                        BRICK.hasQuantity: BRICK.Relative_Humidity,
+                        BRICK.hasQuantity: QUDTQK.RelativeHumidity,
                         BRICK.hasSubstance: BRICK.Zone_Air,
                         "tags": [
                             TAG.Point,
                             TAG.Humidity,
                             TAG.Setpoint,
                             TAG.Air,
                             TAG.Zone,
                         ],
                     },
                     "Building_Air_Humidity_Setpoint": {
-                        BRICK.hasQuantity: BRICK.Relative_Humidity,
+                        BRICK.hasQuantity: QUDTQK.RelativeHumidity,
                         BRICK.hasSubstance: BRICK.Building_Air,
                         "tags": [
                             TAG.Point,
                             TAG.Humidity,
                             TAG.Setpoint,
                             TAG.Air,
                             TAG.Building,
                         ],
                     },
                     "Mixed_Air_Humidity_Setpoint": {
-                        BRICK.hasQuantity: BRICK.Relative_Humidity,
+                        BRICK.hasQuantity: QUDTQK.RelativeHumidity,
                         BRICK.hasSubstance: BRICK.Mixed_Air,
                         "tags": [
                             TAG.Point,
                             TAG.Humidity,
                             TAG.Setpoint,
                             TAG.Air,
                             TAG.Mixed,
                         ],
                     },
                     "Return_Air_Humidity_Setpoint": {
-                        BRICK.hasQuantity: BRICK.Relative_Humidity,
+                        BRICK.hasQuantity: QUDTQK.RelativeHumidity,
                         BRICK.hasSubstance: BRICK.Return_Air,
                         "tags": [
                             TAG.Point,
                             TAG.Humidity,
                             TAG.Setpoint,
                             TAG.Air,
                             TAG.Return,
                         ],
                     },
                     "Exhaust_Air_Humidity_Setpoint": {
-                        BRICK.hasQuantity: BRICK.Relative_Humidity,
+                        BRICK.hasQuantity: QUDTQK.RelativeHumidity,
                         BRICK.hasSubstance: BRICK.Exhaust_Air,
                         "tags": [
                             TAG.Point,
                             TAG.Humidity,
                             TAG.Setpoint,
                             TAG.Air,
                             TAG.Exhaust,
                         ],
                     },
                     "Supply_Air_Humidity_Setpoint": {
-                        BRICK.hasQuantity: BRICK.Relative_Humidity,
+                        BRICK.hasQuantity: QUDTQK.RelativeHumidity,
                         BRICK.hasSubstance: [BRICK.Supply_Air, BRICK.Discharge_Air],
                         "aliases": [BRICK["Discharge_Air_Humidity_Setpoint"]],
                         "tags": [
                             TAG.Point,
                             TAG.Humidity,
                             TAG.Setpoint,
                             TAG.Air,
                             TAG.Supply,
                             TAG.Discharge,
                         ],
                     },
                 },
             },
@@ ... @@
```
…tion down subclass tree.

# Aider chat conversation:

USER: I did `git reset --hard HEAD~1` to discard the last edits.

ASSISTANT: Understood. If you need any changes to be made to the `generate_brick.py` file or any other *read-write* files, please let me know the specific modifications you require.

USER: Make sure that the BRICK.hasQuantity annotation is inherited down the subclass tree unless a subclass already specifies a BRICK.hasQuantity

ASSISTANT: To ensure that the `BRICK.hasQuantity` annotation is inherited down the subclass tree unless a subclass already specifies a `BRICK.hasQuantity`, I will implement a recursive function that traverses the class hierarchy and adds the `BRICK.hasQuantity` annotation from parent to child, unless the child already has the annotation defined.

Here is the diff for the changes:

```diff
--- generate_brick.py
+++ generate_brick.py
@@ ... @@

+def inherit_has_quantity(definitions, parent_quantity=None):
+    """
+    Recursively ensures that the BRICK.hasQuantity annotation is inherited down the
+    subclass tree unless a subclass already specifies a BRICK.hasQuantity.
+    """
+    for classname, defn in definitions.items():
+        # Inherit BRICK.hasQuantity from parent if not defined in the current class
+        if 'hasQuantity' not in defn and parent_quantity is not None:
+            defn['hasQuantity'] = parent_quantity
+
+        # Recursively apply to subclasses
+        subclassdef = defn.get("subclasses", {})
+        assert isinstance(subclassdef, dict)
+        inherit_has_quantity(subclassdef, defn.get('hasQuantity', parent_quantity))
+
+inherit_has_quantity(equipment_subclasses)
+inherit_has_quantity(location_subclasses)
+inherit_has_quantity(point_subclasses)
+inherit_has_quantity(collection_classes)
+inherit_has_quantity(hvac_subclasses)
+inherit_has_quantity(hvac_valve_subclasses)
+inherit_has_quantity(valve_subclasses)
+inherit_has_quantity(security_subclasses)
+inherit_has_quantity(safety_subclasses)
+
 def define_classes(definitions, parent, pun_classes=False, graph=G):
     """
     Generates triples for the hierarchy given by 'definitions', rooted
@@ ... @@
```

This change adds a new function `inherit_has_quantity` that is called for each of the root class hierarchies in the Brick model. The function will traverse the class definitions and ensure that the `BRICK.hasQuantity` annotation is properly inherited unless overridden by a subclass.
add Brick Quantity classes or QUDTQK QuantityKinds to every subclass in setpoint.py under the BRICK.hasQuantity key. Skip all subclasses that already have a BRICK.hasQuantityKey. Give the results to me as a code diff. Use the name of the subclass to make a good guess at the correct Brick quantity or QUDT quantitykind
…erences to it in `bricksrc/setpoint.py` with QUDTQK.DewPointTemperature.
@steveraysteveray
Copy link
Collaborator Author

Just ran the TBC inference then validation on Brick.ttl in this branch as of 2024-01-04, after your ontoenv fix (which worked). Here's the validation report, FYI:

image

@gtfierro gtfierro merged commit a831264 into master Jan 4, 2024
2 checks passed
@gtfierro gtfierro deleted the srr-update-qudt branch January 4, 2024 21:47
@gtfierro
Copy link
Member

gtfierro commented Jan 5, 2024

Thanks, @steveraysteveray ! I think the rest of these are mostly Warning/Info errors now, but all the Violations are gone? I want to prioritize some other PRs first but I will eventually get back to those. One issue I'm running into is the fixed point inference in the TopQuadrant SHACL implementation isn't working the way I expect, but I haven't pinned down the issue yet.

@steveraysteveray
Copy link
Collaborator Author

All violations are indeed gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants