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 loading SaveWhen.EXPLICIT time range selection #553

Merged
merged 2 commits into from
Oct 13, 2021
Merged
Changes from all commits
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
12 changes: 8 additions & 4 deletions strax/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,13 +770,17 @@ def concat_loader(*args, **kwargs):
# Data not found anywhere. We will be computing it.
self._check_forbidden()
if (time_range is not None
and plugins[target_i].save_when != strax.SaveWhen.NEVER):
and plugins[target_i].save_when > strax.SaveWhen.EXPLICIT):
# While the data type providing the time information is
# available (else we'd have failed earlier), one of the
# other requested data types is not.
raise strax.DataNotAvailable(
f"Time range selection assumes data is already "
f"available, but {target_i} for {run_id} is not.")
error_message = (
f"Time range selection assumes data is already available,"
f" but {target_i} for {run_id} is not.")
if plugins[target_i].save_when == strax.SaveWhen.TARGET:
error_message += (f"\nFirst run st.make({run_id}, "
f"{target_i}) to make {target_i}.")
raise strax.DataNotAvailable(error_message)
if '*' in self.context_config['forbid_creation_of']:
raise strax.DataNotAvailable(
f"{target_i} for {run_id} not found in any storage, and "
Expand Down