-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Node.variable can be the name of one or more types (often "Q"), a specific type, or a collection of types stored in a FusedVariable instance. This flexibility sometimes complicates comparisons. Maybe we should implement the following behaviour:
For convenience, |FusedVariable| supports equality comparisons with other fused
variables (Are all handled variable types identical?), individual sequences (Is the
given sequence type among the handled types?), and sequence names (Is any of the
handled types the given name?):
>>> assert T == Temp
>>> assert T != E
>>> assert T == meteo_inputs_Temperature
>>> assert meteo_inputs_Temperature == T
>>> assert T != evap_inputs_ReferenceEvapotranspiration
>>> assert evap_inputs_ReferenceEvapotranspiration != T
>>> assert T == "TemL"
>>> assert "TemL" == T
>>> assert T != "ReferenceEvapotranspiration"
>>> assert "ReferenceEvapotranspiration" != TVery convenient, but a little surprising, and I did not check thoroughly for potential pitfalls. (@sivogel: You encountered related problems a few times. Would this approach help?)