legend-exp / LegendHDF5IO.jl

HDF5-IO in Julia for the LEGEND experiment
Other
0 stars 6 forks source link

Add `Base.haskey` for `LHDataStore` #28

Closed fhagemann closed 1 year ago

fhagemann commented 1 year ago

I added support for haskey which allows to use the Base.haskey method in HDF5.jl https://github.com/JuliaIO/HDF5.jl/blob/9a90e4e5580878b64be2cb70799bf27221f11150/src/groups.jl#L116-L137

This method allows to recursively check if each step of the path exists.

How does that affect LHDataStore

h = LHDataStore("test.lh5", "w")
h["aa/b"] = 2
haskey(h, "aa/b") # used to return false, now returns true

Then, calling haskey on LHDataStore gives results consistent with those for HDF5.H5DataStore.

codecov-commenter commented 1 year ago

Codecov Report

Base: 49.82% // Head: 49.91% // Increases project coverage by +0.08% :tada:

Coverage data is based on head (138aa74) compared to base (ee450ef). Patch coverage: 100.00% of modified lines in pull request are covered.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #28 +/- ## ========================================== + Coverage 49.82% 49.91% +0.08% ========================================== Files 6 6 Lines 574 575 +1 ========================================== + Hits 286 287 +1 Misses 288 288 ``` | [Impacted Files](https://codecov.io/gh/legend-exp/LegendHDF5IO.jl/pull/28?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=legend-exp) | Coverage Δ | | |---|---|---| | [src/types.jl](https://codecov.io/gh/legend-exp/LegendHDF5IO.jl/pull/28?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=legend-exp#diff-c3JjL3R5cGVzLmps) | `98.80% <100.00%> (+<0.01%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=legend-exp). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=legend-exp)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.