-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add Level to Value() #43
base: main
Are you sure you want to change the base?
Conversation
…used for file to prevent open file descriptors
…nown type is provided
…btype/rebrand update
… user to specify the office
…ersions of python
…handled. Updated form for various scenarios.
@@ -293,7 +293,13 @@ def processDateTime(value, key, extra_part=None): | |||
# If the levelId is set, go for that first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just had the realization, what happens if a user sets a levelId in the Value()
and then tries to query a timeseries?
I think I need to make tests with both present. Because the deep copy will continue with the levelId and would just continue to render of the same level Id I think.
Better way to go about it I think is to check if tsid (or params) or levelId change between calls of the Value()
For example
Value(
levelId="some.level.ID"
)
Value(
tsid="some.tsid.id"
)
And in the code notice that tsid was None
before and is now set, then set levelId to None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to change the logic to detect which was provided by the user and null out the other for this instance.
Honestly I'm not super thrilled with the static backed defaults but that would've been a huge diversion from the existing repgen behavior.
Need to test math comparison operators Level vs Level Level vs Timeseries How should a single level be compared against multiple timeseries? Should it only apply if the self.value is set? |
Generally I think the same math follows, as already in value, if the LocationLevel is a single value it should be treated as a scalar, if it's a "time series" of values it should be treated like any other time series. The concept of "Location Level" (or you may want to use "SiteReferenceMetaData" here, that's what we're going to call it in OpenDCS baring someone coming up with a better name) really just determines how it's looked up, changed by others, and when what should be presented, it's still ultimately a scalar value or time series of values. |
…a level and vice versa.
levelId
parameterlevelId
as if it were a timeseries ValueSolves