-
Notifications
You must be signed in to change notification settings - Fork 25
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
[python] Remove AxisName.getattr_from
from ExperimentAxisQuery
#3557
Merged
Conversation
This file contains 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
jp-dark
requested review from
johnkerl and
ryan-williams
and removed request for
johnkerl
January 10, 2025 21:49
bkmartinjr
approved these changes
Jan 16, 2025
Rather than deconstructing/reconstructing the choice to use obs or var, just call `_read_as_csr` directly with the appropriate values.
Create a new function `_read_inner_ndarray` that is not a method of `ExperimentAxisQuery`. The new function `_read_inner_ndarray` directly takes `SparseNDArray`, `joinids`, and `indexer` rather than trying to deconstruct and reconstruct the functions for `AxisName` enum.
jp-dark
force-pushed
the
dark/remove_getattr_from
branch
from
January 16, 2025 20:02
67da7bb
to
7c934f8
Compare
github-actions bot
pushed a commit
that referenced
this pull request
Jan 16, 2025
…3557) The `ExperimentAxisQuery` used the `AxisName` enumeration to access attributes with either `obs` or `var` in the name. This PR directly calls the appropriate functions, primarily by pushing up the calls to one function higher (e.g. pass in `self.indexer.by_obs`/`self.indexer.by_var` instead of `AxisName.OBS`/`AxisName.VAR`). This change allowed `ExperimentAxisQuery._convert_to_ndarray` and `ExperimentAxisQuery._axism_inner_ndarray` to be merged into a single non-member function, and `ExperimentAxisQuery._axisp_inner_sparray` to be replaced with a direct call to `_read_as_csr`.
johnkerl
pushed a commit
that referenced
this pull request
Jan 16, 2025
…3557) (#3577) The `ExperimentAxisQuery` used the `AxisName` enumeration to access attributes with either `obs` or `var` in the name. This PR directly calls the appropriate functions, primarily by pushing up the calls to one function higher (e.g. pass in `self.indexer.by_obs`/`self.indexer.by_var` instead of `AxisName.OBS`/`AxisName.VAR`). This change allowed `ExperimentAxisQuery._convert_to_ndarray` and `ExperimentAxisQuery._axism_inner_ndarray` to be merged into a single non-member function, and `ExperimentAxisQuery._axisp_inner_sparray` to be replaced with a direct call to `_read_as_csr`. Co-authored-by: Julia Dark <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3557 +/- ##
==========================================
+ Coverage 86.23% 86.27% +0.04%
==========================================
Files 55 55
Lines 6398 6375 -23
==========================================
- Hits 5517 5500 -17
+ Misses 881 875 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
The
ExperimentAxisQuery
used theAxisName
enumeration to access attributes with eitherobs
orvar
in the name. This PR directly calls the appropriate functions, primarily by pushing up the calls to one function higher (e.g. pass inself.indexer.by_obs
/self.indexer.by_var
instead ofAxisName.OBS
/AxisName.VAR
).This change allowed
ExperimentAxisQuery._convert_to_ndarray
andExperimentAxisQuery._axism_inner_ndarray
to be merged into a single non-member function, andExperimentAxisQuery._axisp_inner_sparray
to be replaced with a direct call to_read_as_csr
.