DC-analysis / dclab

Python library for the post-measurement analysis of real-time deformability cytometry (RT-DC) data sets
https://dclab.readthedocs.io
Other
11 stars 12 forks source link

Issue 214 lru cache mem leak #240

Closed maxschloegel closed 1 year ago

maxschloegel commented 1 year ago

In this MR we refactor all functools.lru_cache decorators on instance methods, since they introduce memory-leak.

Currently the only class that still contains lru_cache-decorators for instance methods is DCORTraceItem in dclab.rtdc_dataset/fmt_dcor/events.py. There are going to be future refactoring steps that will remove these.

codecov-commenter commented 1 year ago

Codecov Report

Attention: 48 lines in your changes are missing coverage. Please review.

Comparison is base (8eb38a0) 75.54% compared to head (bd8c699) 73.01%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #240 +/- ## ========================================== - Coverage 75.54% 73.01% -2.53% ========================================== Files 109 109 Lines 7586 7598 +12 ========================================== - Hits 5731 5548 -183 - Misses 1855 2050 +195 ``` | [Files](https://app.codecov.io/gh/DC-analysis/dclab/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DC-analysis) | Coverage Δ | | |---|---|---| | [dclab/rtdc\_dataset/core.py](https://app.codecov.io/gh/DC-analysis/dclab/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DC-analysis#diff-ZGNsYWIvcnRkY19kYXRhc2V0L2NvcmUucHk=) | `89.23% <100.00%> (+1.59%)` | :arrow_up: | | [dclab/rtdc\_dataset/fmt\_hdf5/base.py](https://app.codecov.io/gh/DC-analysis/dclab/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DC-analysis#diff-ZGNsYWIvcnRkY19kYXRhc2V0L2ZtdF9oZGY1L2Jhc2UucHk=) | `92.00% <ø> (+0.41%)` | :arrow_up: | | [dclab/rtdc\_dataset/fmt\_hdf5/events.py](https://app.codecov.io/gh/DC-analysis/dclab/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DC-analysis#diff-ZGNsYWIvcnRkY19kYXRhc2V0L2ZtdF9oZGY1L2V2ZW50cy5weQ==) | `98.66% <100.00%> (+0.69%)` | :arrow_up: | | [dclab/rtdc\_dataset/fmt\_hdf5/logs.py](https://app.codecov.io/gh/DC-analysis/dclab/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DC-analysis#diff-ZGNsYWIvcnRkY19kYXRhc2V0L2ZtdF9oZGY1L2xvZ3MucHk=) | `100.00% <100.00%> (ø)` | | | [dclab/rtdc\_dataset/fmt\_hdf5/tables.py](https://app.codecov.io/gh/DC-analysis/dclab/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DC-analysis#diff-ZGNsYWIvcnRkY19kYXRhc2V0L2ZtdF9oZGY1L3RhYmxlcy5weQ==) | `95.65% <100.00%> (+0.19%)` | :arrow_up: | | [dclab/rtdc\_dataset/fmt\_hierarchy.py](https://app.codecov.io/gh/DC-analysis/dclab/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DC-analysis#diff-ZGNsYWIvcnRkY19kYXRhc2V0L2ZtdF9oaWVyYXJjaHkucHk=) | `98.03% <100.00%> (+<0.01%)` | :arrow_up: | | [dclab/rtdc\_dataset/fmt\_dcor/logs.py](https://app.codecov.io/gh/DC-analysis/dclab/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DC-analysis#diff-ZGNsYWIvcnRkY19kYXRhc2V0L2ZtdF9kY29yL2xvZ3MucHk=) | `47.05% <0.00%> (-15.45%)` | :arrow_down: | | [dclab/rtdc\_dataset/fmt\_tdms/event\_image.py](https://app.codecov.io/gh/DC-analysis/dclab/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DC-analysis#diff-ZGNsYWIvcnRkY19kYXRhc2V0L2ZtdF90ZG1zL2V2ZW50X2ltYWdlLnB5) | `0.00% <0.00%> (ø)` | | | [dclab/rtdc\_dataset/fmt\_dcor/tables.py](https://app.codecov.io/gh/DC-analysis/dclab/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DC-analysis#diff-ZGNsYWIvcnRkY19kYXRhc2V0L2ZtdF9kY29yL3RhYmxlcy5weQ==) | `34.61% <0.00%> (-9.39%)` | :arrow_down: | | [dclab/rtdc\_dataset/fmt\_tdms/event\_contour.py](https://app.codecov.io/gh/DC-analysis/dclab/pull/240?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DC-analysis#diff-ZGNsYWIvcnRkY19kYXRhc2V0L2ZtdF90ZG1zL2V2ZW50X2NvbnRvdXIucHk=) | `0.00% <0.00%> (ø)` | | | ... and [1 more](https://app.codecov.io/gh/DC-analysis/dclab/pull/240?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DC-analysis) | | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/DC-analysis/dclab/pull/240/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DC-analysis)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

maxschloegel commented 1 year ago

The errors thrown above are the DCOR-issues you, @paulmueller , were talking about, right?

paulmueller commented 1 year ago

Tests failing is not related to this PR.

paulmueller commented 1 year ago

Looks good to me. Can I merge?

maxschloegel commented 1 year ago

Yes!