Several PSY structs have fields in fixed natural units. How do we want to handle them? 3 options:
- Units required: support
get_foo(comp, unit) and get_foo_unitful(comp, unit).
- Units optional:
get_foo(comp), get_foo(comp, unit) (convert, returns float), and get_foo_unitful(comp, unit) (convert, returns unitful) are all accepted.
- Units not supported [current]: support
get_foo(comp) only.
Moreover, we don't have to pick the same thing for every single field: we could have some where units are not supported, and others where units are optional.
Pros of 1: uniformity. get_active_power requires units.
Pros of 2: the best of both worlds. Units, but only when you want them; reverse-compatible.
Pros of 3: lowest effort.
Here's a sampling of the various things that are in natural units:
| Struct |
Field |
Quantity type |
Natural units |
ACBus |
base_voltage |
voltage (base) |
kV |
ACBus |
angle |
voltage phase angle |
rad |
ThermalStandard |
time_limits |
time (min up/down) |
min |
| several |
base_power |
apparent power (base) |
MVA |
Line |
angle_limits |
angle difference |
rad |
HydroTurbine |
powerhouse_elevation |
elevation (length) |
m |
TwoTerminalLCCLine |
scheduled_dc_voltage |
DC voltage |
kV |
I tend towards "units optional" everywhere, or almost everywhere (might be a few edge cases where it's a headache).
Several PSY structs have fields in fixed natural units. How do we want to handle them? 3 options:
get_foo(comp, unit)andget_foo_unitful(comp, unit).get_foo(comp),get_foo(comp, unit)(convert, returns float), andget_foo_unitful(comp, unit)(convert, returns unitful) are all accepted.get_foo(comp)only.Moreover, we don't have to pick the same thing for every single field: we could have some where units are not supported, and others where units are optional.
Pros of 1: uniformity.
get_active_powerrequires units.Pros of 2: the best of both worlds. Units, but only when you want them; reverse-compatible.
Pros of 3: lowest effort.
Here's a sampling of the various things that are in natural units:
ACBusbase_voltageACBusangleThermalStandardtime_limitsbase_powerLineangle_limitsHydroTurbinepowerhouse_elevationTwoTerminalLCCLinescheduled_dc_voltageI tend towards "units optional" everywhere, or almost everywhere (might be a few edge cases where it's a headache).