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 funcs for getting stored source #590
Add funcs for getting stored source #590
Conversation
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.
Nice and helpful feature thanks a lot. Just one minor comment.
strax/context.py
Outdated
if check_forbidden and target in forbidden: | ||
return 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.
Maybe be more explicit in this case and raise an error or make a warning. Like you have further down.
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.
good point!
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.
Very nice idea, this will probably be used a lot. Just left one small comment (may be possible to make the function a bit smaller==simpler) but even that is not very important.
strax/context.py
Outdated
|
||
stored_sources = set() | ||
for dep in deps: | ||
if self.is_stored(run_id, dep): |
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.
isnt this redundent? shouldnt the recursive call to self.get_source check if its stored or not?
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.
Ah great point!
What is the problem / what does the code in this PR do
Sometimes you want to process
event_info
but don't know if you have all the required datatypes that are needed for making that data. Rather than doing a try for except, you might from the start want to know if that data can be computed, and where you need to start processing from.In this PR we add just that.
Can you briefly describe how it works?
Look at the target you want to compute, if it's not stored, check if the dependencies are stored. If finally you reach a plugin that is either not stored or not depending on anything (
raw_records
), returnNone
, indicating that you cannot make this data.