Skip to content

Commit

Permalink
Bug fix: cast range to when returning the key list in the FlashCam ev…
Browse files Browse the repository at this point in the history
…ent decoder (#13)

Cast range to list. Fixes error reported by Carmen
  • Loading branch information
jasondet authored Sep 22, 2023
1 parent a7becb6 commit f06111d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/daq2lh5/fc/fc_event_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def set_file_config(self, fc_config: lgdo.Struct) -> None:
self.decoded_values["tracelist"]["length_guess"] = self.fc_config["nadcs"].value

def get_key_lists(self) -> range:
return [range(self.fc_config["nadcs"].value)]
return [list(range(self.fc_config["nadcs"].value))]

def get_decoded_values(self, channel: int = None) -> dict[str, dict[str, Any]]:
# FC uses the same values for all channels
Expand Down
2 changes: 1 addition & 1 deletion tests/fc/test_fc_streamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_default_rb_lib(lgnd_test_data):
assert rb_lib["FCConfigDecoder"][0].out_name == "FCConfig"
assert rb_lib["FCStatusDecoder"][0].out_name == "FCStatus"
assert rb_lib["FCEventDecoder"][0].out_name == "FCEvent"
assert rb_lib["FCEventDecoder"][0].key_list == range(0, 6)
assert rb_lib["FCEventDecoder"][0].key_list == list(range(0, 6))


def test_open_stream(lgnd_test_data):
Expand Down

0 comments on commit f06111d

Please sign in to comment.