reboost 0.9.0__tar.gz → 0.9.1__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.9.0/src/reboost.egg-info → reboost-0.9.1}/PKG-INFO +1 -1
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/_version.py +3 -3
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/core.py +19 -4
- {reboost-0.9.0 → reboost-0.9.1/src/reboost.egg-info}/PKG-INFO +1 -1
- {reboost-0.9.0 → reboost-0.9.1}/tests/test_core.py +17 -4
- {reboost-0.9.0 → reboost-0.9.1}/LICENSE +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/README.md +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/pyproject.toml +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/setup.cfg +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/__init__.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/__main__.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/build_evt.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/build_glm.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/build_hit.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/cli.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/daq/__init__.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/daq/core.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/daq/utils.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/hpge/__init__.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/hpge/psd.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/hpge/surface.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/hpge/utils.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/iterator.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/log_utils.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/math/__init__.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/math/functions.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/math/stats.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/optmap/__init__.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/optmap/__main__.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/optmap/cli.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/optmap/convolve.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/optmap/create.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/optmap/evt.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/optmap/mapview.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/optmap/numba_pdg.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/optmap/optmap.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/profile.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/shape/__init__.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/shape/cluster.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/shape/group.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/shape/reduction.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/spms/__init__.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/spms/pe.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/units.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost/utils.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost.egg-info/SOURCES.txt +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost.egg-info/dependency_links.txt +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost.egg-info/entry_points.txt +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost.egg-info/not-zip-safe +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost.egg-info/requires.txt +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/src/reboost.egg-info/top_level.txt +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/conftest.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/evt/test_evt.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/glm/test_build_glm.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hit/configs/args.yaml +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hit/configs/basic.yaml +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hit/configs/foward_only.yaml +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hit/configs/geom.gdml +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hit/configs/hit_config.yaml +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hit/configs/pars.yaml +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hit/configs/reshape.yaml +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hit/configs/spms.yaml +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hit/test_build_hit.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hpge/simulation/gammas.mac +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hpge/simulation/geometry.gdml +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hpge/simulation/make_dt_map.jl +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hpge/simulation/make_geom.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hpge/test_current.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hpge/test_dt_heuristic.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hpge/test_files/drift_time_maps.lh5 +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hpge/test_files/internal_electron.lh5 +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hpge/test_hpge_map.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hpge/test_r90.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/hpge/test_surface.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/spms/test_pe.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/test_cli.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/test_math.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/test_optmap.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/test_optmap_dets.gdml +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/test_profile.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/test_shape.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/test_units.py +0 -0
- {reboost-0.9.0 → reboost-0.9.1}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reboost
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.1
|
|
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
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.9.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 9,
|
|
31
|
+
__version__ = version = '0.9.1'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 9, 1)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g366fa2abd'
|
|
@@ -18,9 +18,18 @@ log = logging.getLogger(__name__)
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
def read_data_at_channel_as_ak(
|
|
21
|
-
channels: ak.Array,
|
|
21
|
+
channels: ak.Array,
|
|
22
|
+
rows: ak.Array,
|
|
23
|
+
file: str,
|
|
24
|
+
field: str,
|
|
25
|
+
group: str,
|
|
26
|
+
tab_map: dict[int, str],
|
|
27
|
+
with_units: bool = False,
|
|
22
28
|
) -> ak.Array:
|
|
23
|
-
r"""Read the data from a particular field to an
|
|
29
|
+
r"""Read the data from a particular field to an Awkward array.
|
|
30
|
+
|
|
31
|
+
This replaces the TCM like object defined by the channels and rows with the
|
|
32
|
+
corresponding data field.
|
|
24
33
|
|
|
25
34
|
Parameters
|
|
26
35
|
----------
|
|
@@ -68,7 +77,9 @@ def read_data_at_channel_as_ak(
|
|
|
68
77
|
tcm_rows = np.where(ak.flatten(channels == key))[0]
|
|
69
78
|
|
|
70
79
|
# read the data with sorted idx
|
|
71
|
-
data_ch = lh5.read(f"{group}/{tab_name}/{field}", file, idx=idx[arg_idx])
|
|
80
|
+
data_ch = lh5.read(f"{group}/{tab_name}/{field}", file, idx=idx[arg_idx])
|
|
81
|
+
units = data_ch.attrs.get("units", None)
|
|
82
|
+
data_ch = data_ch.view_as("ak")
|
|
72
83
|
|
|
73
84
|
# sort back to order for tcm
|
|
74
85
|
data_ch = data_ch[np.argsort(arg_idx)]
|
|
@@ -85,8 +96,12 @@ def read_data_at_channel_as_ak(
|
|
|
85
96
|
|
|
86
97
|
# sort the final data
|
|
87
98
|
data_flat = data_flat[np.argsort(tcm_rows_full)]
|
|
99
|
+
data_unflat = ak.unflatten(data_flat, reorder)
|
|
100
|
+
|
|
101
|
+
if with_units and units is not None:
|
|
102
|
+
return ak.with_parameter(data_unflat, "units", units)
|
|
88
103
|
|
|
89
|
-
return
|
|
104
|
+
return data_unflat
|
|
90
105
|
|
|
91
106
|
|
|
92
107
|
def evaluate_output_column(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reboost
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.1
|
|
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
|
|
@@ -59,13 +59,13 @@ def hitfiles(tmptestdir):
|
|
|
59
59
|
# make some hit tier files
|
|
60
60
|
channel1 = Table(
|
|
61
61
|
{
|
|
62
|
-
"energy": Array([100, 200, 400, 300]),
|
|
62
|
+
"energy": Array([100, 200, 400, 300], attrs={"units": "keV"}),
|
|
63
63
|
"times": VectorOfVectors([[0.1], [0.2, 0.3], [0.4, 98], [2]]),
|
|
64
64
|
}
|
|
65
65
|
)
|
|
66
66
|
channel2 = Table(
|
|
67
67
|
{
|
|
68
|
-
"energy": Array([10, 70, 0, 56, 400, 400]),
|
|
68
|
+
"energy": Array([10, 70, 0, 56, 400, 400], attrs={"units": "keV"}),
|
|
69
69
|
"times": VectorOfVectors([[12], [], [-0.4, 0.4], [89], [1], [2]]),
|
|
70
70
|
}
|
|
71
71
|
)
|
|
@@ -83,12 +83,13 @@ def hitfiles(tmptestdir):
|
|
|
83
83
|
|
|
84
84
|
def test_read_data_at_channel(hitfiles):
|
|
85
85
|
# make a TCM
|
|
86
|
-
tcm_channels = ak.Array([[0], [0], [0, 1], [1], [1], [0, 1], [1], [1]])
|
|
87
|
-
tcm_rows = ak.Array([[0], [1], [2, 0], [1], [2], [3, 3], [4], [5]])
|
|
86
|
+
tcm_channels = ak.Array([[0], [0], [0, 1], [1], [1], [0, 1], [1], [], [1]])
|
|
87
|
+
tcm_rows = ak.Array([[0], [1], [2, 0], [1], [2], [3, 3], [4], [], [5]])
|
|
88
88
|
|
|
89
89
|
energy = reboost.core.read_data_at_channel_as_ak(
|
|
90
90
|
tcm_channels, tcm_rows, hitfiles[2], "energy", "hit", {"det001": 0, "det002": 1}
|
|
91
91
|
)
|
|
92
|
+
assert "units" not in ak.parameters(energy)
|
|
92
93
|
|
|
93
94
|
# check the same
|
|
94
95
|
assert len(energy) == len(tcm_channels)
|
|
@@ -105,6 +106,18 @@ def test_read_data_at_channel(hitfiles):
|
|
|
105
106
|
)
|
|
106
107
|
assert len(times) == len(tcm_channels)
|
|
107
108
|
|
|
109
|
+
energy = reboost.core.read_data_at_channel_as_ak(
|
|
110
|
+
tcm_channels,
|
|
111
|
+
tcm_rows,
|
|
112
|
+
hitfiles[2],
|
|
113
|
+
"energy",
|
|
114
|
+
"hit",
|
|
115
|
+
{"det001": 0, "det002": 1},
|
|
116
|
+
with_units=True,
|
|
117
|
+
)
|
|
118
|
+
assert "units" in ak.parameters(energy)
|
|
119
|
+
assert ak.parameters(energy)["units"] == "keV"
|
|
120
|
+
|
|
108
121
|
|
|
109
122
|
def test_get_objects(test_data_configs, make_gdml):
|
|
110
123
|
# check basic eval
|
|
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
|
|
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
|