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.
This pull request introduces several enhancements and new features to the
sharrow
library, focusing on improving data handling and expression evaluation capabilities. Key changes include the addition of new methods for evaluating expressions, improvements to data handling, and the introduction of a new class to manage subspaces within a data tree.Enhancements to Expression Evaluation:
get_expr
method to support more flexible evaluation, includingdtype
andwith_coords
. (sharrow/relationships.py
)eval
andeval_many
methods to evaluate single or multiple expressions with various engines and return results asDataArray
orDataset
. (sharrow/relationships.py
)Improvements to Data Handling:
__getitem__
method to check for cached evaluations before attempting to retrieve items from the data tree. (sharrow/relationships.py
)get
method to ensure results are transposed according to the root dimensions or specified dimension order. (sharrow/relationships.py
)_getitem
to ensure consistent dimension labeling across datasets. (sharrow/relationships.py
)New Class for Subspace Management:
DataTreeBranch
class to facilitate access to variables in subspaces of a data tree, supporting the use of python and numexpr engines for dotted data. (sharrow/tree_branch.py
)Additional Changes:
Mapping
,Sequence
, andLiteral
from thecollections.abc
andtyping
modules. (sharrow/relationships.py
)eval
andeval_many
methods with different engines and digitization settings. (sharrow/tests/test_relationships.py
)