Skip to content

Commit 97f8bcd

Browse files
committed
Fix bug that prevented using invalid comb names to mark disconnected setups
1 parent 8f7f1bc commit 97f8bcd

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

src/super_auto_comb/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def main(args):
199199
# for x in loyb[loyb['datetime']>59900].iloc:
200200
# ...: print(x['cirt'])
201201
for s in do_setup.iloc:
202-
if s["valid"] is False:
202+
if s["valid"] == False: # noqa: E712 # the valid column store np.bool_ for whatever reason
203203
continue
204204

205205
this_start = max(start, s["datetime"])
@@ -346,7 +346,7 @@ def main(args):
346346

347347
# LOOP 4b: tracked changes
348348
for s in do_out_setup.iloc:
349-
if s["valid"] is False:
349+
if s["valid"] == False: # noqa: E712 # the valid column store np.bool_ for whatever reason
350350
continue
351351

352352
this_start = max(start, s["datetime"])
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#datetime comb physical nominal kscale foffset N fbeat_sign f0_scale counter1 flo1 min1 max1 counter2 flo2 min2 max2 threshold
2+
2022-03-21T00:00:00 disconnected
3+
2022-03-21T00:30:00 comb2 cavity4 '518_295_836_590_863.63' 2 67_059_566. 1_036_592 -1 1 11 -154.3e6 58.5e6 59.5e6 12 35.7e6 58.7e6 59.7e6 0.2

tests/test_cli.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,20 @@ def test_main_auto():
8181
rocit_data = rl.load_link_from_dir("./tests/Outputs/2022-03/INRIM_HM-INRIM_LoYb")
8282
assert len(rocit_data.t) == 3600
8383
assert rocit_data.oscA.name == "INRIM_LoYb"
84+
85+
86+
def test_main_with_invalid():
87+
# delete previous results
88+
try:
89+
shutil.rmtree("./tests/Outputs/")
90+
except FileNotFoundError:
91+
pass
92+
args = parse_args(
93+
"--do LoYb_with_invalid --start 59658 --stop 59660 --dir ./tests/Outputs --fig-dir ./tests/Outputs/Figures --comb-dir ./tests/samples --setup-dir ./tests/samples --track-cirt".split(
94+
" "
95+
)
96+
)
97+
main(args)
98+
rocit_data = rl.load_link_from_dir("./tests/Outputs/INRIM_HM-INRIM_LoYb_with_invalid")
99+
assert len(rocit_data.t) == 1801
100+
assert rocit_data.oscA.name == "INRIM_LoYb_with_invalid"

0 commit comments

Comments
 (0)