Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gipert committed Jan 16, 2025
1 parent 3ba9332 commit c045546
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/daq2lh5/build_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ def build_raw(
if isinstance(out_spec, str) and any(
[out_spec.endswith(ext) for ext in allowed_exts]
):
with open(out_spec) as f:
out_spec = utils.load_dict(f)
out_spec = utils.load_dict(out_spec)
if isinstance(out_spec, dict):
out_spec = RawBufferLibrary(config=out_spec, kw_dict=kwargs)
if isinstance(out_spec, RawBufferLibrary):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_raw_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def test_raw_buffer_list():
rbl = prb.RawBufferList()
rbl.set_from_json_dict(
rbl.set_from_dict(
{
"g{key:0>3d}": {
"key_list": [[3, 6]],
Expand All @@ -20,7 +20,7 @@ def test_raw_buffer_list():
assert rbl.get_list_of("key_list") == [[3], [4], [5], [6]]

rbl.clear()
rbl.set_from_json_dict(
rbl.set_from_dict(
{
"spms": {
"key_list": [[3, 6]],
Expand Down Expand Up @@ -64,7 +64,7 @@ def test_raw_buffer_lib_json_load():
}
"""
json_dict = json.loads(rb_json)
rblib = prb.RawBufferLibrary(json_dict=json_dict, kw_dict={"file_key": "run0"})
rblib = prb.RawBufferLibrary(config=json_dict, kw_dict={"file_key": "run0"})
rb_keyed = rblib["FCEventDecoder"].get_keyed_dict()
name = rb_keyed[41].out_name
assert name == "g041"

0 comments on commit c045546

Please sign in to comment.