reboost 0.5.3__tar.gz → 0.5.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {reboost-0.5.3 → reboost-0.5.5}/PKG-INFO +1 -1
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/_version.py +2 -2
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/iterator.py +1 -1
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/utils.py +33 -5
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost.egg-info/PKG-INFO +1 -1
- {reboost-0.5.3 → reboost-0.5.5}/tests/hit/test_build_hit.py +54 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/test_utils.py +1 -0
- {reboost-0.5.3 → reboost-0.5.5}/LICENSE +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/README.md +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/pyproject.toml +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/setup.cfg +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/__init__.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/build_evt.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/build_glm.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/build_hit.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/cli.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/core.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/hpge/__init__.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/hpge/psd.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/hpge/surface.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/hpge/utils.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/log_utils.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/math/__init__.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/math/functions.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/math/stats.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/optmap/__init__.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/optmap/cli.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/optmap/convolve.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/optmap/create.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/optmap/evt.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/optmap/mapview.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/optmap/numba_pdg.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/optmap/optmap.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/profile.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/shape/__init__.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/shape/cluster.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/shape/group.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/shape/reduction.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost/units.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost.egg-info/SOURCES.txt +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost.egg-info/dependency_links.txt +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost.egg-info/entry_points.txt +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost.egg-info/not-zip-safe +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost.egg-info/requires.txt +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/src/reboost.egg-info/top_level.txt +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/conftest.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/glm/test_build_glm.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hit/configs/args.yaml +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hit/configs/basic.yaml +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hit/configs/geom.gdml +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hit/configs/hit_config.yaml +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hit/configs/pars.yaml +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hit/configs/reshape.yaml +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hpge/simulation/gammas.mac +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hpge/simulation/geometry.gdml +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hpge/simulation/make_dt_map.jl +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hpge/simulation/make_geom.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hpge/test_current.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hpge/test_dt_heuristic.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hpge/test_files/drift_time_maps.lh5 +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hpge/test_files/internal_electron.lh5 +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hpge/test_hpge_map.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hpge/test_r90.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/hpge/test_surface.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/test_cli.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/test_core.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/test_math.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/test_optmap.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/test_profile.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/test_shape.py +0 -0
- {reboost-0.5.3 → reboost-0.5.5}/tests/test_units.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reboost
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.5
|
|
4
4
|
Summary: New LEGEND Monte-Carlo simulation post-processing
|
|
5
5
|
Author-email: Manuel Huber <info@manuelhu.de>, Toby Dixon <toby.dixon.23@ucl.ac.uk>, Luigi Pertoldi <gipert@pm.me>
|
|
6
6
|
Maintainer: The LEGEND Collaboration
|
|
@@ -111,7 +111,7 @@ class GLMIterator:
|
|
|
111
111
|
|
|
112
112
|
# heuristics for a good buffer length
|
|
113
113
|
if self.use_glm:
|
|
114
|
-
self.buffer = int(buffer * glm_n_rows / stp_n_rows)
|
|
114
|
+
self.buffer = int(buffer * glm_n_rows / (1 + stp_n_rows))
|
|
115
115
|
msg = f"Number of stp rows {stp_n_rows}, number of glm rows {glm_n_rows} changing buffer from {buffer} to {self.buffer}"
|
|
116
116
|
log.debug(msg)
|
|
117
117
|
|
|
@@ -20,8 +20,35 @@ log = logging.getLogger(__name__)
|
|
|
20
20
|
|
|
21
21
|
def get_wo_mode(
|
|
22
22
|
group: int, out_det: int, in_det: int, chunk: int, new_hit_file: bool, overwrite: bool = False
|
|
23
|
-
):
|
|
24
|
-
"""Get the mode for lh5 file writing.
|
|
23
|
+
) -> str:
|
|
24
|
+
"""Get the mode for lh5 file writing.
|
|
25
|
+
|
|
26
|
+
If all indices are 0 and we are writing a new output file
|
|
27
|
+
then the mode "overwrite_file" is used (if the overwrite) flag
|
|
28
|
+
is set, otherwise the mode "write_safe" is used.
|
|
29
|
+
|
|
30
|
+
Otherwise the code choses between "append_column" if this is the
|
|
31
|
+
first time a group is being written to the file, or "append"
|
|
32
|
+
|
|
33
|
+
Parameters
|
|
34
|
+
----------
|
|
35
|
+
group
|
|
36
|
+
the index of the processing group
|
|
37
|
+
out_det
|
|
38
|
+
the index of the output detector
|
|
39
|
+
in_det
|
|
40
|
+
the index of the input detector
|
|
41
|
+
chunk
|
|
42
|
+
the chunk index
|
|
43
|
+
new_hit_file
|
|
44
|
+
a flag of whether we are writing a new hit file
|
|
45
|
+
overwrite
|
|
46
|
+
a flag of whether to overwrite the old file.
|
|
47
|
+
|
|
48
|
+
Returns
|
|
49
|
+
-------
|
|
50
|
+
the mode for IO
|
|
51
|
+
"""
|
|
25
52
|
indices = [group, out_det, in_det, chunk]
|
|
26
53
|
|
|
27
54
|
good_idx = all(i == 0 for i in indices)
|
|
@@ -30,9 +57,10 @@ def get_wo_mode(
|
|
|
30
57
|
return "overwrite_file" if overwrite else "write_safe"
|
|
31
58
|
|
|
32
59
|
# if we have a detector not the first and chunk 0 append column
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
60
|
+
is_ac = ((in_det > 0) or (out_det > 0)) & (chunk == 0)
|
|
61
|
+
is_ac = is_ac or (in_det == 0 and out_det == 0 and chunk == 0 and (group > 0))
|
|
62
|
+
|
|
63
|
+
if is_ac and new_hit_file:
|
|
36
64
|
return "append_column"
|
|
37
65
|
return "append"
|
|
38
66
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reboost
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.5
|
|
4
4
|
Summary: New LEGEND Monte-Carlo simulation post-processing
|
|
5
5
|
Author-email: Manuel Huber <info@manuelhu.de>, Toby Dixon <toby.dixon.23@ucl.ac.uk>, Luigi Pertoldi <gipert@pm.me>
|
|
6
6
|
Maintainer: The LEGEND Collaboration
|
|
@@ -179,6 +179,60 @@ def test_file_merging(test_gen_lh5, tmptestdir):
|
|
|
179
179
|
assert len(hits) == 4
|
|
180
180
|
|
|
181
181
|
|
|
182
|
+
def test_multi_file(test_gen_lh5, tmptestdir):
|
|
183
|
+
outfile = [f"{tmptestdir}/basic_hit_t0.lh5", f"{tmptestdir}/basic_hit_t1.lh5"]
|
|
184
|
+
|
|
185
|
+
reboost.build_hit(
|
|
186
|
+
f"{Path(__file__).parent}/configs/basic.yaml",
|
|
187
|
+
args={},
|
|
188
|
+
stp_files=[test_gen_lh5, test_gen_lh5],
|
|
189
|
+
glm_files=None,
|
|
190
|
+
hit_files=outfile,
|
|
191
|
+
overwrite=True,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
for file in outfile:
|
|
195
|
+
assert lh5.ls(file) == ["hit", "vtx"]
|
|
196
|
+
|
|
197
|
+
hits = lh5.read("hit/det1", file).view_as("ak")
|
|
198
|
+
|
|
199
|
+
assert len(hits) == 2
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def test_overwrite(test_gen_lh5, tmptestdir):
|
|
203
|
+
# test with two output files
|
|
204
|
+
outfile = [f"{tmptestdir}/basic_hit_t0.lh5", f"{tmptestdir}/basic_hit_t1.lh5"]
|
|
205
|
+
|
|
206
|
+
reboost.build_hit(
|
|
207
|
+
f"{Path(__file__).parent}/configs/basic.yaml",
|
|
208
|
+
args={},
|
|
209
|
+
stp_files=[test_gen_lh5, test_gen_lh5],
|
|
210
|
+
glm_files=None,
|
|
211
|
+
hit_files=outfile,
|
|
212
|
+
overwrite=True,
|
|
213
|
+
)
|
|
214
|
+
for file in outfile:
|
|
215
|
+
assert lh5.ls(file) == ["hit", "vtx"]
|
|
216
|
+
|
|
217
|
+
hits = lh5.read("hit/det1", file).view_as("ak")
|
|
218
|
+
|
|
219
|
+
assert len(hits) == 2
|
|
220
|
+
|
|
221
|
+
outfile = f"{tmptestdir}/basic_hit_merged.lh5"
|
|
222
|
+
|
|
223
|
+
reboost.build_hit(
|
|
224
|
+
f"{Path(__file__).parent}/configs/basic.yaml",
|
|
225
|
+
args={},
|
|
226
|
+
stp_files=[test_gen_lh5, test_gen_lh5],
|
|
227
|
+
glm_files=None,
|
|
228
|
+
hit_files=outfile,
|
|
229
|
+
overwrite=True,
|
|
230
|
+
)
|
|
231
|
+
assert lh5.ls(outfile) == ["hit", "vtx"]
|
|
232
|
+
hits = lh5.read("hit/det1", outfile).view_as("ak")
|
|
233
|
+
assert len(hits) == 4
|
|
234
|
+
|
|
235
|
+
|
|
182
236
|
def test_full_chain(test_gen_lh5, tmptestdir):
|
|
183
237
|
args = dbetto.AttrsDict(
|
|
184
238
|
{
|
|
@@ -122,6 +122,7 @@ def test_wo_mode():
|
|
|
122
122
|
assert get_wo_mode(0, 0, 0, 0, True, overwrite=False) == "write_safe"
|
|
123
123
|
assert get_wo_mode(0, 0, 1, 0, True, overwrite=False) == "append_column"
|
|
124
124
|
assert get_wo_mode(0, 0, 1, 1, True, overwrite=False) == "append"
|
|
125
|
+
assert get_wo_mode(0, 0, 1, 0, False, overwrite=False) == "append"
|
|
125
126
|
|
|
126
127
|
|
|
127
128
|
def test_get_files_dict():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|