Skip to content

Commit

Permalink
Merge branch 'master' into fix_coverage_reports
Browse files Browse the repository at this point in the history
  • Loading branch information
WenzDaniel committed Mar 8, 2022
2 parents 12fd5b4 + ae43722 commit 26791f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
16 changes: 12 additions & 4 deletions strax/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,12 +920,20 @@ def concat_loader(*args, **kwargs):
return

# Now we should check whether we meet the saving requirements (Explicit, Target etc.)
# In case of the storage converter mode we copy already existing data. So we do not
# have to check for the saving requirements here.
current_plugin_to_savers = [target_i]
if (not self._target_should_be_saved(
target_plugin, target_i, targets, save, loader, _is_superrun)
and not self.context_config['storage_converter']):
# In case of the storage converter mode we copy already existing data. So we do not
# have to check for the saving requirements here.
return
if len(target_plugin.provides) > 1:
# In case the plugin has more then a single provides we also have to check
# whether any of the other data_types should be stored. Hence only remove
# the current traget from the list of plugins_to_savers.
current_plugin_to_savers = []
else:
# In case of a single-provide plugin we can return now.
return

# Warn about conditions that preclude saving, but the user
# might not expect.
Expand Down Expand Up @@ -957,7 +965,7 @@ def concat_loader(*args, **kwargs):
savers = self._add_saver(savers, target_i, target_plugin,
_is_superrun, loading_this_data)
else:
for d_to_save in set([target_i] + list(target_plugin.provides)):
for d_to_save in set(current_plugin_to_savers + list(target_plugin.provides)):
key = self.key_for(run_id, d_to_save)
loader = self._get_partial_loader_for(key,
time_range=time_range,
Expand Down
10 changes: 3 additions & 7 deletions tests/test_multi_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,10 @@ def test_save_when_per_provide(self):
for d in p.provides:
assert p.save_when[d] == _save_when[d]

# Test if call of NEVER data_type makes any data:
assert not self.mystrax.is_stored('0', 'even_recs')
assert not self.mystrax.is_stored('0', 'odd_recs')
assert not self.mystrax.is_stored('0', 'rec_count')
self.mystrax.make('0', 'even_recs')
# See if only ALWAYS is made:
assert not self.mystrax.is_stored('0', 'even_recs')
assert not self.mystrax.is_stored('0', 'odd_recs')
assert not self.mystrax.is_stored('0', 'rec_count')

# See if only ALWAYS is made:
self.mystrax.make('0', 'rec_count')
assert not self.mystrax.is_stored('0', 'even_recs')
assert not self.mystrax.is_stored('0', 'odd_recs')
Expand Down Expand Up @@ -230,10 +224,12 @@ def test_save_per_provide_inlined(self):
assert not self.mystrax.is_stored('0', 'even_recs')
assert not self.mystrax.is_stored('0', 'even_recs_classified')
assert not self.mystrax.is_stored('0', 'peaks')
assert not self.mystrax.is_stored('0', 'rec_count')
self.mystrax.make('0', 'peaks')
assert not self.mystrax.is_stored('0', 'even_recs')
assert not self.mystrax.is_stored('0', 'even_recs_classified')
assert self.mystrax.is_stored('0', 'peaks')
assert self.mystrax.is_stored('0', 'rec_count')

# Test if saving EXPLICIT works:
self.mystrax.make('0', 'even_recs_classified', save=('even_recs_classified', ))
Expand Down

0 comments on commit 26791f0

Please sign in to comment.