Skip to content

Commit

Permalink
Import MongoDownloader from utilix (#271)
Browse files Browse the repository at this point in the history
* import mongodownloader from utilix

* add utilix dependency

* Upgrade utilix

---------

Co-authored-by: dachengx <[email protected]>
  • Loading branch information
yuema137 and dachengx authored Oct 14, 2024
1 parent b0114e2 commit 733ec56
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ awkward = ">=2.5.1"
uproot = ">=5.2.1"
strax = ">=1.6.0"
straxen = ">=2.2.3"
utilix = ">=0.11.0"

[build-system]
requires = ["poetry-core>=1.0.8", "setuptools"]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_FullChain.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import tempfile
import timeout_decorator
import fuse
import straxen
import utilix
from _utils import test_root_file_name

TIMEOUT = 240
Expand Down Expand Up @@ -36,7 +36,7 @@ def tearDownClass(cls):
cls.temp_dir.cleanup()

def setUp(self):
downloader = straxen.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader = utilix.mongo_storage.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader.download_single(test_root_file_name, human_readable_file_name=True)

assert os.path.exists(os.path.join(self.temp_dir.name, test_root_file_name))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_FullChain_w_DelayedElectrons.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import tempfile
import timeout_decorator
import fuse
import straxen
import utilix
from _utils import test_root_file_name

TIMEOUT = 240
Expand Down Expand Up @@ -39,7 +39,7 @@ def tearDownClass(cls):
cls.temp_dir.cleanup()

def setUp(self):
downloader = straxen.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader = utilix.mongo_storage.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader.download_single(test_root_file_name, human_readable_file_name=True)

assert os.path.exists(os.path.join(self.temp_dir.name, test_root_file_name))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_MicroPhysics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import tempfile
import timeout_decorator
import fuse
import straxen
import utilix
from _utils import test_root_file_name

TIMEOUT = 60
Expand Down Expand Up @@ -32,7 +32,7 @@ def tearDownClass(cls):
cls.temp_dir.cleanup()

def setUp(self):
downloader = straxen.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader = utilix.mongo_storage.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader.download_single(test_root_file_name, human_readable_file_name=True)

assert os.path.exists(os.path.join(self.temp_dir.name, test_root_file_name))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_MicroPhysics_with_lineage_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import tempfile
import timeout_decorator
import fuse
import straxen
import utilix
from _utils import test_root_file_name

TIMEOUT = 240
Expand Down Expand Up @@ -36,7 +36,7 @@ def tearDownClass(cls):
cls.temp_dir.cleanup()

def setUp(self):
downloader = straxen.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader = utilix.mongo_storage.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader.download_single(test_root_file_name, human_readable_file_name=True)

assert os.path.exists(os.path.join(self.temp_dir.name, test_root_file_name))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_deterministic_seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import tempfile
import timeout_decorator
import fuse
import straxen
import utilix
from numpy.testing import assert_array_equal, assert_raises
from _utils import test_root_file_name

Expand All @@ -16,7 +16,7 @@ def setUp(self):
self.temp_dir_1 = tempfile.TemporaryDirectory()

for temp_dir in [self.temp_dir_0, self.temp_dir_1]:
downloader = straxen.MongoDownloader(store_files_at=(temp_dir.name,))
downloader = utilix.mongo_storage.MongoDownloader(store_files_at=(temp_dir.name,))
downloader.download_single(test_root_file_name, human_readable_file_name=True)
assert os.path.exists(os.path.join(temp_dir.name, test_root_file_name))

Expand Down
4 changes: 2 additions & 2 deletions tests/test_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import tempfile
import timeout_decorator
import fuse
import straxen
import utilix
import numpy as np
from _utils import test_root_file_name

Expand All @@ -22,7 +22,7 @@ def tearDownClass(cls):
cls.temp_dir.cleanup()

def setUp(self):
downloader = straxen.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader = utilix.mongo_storage.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader.download_single(test_root_file_name, human_readable_file_name=True)

assert os.path.exists(os.path.join(self.temp_dir.name, test_root_file_name))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_plugin_random_seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import tempfile
import timeout_decorator
import fuse
import straxen
import utilix
from _utils import test_root_file_name

TIMEOUT = 60
Expand Down Expand Up @@ -39,7 +39,7 @@ def tearDownClass(cls):
cls.temp_dir.cleanup()

def setUp(self):
downloader = straxen.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader = utilix.mongo_storage.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader.download_single(test_root_file_name, human_readable_file_name=True)

assert os.path.exists(os.path.join(self.temp_dir.name, test_root_file_name))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_truth_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import tempfile
import timeout_decorator
import fuse
import straxen
import utilix
from _utils import test_root_file_name

TIMEOUT = 240
Expand Down Expand Up @@ -36,7 +36,7 @@ def tearDownClass(cls):
cls.temp_dir.cleanup()

def setUp(self):
downloader = straxen.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader = utilix.mongo_storage.MongoDownloader(store_files_at=(self.temp_dir.name,))
downloader.download_single(test_root_file_name, human_readable_file_name=True)

assert os.path.exists(os.path.join(self.temp_dir.name, test_root_file_name))
Expand Down

0 comments on commit 733ec56

Please sign in to comment.