You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many of the ERD code values are represented by Enums, NamedTuples, or similar. Currently, translation between those occurs in a bunch of tiny functions in erd_utils.py. This is gross and cumbersome. Rather, we should have a protocol like
and have each of those special types implement the protocol. Unencodable values can simply raise a NotImplementedError or similar. The Appliance.{encode/decode}_erd_value methods can then be updated to simply dispatch to the correct object's method.
We'll also probably need a register_erd_type(erd_code: ErdType) decorator to set up dispatch to the correct decoded.
The text was updated successfully, but these errors were encountered:
Many of the ERD code values are represented by Enums, NamedTuples, or similar. Currently, translation between those occurs in a bunch of tiny functions in erd_utils.py. This is gross and cumbersome. Rather, we should have a protocol like
and have each of those special types implement the protocol. Unencodable values can simply raise a
NotImplementedError
or similar. TheAppliance.{encode/decode}_erd_value
methods can then be updated to simply dispatch to the correct object's method.We'll also probably need a
register_erd_type(erd_code: ErdType)
decorator to set up dispatch to the correct decoded.The text was updated successfully, but these errors were encountered: