Skip to content

Commit

Permalink
enh: hierarchy parents inherit their parent's logs and tables
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed May 3, 2023
1 parent e24018e commit 4b68e71
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
0.50.1
- enh: support reading 'logs' from DCOR datasets
- enh: hierarchy parents inherit their parent's logs and tables
0.50.0
- feat: support opening objects on S3-compatible storage (#213)
- feat: support opening file-like objects as HDF5 data
Expand Down
2 changes: 2 additions & 0 deletions dclab/rtdc_dataset/fmt_hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ def __init__(self, hparent, apply_filter=True, *args, **kwargs):

self.path = hparent.path
self.title = hparent.title + "_child"
self.logs = hparent.logs
self.tables = hparent.tables

self._events = {}

Expand Down
10 changes: 10 additions & 0 deletions tests/test_rtdc_fmt_hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import numpy as np
import pytest

import dclab
from dclab import new_dataset
from dclab.rtdc_dataset import fmt_hierarchy, RTDCWriter

Expand Down Expand Up @@ -78,6 +79,15 @@ def test_config_calculation_does_not_work_in_child_issue_92():
ch["emodulus"]


def test_hierarchy_logs():
"""Since version 0.50.1, hierarchy children inherit logs"""
ds = new_dataset(retrieve_data("fmt-hdf5_fl_wide-channel_2023.zip"))
assert len(ds.logs)
ch = dclab.new_dataset(ds)
assert ch.logs
assert ch.logs["dclab-compress"][0] == "{"


@pytest.mark.filterwarnings(
"ignore::dclab.rtdc_dataset.config.WrongConfigurationTypeWarning")
def test_dtype_mask_image():
Expand Down

0 comments on commit 4b68e71

Please sign in to comment.