Skip to content

Commit

Permalink
Revert "Give RunDB an option to find files in storage but not in data…
Browse files Browse the repository at this point in the history
…base in find_several function (#1244)"

This reverts commit 185dad3.
  • Loading branch information
dachengx committed Aug 30, 2023
1 parent a4b2294 commit 6e3e2b3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
2 changes: 0 additions & 2 deletions straxen/contexts.py
Expand Up @@ -158,7 +158,6 @@ def xenonnt_online(output_folder: str = './strax_data',
_auto_append_rucio_local: bool = True,
_rucio_path: str = '/dali/lgrandi/rucio/',
_rucio_local_path: ty.Optional[str] = None,
_find_in_storage: bool = False,
_raw_paths: ty.Optional[str] = ['/dali/lgrandi/xenonnt/raw'],
_processed_paths: ty.Optional[ty.List[str]] = ['/dali/lgrandi/xenonnt/processed',
'/project2/lgrandi/xenonnt/processed',
Expand Down Expand Up @@ -225,7 +224,6 @@ def xenonnt_online(output_folder: str = './strax_data',
runid_field='number',
new_data_path=output_folder,
rucio_path=_rucio_path,
find_in_storage=_find_in_storage,
)] if _database_init else []
if not we_are_the_daq:
for _raw_path in _raw_paths:
Expand Down
9 changes: 0 additions & 9 deletions straxen/storage/rundb.py
Expand Up @@ -42,7 +42,6 @@ def __init__(self,
new_data_path=None,
reader_ini_name_is_mode=False,
rucio_path=None,
find_in_storage=False,
mongo_url=None,
mongo_user=None,
mongo_password=None,
Expand Down Expand Up @@ -82,7 +81,6 @@ def __init__(self,
if self.new_data_path is None:
self.readonly = True
self.runid_field = runid_field
self.find_in_storage = find_in_storage

if self.runid_field not in ['name', 'number']:
raise ValueError("Unrecognized runid_field option %s" % self.runid_field)
Expand Down Expand Up @@ -232,13 +230,6 @@ def _find(self, key: strax.DataKey,
return datum['protocol'], datum['location']

def find_several(self, keys: typing.List[strax.DataKey], **kwargs):
"""Find several keys at once.
If find_in_storage is True, will only check the storage backend,
because sometimes the RunDB docs indicate more docs than the available servers.
"""
if self.find_in_storage:
return super().find_several(keys, **kwargs)

if kwargs.get('fuzzy_for', False) or kwargs.get('fuzzy_for_options', False):
warnings.warn("Can't do fuzzy with RunDB yet. Only returning exact matches")
if not keys:
Expand Down

0 comments on commit 6e3e2b3

Please sign in to comment.