reboost 0.5.4__py3-none-any.whl → 0.5.5__py3-none-any.whl

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/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.5.4'
21
- __version_tuple__ = version_tuple = (0, 5, 4)
20
+ __version__ = version = '0.5.5'
21
+ __version_tuple__ = version_tuple = (0, 5, 5)
reboost/utils.py CHANGED
@@ -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
- is_append = ((in_det > 0) or (out_det > 0)) & (chunk == 0)
34
- is_append = is_append or (in_det == 0 and out_det == 0 and chunk == 0 and group > 0)
35
- if is_append:
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.4
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
@@ -1,5 +1,5 @@
1
1
  reboost/__init__.py,sha256=3cYLf7XEyFRX5GK8f50gY4ecGR5O5HORITpDthOFpOg,265
2
- reboost/_version.py,sha256=dcAaO0Qe1IlOwiMsqG0TVZdK_BIVQUv1DNRmnBueT2I,511
2
+ reboost/_version.py,sha256=tKngLgUb_iFMdwvy40ZSx3eTf2ZsHvVnKan3fsexL-g,511
3
3
  reboost/build_evt.py,sha256=yH0bf4bwbp4feWV3JgvSAD5RcvhOX6c9PhH8FAe3Xv4,4710
4
4
  reboost/build_glm.py,sha256=IerSLQfe51ZO7CQP2kmfPnOIVaDtcfw3byOM02Vaz6o,9472
5
5
  reboost/build_hit.py,sha256=23JL5B7qThdHZqAK_HWoytqcEOWDhGsk4n5UMtojJ1c,15513
@@ -9,7 +9,7 @@ reboost/iterator.py,sha256=fATFDxu2PUc0e48OdJJujZo2kwykfRLH1oBtcB-s5pM,6905
9
9
  reboost/log_utils.py,sha256=VqS_9OC5NeNU3jcowVOBB0NJ6ssYvNWnirEY-JVduEA,766
10
10
  reboost/profile.py,sha256=EOTmjmS8Rm_nYgBWNh6Rntl2XDsxdyed7yEdWtsZEeg,2598
11
11
  reboost/units.py,sha256=3EH8XlpbsObdu5vLgxhm1600L6UNYD5jng4SjJT_1QE,2202
12
- reboost/utils.py,sha256=0xU68p0YSnDKTyLdso8zX4JYrGTVCjIiTBx7cuSCz98,9820
12
+ reboost/utils.py,sha256=FXHX7n4YnaYK-MSUDfe9ssEewHjcajkjDb9zeqCzopU,10560
13
13
  reboost/hpge/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  reboost/hpge/psd.py,sha256=jAUAoQ_PMz76wyA1NXYHNKtOwoCnRT3My8_LCFrKi-U,13860
15
15
  reboost/hpge/surface.py,sha256=lbWcFnFFWKxtFKs755GyM9US_IfyxaoM6MpOIZgIMM0,7478
@@ -29,9 +29,9 @@ reboost/shape/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  reboost/shape/cluster.py,sha256=RIvBlhHzp88aaUZGofp5SD9bimnoiqIOddhQ84jiwoM,8135
30
30
  reboost/shape/group.py,sha256=_z2qCOret3E-kj-nrp1-J5j2lEwQpgfYdQp2pgpDHR8,4449
31
31
  reboost/shape/reduction.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
- reboost-0.5.4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
33
- reboost-0.5.4.dist-info/METADATA,sha256=mFAy4qMlKnuWJB8V8FwF4Y5fdu-pw5ThJP3WYZGS9Ws,44248
34
- reboost-0.5.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
- reboost-0.5.4.dist-info/entry_points.txt,sha256=DxhD6BidSWNot9BrejHJjQ7RRLmrMaBIl52T75oWTwM,93
36
- reboost-0.5.4.dist-info/top_level.txt,sha256=q-IBsDepaY_AbzbRmQoW8EZrITXRVawVnNrB-_zyXZs,8
37
- reboost-0.5.4.dist-info/RECORD,,
32
+ reboost-0.5.5.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
33
+ reboost-0.5.5.dist-info/METADATA,sha256=BgZAUrcCJTX0ZHssvfS3w-uFe7Zg9Gt5vJUdMNOp8pE,44248
34
+ reboost-0.5.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
+ reboost-0.5.5.dist-info/entry_points.txt,sha256=DxhD6BidSWNot9BrejHJjQ7RRLmrMaBIl52T75oWTwM,93
36
+ reboost-0.5.5.dist-info/top_level.txt,sha256=q-IBsDepaY_AbzbRmQoW8EZrITXRVawVnNrB-_zyXZs,8
37
+ reboost-0.5.5.dist-info/RECORD,,