Skip to content
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

Merged
merged 8 commits into from Nov 18, 2021

Conversation

JoranAngevaare
Copy link
Member

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), return None, indicating that you cannot make this data.

@JoranAngevaare JoranAngevaare added enhancement New feature or request Testing Works on testing code labels Nov 18, 2021
@JoranAngevaare JoranAngevaare marked this pull request as ready for review November 18, 2021 12:11
Copy link
Collaborator

@WenzDaniel WenzDaniel left a 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
Comment on lines 1682 to 1683
if check_forbidden and target in forbidden:
return None
Copy link
Collaborator

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point!

Copy link
Contributor

@jmosbacher jmosbacher left a 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):
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah great point!

@JoranAngevaare JoranAngevaare merged commit cfd7992 into AxFoundation:master Nov 18, 2021
@JoranAngevaare JoranAngevaare deleted the get_source_plugins branch November 18, 2021 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Testing Works on testing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants