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
SourceData interface #206
SourceData interface #206
Conversation
Thank you, loving this interface pattern. I'm definitely using It's not strictly touch the code changed in this PR, but I feel the specific syntax here makes it even more natural to expect keys to work without the attached
I realize this remains debatable whether a Karabo viewpoint is valid on files. I actually meant to discuss at some point a general strategy on how to handle this conundrum, but it creeps up here again. I understand if you prefer to postpone it as part of a bigger problem, though. |
Thanks; I think it makes sense to try to do something about |
OK, both Since |
Nice 👍 can we make a quick mention in the documentation, maybe here? |
Yes, of course, good point! |
LGTM |
extra_data/sourcedata.py
Outdated
inc_suspect_trains=self.inc_suspect_trains, | ||
) | ||
|
||
def keys(self): |
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'm sorry striking the same notch (this saying probably doesn't work in English), but what do you think about adding an optional flag here to collapse .value
and .timestamp
? Something like omit_suffix
or collapse_value_and_timestamp
.
While it might only be useful in generic programming, I could imagine it something people want to do with the output from this function, and it might be convenient to provide it.
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.
That seems reasonable enough. What about something that defaults to True for including both as separate keys, like inc_timestamps=False
or value_and_timestamp=False
?
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.
Sure, either way is fine with me!
I've implemented it with I've also used this option when listing keys in lsxfel, so you no longer see separate timestamp & value listed there. |
Thanks, LGTM! |
An object representing one source, with several keys:
Closes #55