Skip to content

Commit

Permalink
fix: update register labels in DAQJobCAENToolbox to remove 'caen_' pr…
Browse files Browse the repository at this point in the history
…efix
  • Loading branch information
furkan-bilgin committed Dec 25, 2024
1 parent d3db7a0 commit 80386b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/enrgdaq/daq/jobs/caen/toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def start(self):
DAQJobMessageStoreTabular(
store_config=self.config.store_config,
tag="caen-toolbox",
keys=["timestamp", *[f"caen_{x}" for x in registers]],
keys=["timestamp", *[x for x in registers]],
data=[
[
get_now_unix_timestamp_ms(),
Expand Down
8 changes: 4 additions & 4 deletions src/tests/test_toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def setUp(self, mock_which):
connection_string="-c OPTICAL_LINK -l 0",
store_config=MagicMock(),
register_labels=[
RegisterLabel(register="reg1", label="caen_reg1"),
RegisterLabel(register="reg2", label="caen_reg2"),
RegisterLabel(register="reg1", label="reg1"),
RegisterLabel(register="reg2", label="reg2"),
],
)
self.daq_job = DAQJobCAENToolbox(self.config)
Expand Down Expand Up @@ -46,7 +46,7 @@ def test_init_cli_not_present(self, mock_which):
def test_dump_digitizer(self, mock_open, mock_exists, mock_run):
mock_run.return_value.returncode = 0
registers = self.daq_job._dump_digitizer()
self.assertEqual(registers, {"caen_reg1": 1, "caen_reg2": 2})
self.assertEqual(registers, {"reg1": 1, "reg2": 2})

@patch("enrgdaq.daq.jobs.caen.toolbox.subprocess.run")
@patch("enrgdaq.daq.jobs.caen.toolbox.os.path.exists", return_value=False)
Expand Down Expand Up @@ -92,7 +92,7 @@ def test_start(
message = self.daq_job._put_message_out.call_args[0][0]
self.assertEqual(message.store_config, self.config.store_config)
self.assertEqual(message.tag, "caen-toolbox")
self.assertEqual(message.keys, ["timestamp", "caen_reg1", "caen_reg2"])
self.assertEqual(message.keys, ["timestamp", "reg1", "reg2"])
self.assertEqual(message.data, [[1234567890, 1, 2]])


Expand Down

0 comments on commit 80386b5

Please sign in to comment.