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

Allow creation and storing of superruns if SaveWhen > 0 #509

Merged
merged 5 commits into from
Aug 20, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions strax/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ def check_cache(d):
# we have to deactivate the storage converter mode.
stc_mode = self.context_config['storage_converter']
self.context_config['storage_converter'] = False
self.make(list(sub_run_spec.keys()), d)
self.make(list(sub_run_spec.keys()), d, save=(d,))
self.context_config['storage_converter'] = stc_mode

ldrs = []
Expand All @@ -744,7 +744,8 @@ def check_cache(d):
if not ldr:
raise RuntimeError(
f"Could not load {d} for subrun {subrun} "
f"even though we made it??")
"even though we made it? Is the plugin "
"you are requesting a SaveWhen.NEVER-plguin?")
ldrs.append(ldr)

def concat_loader(*args, **kwargs):
Expand Down Expand Up @@ -777,6 +778,7 @@ def concat_loader(*args, **kwargs):
raise strax.DataNotAvailable(
f"{d} for {run_id} not found in any storage, and "
"your context specifies it cannot be created.")

to_compute[d] = p
for dep_d in p.depends_on:
check_cache(dep_d)
Expand All @@ -798,7 +800,9 @@ def concat_loader(*args, **kwargs):
if d not in targets:
return
elif p.save_when == strax.SaveWhen.EXPLICIT:
if d not in save:
# If we arrive here in case of a superrun the user want to save
# as self.context_config['write_superruns'] is true.
if d not in save and not _is_superrun:
WenzDaniel marked this conversation as resolved.
Show resolved Hide resolved
return
else:
assert p.save_when == strax.SaveWhen.ALWAYS
Expand Down