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

I/O Abstraction #182

Open
rburghol opened this issue Dec 13, 2024 · 4 comments
Open

I/O Abstraction #182

rburghol opened this issue Dec 13, 2024 · 4 comments

Comments

@rburghol
Copy link
Contributor

rburghol commented Dec 13, 2024

Caching

  • IO class (read hdf) allows caching of timeseries, so that there is no need to reload a series that has already been loaded from disk.
  • KO class does not currently have the ability to store data in memory, save_timeseries pushes the data to disk, and then, that seems to incur large overhead.
@aufdenkampe
Copy link
Collaborator

@rburghol, thanks for recording these notes in an issue!

I have one clarification/correction, however. The implementation of the file interface is actually done by file type in modules such as src/hsp2/hsp2io/hdf.py. So if you wanted to implement IO for a new file type (i.e. Parquet), you would want to copy the pattern in hdf.py.

The io.py module only implements the IOManager() class that orchestrates different IO protocols for the IO interface you pass into it.

To see an example of how that is used, look at the Create an instance of the HSP2 IO Manager section in the examples/1_Intro_to_HSP2.ipynb notebook. NOTE that this notebook appears to have gotten broken with some of the repo reorganization that's happened in the last year.

This PR describes it all reasonably well too:

@ptomasula, anything else to add?

@rburghol
Copy link
Contributor Author

Thanks @aufdenkampe -- I was flying by the seat of my pants!

aufdenkampe added a commit that referenced this issue Dec 16, 2024
@PaulDudaRESPEC, @timcera, @rburghol & @austinorr, the example 1 notebook now works by installing from the conda environment file. Most importantly this example notebook provides an example of how the IO manager should be used, as described in #182 (comment)
@aufdenkampe
Copy link
Collaborator

@rburghol, with PR #184, I fixed the Example 1 notebook, so you should be able to use it to explore the hsp2io.io.IOManager() class.

@rburghol
Copy link
Contributor Author

Thanks @aufdenkampe

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

No branches or pull requests

2 participants