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

Add support for loading data from Amazon S3 #416

Open
ericthewizard opened this issue Apr 3, 2023 · 4 comments · May be fixed by #1061
Open

Add support for loading data from Amazon S3 #416

ericthewizard opened this issue Apr 3, 2023 · 4 comments · May be fixed by #1061
Assignees
Labels
enhancement New feature or request heliocloud pytplot Issues involving the pytplot package

Comments

@ericthewizard
Copy link
Collaborator

Heliocloud has a large amount of MMS data available via S3 buckets. At some point, we should update PyTplot and PySPEDAS to support loading data from S3

@ericthewizard ericthewizard added the enhancement New feature or request label Apr 3, 2023
@jameswilburlewis jameswilburlewis added the pytplot Issues involving the pytplot package label May 17, 2023
@jameswilburlewis
Copy link
Contributor

Some notes from PyHC discussion on containerizing PyHC projects:

fsspec package can be used to open files on S3 and return an object that behaves as an ordinary file handle. It also supports caching to local filesystem.

cdflib already supports opening files on S3. netcdf4 does not, but there is an s3netcdf4 package that supports this.

It might be good for cdflib and netcdf4 to provide direct support for passing fsspec objects instead of filenames (abstracting out the type of endpoint being used).

@edmondb
Copy link
Collaborator

edmondb commented Apr 4, 2024

Created a working branch (416-s3-awareness) as we begin to address this. Let us know if you'd like to discuss any updates and/or requests associated with this.

@jameswilburlewis
Copy link
Contributor

Looking forward to seeing what you come up with! Feel free to bounce any ideas off me...do you have a general approach in mind yet? I was thinking it would be nice if the CDF, NetCDF, and FITS readers could be modified to take open file descriptors instead of filenames, then if the PySPEDAS download code sees s3: URLs, it could open them itself (using an S3 aware package) and pass the handles to the other libraries.

@edmondb
Copy link
Collaborator

edmondb commented Jul 31, 2024

@jameswilburlewis , this update with associated PR is not a full solution to close this issue. It covers the majority of PySPEDAS cases that calls download.py but does not include dependencies (like fsspec), custom download functions, and further development will be coming in the future and pushed to this branch (documentation, tests, etc.). We could merge now with master (after we push the dependencies that are breaking the build tests) and then keep developing off of this branch if that's preferred. This push is to get the conversation going as to any additional comments on the PR.

Included here is also a flow chart of the logic for the download_file method within download.py. As you can see, it adds several functional decision paths to retain a non-API-breaking implementation for cloud-awareness.

flow.pdf

It would be great to receive feedback on this initial PR in order to ensure the remaining changes planned for the custom download methods will match in logic and functionality.

@edmondb edmondb linked a pull request Nov 20, 2024 that will close this issue
@edmondb edmondb linked a pull request Nov 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request heliocloud pytplot Issues involving the pytplot package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants