-
Notifications
You must be signed in to change notification settings - Fork 119
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
Refactor to allow subclasses to set their own time format #177
Refactor to allow subclasses to set their own time format #177
Conversation
348cdbb
to
26f19e3
Compare
Hey Zeb, looks like a good effort here. I made a PR into your branch with some of the nontrivial things I was thinking of (plus a little cleanup of surrounding code you didn't touch). Let me know if you have any questions there. More comments coming inline. |
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.
looks great! just a few thoughts
Agreed on your points!
…On Fri, Jan 25, 2019, 2:18 PM Daniel Huppmann ***@***.*** wrote:
***@***.**** commented on this pull request.
------------------------------
In pyam/core.py
<#177 (comment)>:
> @@ -83,6 +86,19 @@ def __init__(self, data, **kwargs):
if 'exec' in run_control():
self._execute_run_control()
+ def _format_data_time_col(self):
I think that a substantial part of our users and use cases will still
revolve around yearly data, so I'd very much like to retain the option to
do df.filter(year=2020). Plus we should cater to the use case of having
categorical sub-annual specifications like ['summer-day', 'winter-night'].
If this can be maintained while removing year on the backend, fine by me.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#177 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABVAEWrY7pXrS2KlaG5j5GoJHsXiuhQGks5vGwRAgaJpZM4aR5ny>
.
|
A few touch ups and cleaner logic for column discovery
looks great! Thanks @znicholls |
Please confirm that this PR has done the following:
Adding to RELEASE_NOTES.md (remove section after adding to RELEASE_NOTES.md)
Please add a single line in the release notes similar to the following:
Description of PR
This PR moves the formatting of the time column from
pyam/utils.py
into a method ofIamDataFrame
. This allows subclasses to avoid converting to pandas datetime if their timespan is greater than the pandas maximum of 584 years (see https://stackoverflow.com/questions/32888124/pandas-out-of-bounds-nanosecond-timestamp-after-offset-rollforward-plus-adding-a).