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

Workaround for fuzzy_for issue. #306

Merged
merged 2 commits into from
Aug 17, 2020
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
16 changes: 14 additions & 2 deletions strax/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
help='If True, save data that is loaded from one frontend '
'through all willing other storage frontends.'),
strax.Option(name='fuzzy_for', default=tuple(),
help='Tuple of plugin names for which no checks for version, '
help='Tuple or string of plugin names for which no checks for version, '
'providing plugin, and config will be performed when '
'looking for data.'),
strax.Option(name='fuzzy_for_options', default=tuple(),
Expand Down Expand Up @@ -516,7 +516,19 @@ def get_plugin(data_kind):

@property
def _find_options(self):
return dict(fuzzy_for=self.context_config['fuzzy_for'],

# The plugin settings in the lineage are stored with the last
# plugin provides name as a key. This can be quite confusing
# since e.g. to be fuzzy for the peaklets settings the user has
# to specify fuzzy_for=('lone_hits'). Here a small work around
# to change this and not to reprocess the entire data set.
fuzzy_for_keys = strax.to_str_tuple(self.context_config['fuzzy_for'])
last_provides = []
for key in fuzzy_for_keys:
last_provides.append(self._plugin_class_registry[key].provides[-1])
last_provides = tuple(last_provides)

return dict(fuzzy_for=last_provides,
fuzzy_for_options=self.context_config['fuzzy_for_options'],
allow_incomplete=self.context_config['allow_incomplete'])

Expand Down