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

More options for eval engine #68

Merged
merged 10 commits into from
Oct 27, 2024
Merged

Conversation

jpn--
Copy link
Member

@jpn-- jpn-- commented Oct 25, 2024

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:

  • Added new parameters to the get_expr method to support more flexible evaluation, including dtype and with_coords. (sharrow/relationships.py)
  • Introduced eval and eval_many methods to evaluate single or multiple expressions with various engines and return results as DataArray or Dataset. (sharrow/relationships.py)

Improvements to Data Handling:

  • Modified the __getitem__ method to check for cached evaluations before attempting to retrieve items from the data tree. (sharrow/relationships.py)
  • Enhanced broadcasting logic in the get method to ensure results are transposed according to the root dimensions or specified dimension order. (sharrow/relationships.py)
  • Added handling for top dimension names in _getitem to ensure consistent dimension labeling across datasets. (sharrow/relationships.py)

New Class for Subspace Management:

  • Introduced the 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:

  • Updated imports to include Mapping, Sequence, and Literal from the collections.abc and typing modules. (sharrow/relationships.py)
  • Added new tests to verify the functionality of the eval and eval_many methods with different engines and digitization settings. (sharrow/tests/test_relationships.py)

@jpn-- jpn-- changed the title dtype arg for get_expr More options for eval engine Oct 26, 2024
@jpn-- jpn-- merged commit 652da47 into ActivitySim:main Oct 27, 2024
15 checks passed
@jpn-- jpn-- deleted the dtype-in-expr branch October 27, 2024 00:22
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

Successfully merging this pull request may close these issues.

1 participant