-
Notifications
You must be signed in to change notification settings - Fork 113
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
Generalize reporting.Quantity in preparation for sparse xarray #317
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
6 tasks
Codecov Report
@@ Coverage Diff @@
## master #317 +/- ##
==========================================
+ Coverage 95.15% 95.79% +0.64%
==========================================
Files 42 45 +3
Lines 4682 4876 +194
==========================================
+ Hits 4455 4671 +216
+ Misses 227 205 -22
Continue to review full report at Codecov.
|
khaeru
force-pushed
the
issue/191
branch
2 times, most recently
from
April 30, 2020 13:53
d5d944d
to
664540e
Compare
khaeru
force-pushed
the
issue/191
branch
4 times, most recently
from
June 9, 2020 12:37
63f0fe3
to
5226ae6
Compare
khaeru
changed the title
Use sparse xarray for reporting.Quantity
Generalize reporting.Quantity in preparation for sparse xarray
Jun 19, 2020
khaeru
added a commit
to khaeru/message_ix
that referenced
this pull request
Jun 19, 2020
khaeru
added a commit
to khaeru/message_ix
that referenced
this pull request
Jun 19, 2020
3 tasks
khaeru
added a commit
to khaeru/ixmp
that referenced
this pull request
Jun 19, 2020
- Make Quantity() a factory method rather than class/type. - Quantity.CLASS is a string used to check the current implementation. - Remove reporting.as_quantity and all uses of this function; Quantity(...) now does the same. - Move AttrSeries.align_levels from computations.product. - Update testing.assert_qty_equal and .assert_qty_allclose.
khaeru
added a commit
to khaeru/message_ix
that referenced
this pull request
Jun 20, 2020
khaeru
added a commit
to khaeru/message_ix
that referenced
this pull request
Jun 20, 2020
khaeru
added a commit
to khaeru/message_ix
that referenced
this pull request
Jun 20, 2020
khaeru
added a commit
to khaeru/message_ix
that referenced
this pull request
Jun 20, 2020
khaeru
added a commit
to khaeru/message_ix
that referenced
this pull request
Jun 20, 2020
khaeru
added a commit
to iiasa/message_ix
that referenced
this pull request
Jun 20, 2020
khaeru
added a commit
to khaeru/genno
that referenced
this pull request
Jan 11, 2021
khaeru
added a commit
to khaeru/genno
that referenced
this pull request
Jan 11, 2021
khaeru
added a commit
to khaeru/genno
that referenced
this pull request
Jan 11, 2021
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.
We have two internal representations of a reporting Quantity:
reporting.attrseries
, which makes a pandas.Series act like a sparse xr.DataArray, e.g. not caring about order of dimensions.reporting.sparsedataarray
(added by this PR) which uses an xr.DataArray backed by pydata/sparse data storage.The pydata/sparse support via xarray is
now complete enough that we could use it instill maturing, with some remaining bugs, e.g. pydata/sparse#360. This PR cleans up the code so that the two internal representations of a Quantity are 100% interchangeable. It does not actually switch away fromixmp.reporting
reporting.attrseries
, which remains the default; that switch can be made later.Some of the code in
sparsedataarray
should be contributed upstream (e.g. pydata/xarray#4007); once they are accepted by xarray, this helper code will shrink and can eventually be eliminated.How to review
Note that CI checks all pass.
PR checklist