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
Extend API to support dynamic time slices #264
Conversation
@danielhuppmann updated based on your suggestions. Could you please help updating documentation (see checkbox in PR description)? |
Codecov Report
@@ Coverage Diff @@
## master #264 +/- ##
==========================================
+ Coverage 96.96% 97.07% +0.10%
==========================================
Files 38 38
Lines 3530 3760 +230
==========================================
+ Hits 3423 3650 +227
- Misses 107 110 +3
Continue to review full report at Codecov.
|
ixmp/core.py
Outdated
@@ -286,6 +286,31 @@ def add_region_synonym(self, region, mapped_to): | |||
|
|||
self._backend.set_node(region, synonym=mapped_to) | |||
|
|||
def timeslices(self): | |||
"""Return all subannual time slices defined for the IAMC-style |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the numpydoc standard: the short summary should fit on one line.
One thing I would like to see described: what is the meaning of time slice ‘categories’? Do they have any functional effect? How can they be defined? |
From my understanding, |
FYI, #267 incidentally fixed some CI issues that had come up. Rebasing this PR will help the checks pass. |
dcb6fc1
to
13e51d4
Compare
In #269, @danielhuppmann wrote:
I think in this case I have totally failed to understand what the data model is supposed to be—and I thought I had been paying attention/working with the code. New users will be even more confused. This points to the need for a clear description of the various data structure(s) that are supported and the semantics of how they are represented. |
@zikolach I just said to @danielhuppmann on Slack that, because of the adjustments throughout the test suite in #270, this will need a rebase. If it's not obvious how to resolve the conflicts, please ask and I can help. |
Tests passed on TC so I pushed changes to original branch. Please have a look as it might be some leftovers in test_timeseries.py after merging timeseries-related tests in one file. |
- allow to add timesteps to db - get list of timesteps from db - update dockstrings - update release notes - add support for adding and retrieving of timeseries having time dimension - add python3-setuptools to test image Dockerfile - add docstrings related to the `timeslices` feature - appease stickler, harmonize notation - be consistent about upper/lower-case (per review comment by @zikolach) - implement review comments by @khaeru - add docstrings on relation of timeslice and message_ix.Scenario 'time' - exclude JPype1 version 0.7.2 due to crashes - add tests and rename time to subannual (#277) - add check for duplicate timeslice addition (with unit test) - refactor to names similar to `pyam` for consistency - extend test for subannual timeseries data - update timeslices API - fix error message produced by add_timeslice (+ fixed test) - fix check_out method called on TimeSeries object - update test to use time (instead of subannual) name (rename will be addressed separately) - update timeslices API - rename time to subannual in "public facing API" - return from java timeseries time attribute as subannual Co-authored-by: Daniel Huppmann <dh@dergelbesalon.at>
7f6170d
to
6ee8977
Compare
@danielhuppmann do you plan to add more tests or change anything in this branch? If not I would go ahead and:
|
No, I don't see any additional tests necessary (for the new features) - good to go as far as I'm concerned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @zikolach!
@danielhuppmann I am going to merge ixmp and commit fresh jar build from master to this PR |
Can we have a complete description of this PR, for future reference? |
Sure, I'll update it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zikolach @danielhuppmann thanks for the efforts here, it's looking good! A number of minor changes; the major one is to please try to follow the style of the existing tests in terms of re-using data. This makes it much easier to focus on what is being tested in each test, rather than having to skim past many lines that redefine the same data.
If I can supply some text, e.g. for a comment that provides a guide to this style, please ask.
@khaeru thanks for great (detailed) feedback! I followed your recommendations of updating docstrings and tests. |
- move adding subannual column to to_iamc_template - simplify method implementation - add missing subannual parameter to remove_timeseries/backend
- Broken by iiasa/ixmp#264. - Fixed by iiasa/ixmp#295.
Requirements
Changelist:
Actions:
Related PR https://github.com/iiasa/ixmp_source/pull/264