pygama 2.3.8a1__tar.gz → 2.3.8.dev2__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.
Files changed (144) hide show
  1. {pygama-2.3.8a1/src/pygama.egg-info → pygama-2.3.8.dev2}/PKG-INFO +2 -1
  2. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/pyproject.toml +2 -4
  3. pygama-2.3.8.dev2/src/pygama/_version.py +24 -0
  4. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/evt/modules/spms.py +4 -0
  5. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/binned_fitting.py +14 -7
  6. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/pargen/AoE_cal.py +220 -126
  7. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/pargen/data_cleaning.py +45 -48
  8. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/pargen/dplms_ge_dict.py +51 -52
  9. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/pargen/dsp_optimize.py +27 -28
  10. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/pargen/energy_cal.py +218 -126
  11. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/pargen/energy_optimisation.py +36 -34
  12. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/pargen/lq_cal.py +42 -36
  13. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/pargen/noise_optimization.py +46 -46
  14. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/pargen/pz_correct.py +8 -15
  15. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/pargen/survival_fractions.py +57 -34
  16. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/pargen/utils.py +18 -21
  17. {pygama-2.3.8a1 → pygama-2.3.8.dev2/src/pygama.egg-info}/PKG-INFO +2 -1
  18. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama.egg-info/requires.txt +1 -0
  19. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/conftest.py +7 -7
  20. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/evt/modules/larveto.py +2 -0
  21. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/evt/test_build_evt.py +3 -1
  22. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/evt/test_build_tcm.py +9 -7
  23. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/evt/test_evt_utils.py +2 -0
  24. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/evt/test_xtalk.py +5 -4
  25. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/flow/conftest.py +4 -2
  26. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/flow/test_data_loader.py +3 -1
  27. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/flow/test_filedb.py +5 -3
  28. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/flow/test_flow_utils.py +2 -0
  29. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/hit/test_build_hit.py +17 -16
  30. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_crystal_ball.py +2 -0
  31. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_error_function.py +2 -0
  32. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_exgauss.py +2 -0
  33. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_exponential.py +2 -0
  34. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_gauss.py +2 -0
  35. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_gauss_on_exgauss.py +2 -0
  36. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_gauss_on_exponential.py +2 -0
  37. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_gauss_on_linear.py +2 -0
  38. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_gauss_on_step.py +2 -0
  39. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_gauss_on_uniform.py +2 -0
  40. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_hpge_peak.py +5 -3
  41. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_linear.py +2 -0
  42. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_moyal.py +2 -0
  43. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_numba_frozen.py +2 -0
  44. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_poisson.py +2 -0
  45. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_polynomial.py +2 -0
  46. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_step.py +2 -0
  47. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_sum_dists.py +2 -0
  48. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_triple_gauss_on_double_step.py +3 -3
  49. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/functions/test_uniform.py +2 -0
  50. pygama-2.3.8.dev2/tests/math/test_binned_fitting.py +101 -0
  51. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/test_distribution_selector_in_sum_dists.py +6 -4
  52. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/test_hpge_peak_fitting.py +9 -7
  53. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/test_iminuit_integration.py +17 -15
  54. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/test_least_squares.py +2 -0
  55. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/test_math_histogram.py +29 -27
  56. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/test_math_utils.py +4 -2
  57. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/math/test_unbinned_fitting.py +7 -5
  58. pygama-2.3.8.dev2/tests/pargen/test_aoecal.py +145 -0
  59. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/pargen/test_datacleaning.py +13 -11
  60. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/pargen/test_dsp_optimize.py +3 -4
  61. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/pargen/test_ecal.py +25 -17
  62. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/pargen/test_energy_optimization.py +2 -0
  63. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/pargen/test_lqcal.py +7 -5
  64. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/pargen/test_pz_correct.py +51 -51
  65. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/test_utils.py +2 -0
  66. pygama-2.3.8a1/src/pygama/_version.py +0 -34
  67. pygama-2.3.8a1/tests/math/test_binned_fitting.py +0 -97
  68. pygama-2.3.8a1/tests/pargen/test_aoecal.py +0 -41
  69. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/LICENSE +0 -0
  70. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/README.md +0 -0
  71. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/setup.cfg +0 -0
  72. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/__init__.py +0 -0
  73. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/cli.py +0 -0
  74. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/evt/__init__.py +0 -0
  75. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/evt/aggregators.py +0 -0
  76. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/evt/build_evt.py +0 -0
  77. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/evt/build_tcm.py +0 -0
  78. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/evt/modules/__init__.py +0 -0
  79. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/evt/modules/geds.py +0 -0
  80. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/evt/modules/larveto.py +0 -0
  81. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/evt/modules/legend.py +0 -0
  82. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/evt/modules/xtalk.py +0 -0
  83. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/evt/tcm.py +0 -0
  84. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/evt/utils.py +0 -0
  85. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/flow/__init__.py +0 -0
  86. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/flow/data_loader.py +0 -0
  87. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/flow/file_db.py +0 -0
  88. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/flow/utils.py +0 -0
  89. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/hit/__init__.py +0 -0
  90. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/hit/build_hit.py +0 -0
  91. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/logging.py +0 -0
  92. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/__init__.py +0 -0
  93. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/distributions.py +0 -0
  94. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/__init__.py +0 -0
  95. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/crystal_ball.py +0 -0
  96. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/error_function.py +0 -0
  97. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/exgauss.py +0 -0
  98. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/exponential.py +0 -0
  99. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/gauss.py +0 -0
  100. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/gauss_on_exgauss.py +0 -0
  101. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/gauss_on_exponential.py +0 -0
  102. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/gauss_on_linear.py +0 -0
  103. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/gauss_on_step.py +0 -0
  104. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/gauss_on_uniform.py +0 -0
  105. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/hpge_peak.py +0 -0
  106. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/linear.py +0 -0
  107. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/moyal.py +0 -0
  108. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/poisson.py +0 -0
  109. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/polynomial.py +0 -0
  110. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/pygama_continuous.py +0 -0
  111. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/step.py +0 -0
  112. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/sum_dists.py +0 -0
  113. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/triple_gauss_on_double_step.py +0 -0
  114. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/functions/uniform.py +0 -0
  115. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/histogram.py +0 -0
  116. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/hpge_peak_fitting.py +0 -0
  117. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/least_squares.py +0 -0
  118. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/unbinned_fitting.py +0 -0
  119. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/units.py +0 -0
  120. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/math/utils.py +0 -0
  121. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/pargen/__init__.py +0 -0
  122. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama/utils.py +0 -0
  123. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama.egg-info/SOURCES.txt +0 -0
  124. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama.egg-info/dependency_links.txt +0 -0
  125. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama.egg-info/entry_points.txt +0 -0
  126. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama.egg-info/not-zip-safe +0 -0
  127. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/src/pygama.egg-info/top_level.txt +0 -0
  128. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/configs/icpc-dsp-config.json +0 -0
  129. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/configs/sipm-dplms-config.json +0 -0
  130. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/configs/sipm-dsp-config.json +0 -0
  131. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/evt/configs/basic-evt-config.yaml +0 -0
  132. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/evt/configs/query-test-evt-config.json +0 -0
  133. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/evt/configs/spms-module-config.yaml +0 -0
  134. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/evt/configs/spms-p13-config.yaml +0 -0
  135. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/evt/configs/vov-test-evt-config.json +0 -0
  136. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/evt/test_geds.py +0 -0
  137. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/flow/configs/config.json +0 -0
  138. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/flow/configs/data-loader-config.json +0 -0
  139. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/flow/configs/filedb-config.json +0 -0
  140. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/flow/configs/nested/config.json +0 -0
  141. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/flow/configs/nested/data-loader-config-nested.json +0 -0
  142. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/hit/configs/aggregations-hit-config.json +0 -0
  143. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/hit/configs/basic-hit-config.json +0 -0
  144. {pygama-2.3.8a1 → pygama-2.3.8.dev2}/tests/hit/configs/hit-multi-config.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygama
