Conversation
Collaborator
|
To fix the failing Python pixi tests, just merge (rebase) onto main |
Member
Author
|
@ppinchuk , I did some few improvements/adjustments but it is not ideal yet. This could take more documentation and tests. I have to move to something else, so I'll close this one as it is and return when I have a chance. |
Collaborator
|
No objections, but maybe a quick commit to fix the Rust linter? |
We certainly won't need u64 for this, but let's keep everything consistent on u64 for now and reduce that when it's time to optimize.
The `calculate` is now agnostic on the domain. It just respond to the given collection subset. Whoever calls this function is in charge of defining the target domain.
Reinstating log info on the chunk indices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Abstracting the chunk access.
We calculate the cost in full chunks at a time, thus the cost module doesn't need to understand Zarr, but just a collection of variables as
ndarrays. We need a collection because the cost definition can be any combination of variables. We don't necessarily use all the variables available in the dataset, so it would be a waste to load all of them (imagine a cost based on a single variable and a features dataset with 50 variables!). Also, one variable can be used in multiple layers, so we want to reduce the I/O and load that chunk-variable only one to be used in all layers.Instead of passing a Zarr object, we use a
LazyChunk, which behaves like aHashMap, so the cost function asks for a variable, and the LazyChunk reads it in the first time, and just access on the subsequent.The most important change here is to reduce the context in the cost module.