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

Rewrite manifest logic in Rust? #23

Open
TomNicholas opened this issue Mar 12, 2024 · 1 comment
Open

Rewrite manifest logic in Rust? #23

TomNicholas opened this issue Mar 12, 2024 · 1 comment

Comments

@TomNicholas
Copy link
Member

The code in the manifests.manifest.py file is focused on input validation, creating an immutable data structure (the ChunkManifest), and merging multiple ChunkManifests together performantly (i.e. concatenating them). The validation is done using pydantic, which already uses Rust internally.

We might imagine re-implementing the core manifest logic in rust, then using python bindings to wrap it up into a python array that xarray can wrap. I have no idea if this is really a performance limitation, but it might be.

@TomNicholas
Copy link
Member Author

Since we merged #107, the context of this suggestion has changed. Now, in order to replace the ChunkManifest class one would need to write something that could replicate these features of the current triple-numpy-array solution:

  • array-like concatenation / stacking / indexing methods,
  • knows its own ndim / shape (which is the shape of the chunk grid).
  • store variable-length string paths as well as integer offsets/lengths.

The reasons why this idea might still be of interest are:

  1. To make ingestion of references from rust-based readers (e.g. hypergrib) more efficient (see Add hypergrib as as a grib reader #238),
  2. As another way to make the representation of references configurable (again see Add hypergrib as as a grib reader #238 for a use case)
  3. To make handing off the references to another rust application more efficient (cc @mpiannucci)

Probably rewriting in rust is overkill though, and we can achieve the above in python + using numpy rust bindings.

cc @JackKelly @emfdavid

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

1 participant