3
- Version: 2.3.8a1
3
+ Version: 2.3.8.dev2
4
4
  Summary: Python package for data processing and analysis
5
5
  Author: The LEGEND collaboration
6
6
  Maintainer: The LEGEND collaboration
@@ -33,6 +33,7 @@ Requires-Dist: pylegendmeta>=0.9
33
33
  Requires-Dist: matplotlib
34
34
  Requires-Dist: numba!=0.53.*,!=0.54.*,!=0.57
35
35
  Requires-Dist: numpy>=1.21
36
+ Requires-Dist: numexpr
36
37
  Requires-Dist: pandas>=1.4.4
37
38
  Requires-Dist: tables
38
39
  Requires-Dist: pint
@@ -41,6 +41,7 @@ dependencies = [
41
41
  "matplotlib",
42
42
  "numba !=0.53.*,!=0.54.*,!=0.57",
43
43
  "numpy >=1.21",
44
+ "numexpr",
44
45
  "pandas >=1.4.4",
45
46
  "tables",
46
47
  "pint",
@@ -128,9 +129,6 @@ src = ["src"]
128
129
  force-exclude = true
129
130
  exclude = [
130
131
  "src/pygama/flow",
131
- "src/pygama/pargen",
132
- "docs",
133
- "tests",
134
132
  "attic",
135
133
  ]
136
134
 
@@ -167,6 +165,6 @@ ignore = [
167
165
  isort.required-imports = ["from __future__ import annotations"]
168
166
 
169
167
  [tool.ruff.lint.per-file-ignores]
170
- "tests/**" = ["T20"]
168
+ "tests/**" = ["T20", "PLC0415"]
171
169
  "noxfile.py" = ["T20"]
172
170
  "docs/source/notebooks/*" = ["T201", "E402"]
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '2.3.8.dev2'
22
+ __version_tuple__ = version_tuple = (2, 3, 8, 'dev2')
23
+
24
+ __commit_id__ = commit_id = 'g13d41716a'
@@ -111,6 +111,10 @@ def gather_pulse_data(
111
111
  chan_tcm_indexs = np.where(ak.flatten(tcm.table_key) == table_id)[0].to_numpy()
112
112
  tbl_idxs_ch = ak.flatten(tcm.row_in_table)[chan_tcm_indexs].to_numpy()
113
113
 
114
+ if len(tbl_idxs_ch) == 0:
115
+ msg = f"No entries for channel {channel}"
116
+ log.warning(msg)
117
+ continue # would break lgdo_obj.view_as("np") otherwise
114
118
  # read the data in
115
119
  lgdo_obj = lh5.read(
116
120
  f"/{channel}/{tierinfo.group}/{column}", tierinfo.file, idx=tbl_idxs_ch
@@ -311,16 +311,23 @@ def gauss_mode_width_max(
311
311
  f"[0, {len(hist) - 1}] for mode_guess={mode_guess}"
312
312
  )
313
313
  raise ValueError(msg)
314
- if i_0 < int(np.floor(n_bins / 2)):
315
- msg = f"Fit range exceeds histogram bounds: i_0={i_0}"
316
- raise ValueError(msg)
314
+
317
315
  amp_guess = hist[i_0]
318
- i_0 -= int(np.floor(n_bins / 2))
316
+ center_i = i_0
317
+ i_0 = center_i - int(np.floor(n_bins / 2))
319
318
  i_n = i_0 + n_bins
320
- if i_n >= len(hist):
321
- msg = f"Fit range exceeds histogram bounds: i_n={i_n}, hist length: {len(hist)}"
319
+ # Recompute (i_0, i_n) together to keep the window size consistent
320
+ if i_0 < 0:
321
+ i_0 = 0
322
+ i_n = n_bins
323
+ if i_n > len(hist):
324
+ i_n = len(hist)
325
+ i_0 = len(hist) - n_bins
326
+ if i_0 < 0:
327
+ msg = f"n_bins={n_bins} exceeds histogram size {len(hist)}"
322
328
  raise ValueError(msg)
323
- width_guess = bin_centers[i_n] - bin_centers[i_0]
329
+ # Use bins (not bin_centers) so that i_n == len(hist) is a valid index
330
+ width_guess = bins[i_n] - bins[i_0]
324
331
  vv = None if var is None else var[i_0:i_n]
325
332
  guess = (mode_guess, width_guess, amp_guess)
326
333
  pars, _errors, cov = fit_binned(