Raw h5py.Dataset attribute access from lazy objects - #117
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Benchmark comparison vs mainBaseline: |
|
CC: @ShivashriganeshMahato @divyansha1115 I remember you needed something like this for your projects. What do you think of this API? |
|
Also, @milosobral would love your thoughts too! |
Overall, this looks very useful, especially for large datasets. Regarding the API, passing a boolean feels a bit awkward and could easily lead to mistakes by end users. It might be more clear to provide two separate context managers instead (e.g., raw_access() and lazy_access()). |
Adds a context manager:
temporaldata.resolve_on_access(enabled):This allows accessing the raw
h5py.Datasetattributes of lazy objects without loading them into memory. Examples:Alternative names:
autoresolve(False),raw_access(True)Some considerations:
h5py.Datasetwould not reflect those lazy ops, and a warning will be printed explaining this.