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

Allow LindiH5pyFile.from_hdf5_file to accept remote URL for local file #66

Merged
merged 3 commits into from
May 15, 2024

Conversation

rly
Copy link
Contributor

@rly rly commented May 13, 2024

I would like to download a remote HDF5 file and create a lindi file with references to the remote location using the downloaded local HDF5 file. I think creating such a lindi file using a remote HDF5 file would take longer than downloading the file and creating such a lindi file using the downloaded local HDF5 file, but I am not sure.

LindiH5ZarrStore.from_file lets you create a store using a local file with references to the remote location:

LindiH5pyFile.from_hdf5_file calls LindiH5ZarrStore.from_file but does not let the user set the remote location to a location different from the file location:

def from_hdf5_file(url_or_path: str, *, mode: LindiFileMode = "r", local_cache: Union[LocalCache, None] = None, zarr_store_opts: Union[LindiH5ZarrStoreOpts, None] = None):

This PR exposes the url keyword argument in LindiH5ZarrStore.from_file to LindiH5pyFile.from_hdf5_file to allow those two locations to be different. The docstring is copied from LindiH5ZarrStore.from_file and modified.

@magland please confirm that the last sentence of the docstring for url is still valid.

@rly rly requested a review from magland May 13, 2024 22:21
@rly rly changed the title Update LindiH5pyFile.py Allow LindiH5pyFile.from_hdf5_file to accept remote URL for local file May 13, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 13, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 81.35%. Comparing base (1fc62ef) to head (e50931b).

Files Patch % Lines
lindi/LindiH5pyFile/LindiH5pyFile.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #66   +/-   ##
=======================================
  Coverage   81.35%   81.35%           
=======================================
  Files          30       30           
  Lines        2194     2194           
=======================================
  Hits         1785     1785           
  Misses        409      409           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rly rly merged commit b7b66f2 into main May 15, 2024
6 checks passed
@rly rly deleted the url_for_from_hdf5_file branch May 15, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants