Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emodulus calculation in hierarchy child #92

Open
lucaswittwer opened this issue Feb 17, 2021 · 5 comments
Open

emodulus calculation in hierarchy child #92

lucaswittwer opened this issue Feb 17, 2021 · 5 comments

Comments

@lucaswittwer
Copy link

Description:
Calculating the auxilliary feature emodulus in a hierarchy child of a RTDCBase data set does not work:

# doing some filtering on data set `ds`
ds.apply_filter()

dsf=dclab.new_dataset(ds)

dsf.config["calculation"]["emodulus lut"] = "LE-2D-FEM-19"
dsf.config["calculation"]["emodulus medium"] = dsf.config["setup"]["medium"]
dsf.config["calculation"]["emodulus temperature"] = 23.0

print('emodulus' in dsf)

prints False

Calculating the emodulus based on the data set ds works and is propagated to the dsf data set too. I think it would be nice to trigger the calculation of such features in a hierarchy child too.

@paulmueller
Copy link
Member

This would be a nice feature indeed. Question is how to implement it. The current analysis pipeline demands that hierarchy children inherit all feature data from their parents.

@lucaswittwer
Copy link
Author

Haven't looked into the implementation yet, adding a warning (with a hint how to get the emodulus into a child dataset) would be a good start I think.

Does the child "know" its parents? If so, triggering the computation in the parent would be a workaround.

@paulmueller
Copy link
Member

paulmueller commented Feb 18, 2021

The child knows its parent: https://github.com/ZELLMECHANIK-DRESDEN/dclab/blob/master/dclab/rtdc_dataset/fmt_hierarchy.py#L234-L235

We have to keep these things in mind:

  • A parent can also be a child.
  • Metadata inheritance: If a child computes the Young's modulus and the corresponding metadata in the parent change, then the child needs to be updated as well (maybe with a warning).
  • "emodulus" is an ancillary feature. A solution would have to work for all ancillary features (not just cross-talk correction, but also computation of brightness, inertia ratio, etc.).

I think the best solution for now would be to raise an exception if anyone tries to set CFG_ANALYSIS["calculation"] keywords for a hierarchy child.

@felix-r
Copy link
Contributor

felix-r commented Aug 4, 2022

I just came across this problem again and it took me a while to figure out what I was doing wrong. So, it would be nice to get an exception when trying to perform the emodulus calculation for a hierachy child with the explanation that the emodulus can only be computed for the original dataset. Right now you get the exception KeyError: "Feature 'emodulus' does not exist in <RTDC_HDF5 ... which is just frustrating.

@paulmueller
Copy link
Member

I made the error message more verbose, but this issue should stay open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants