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

[summary] converting to date index to datetime by default #113

Closed
miroine opened this issue Mar 19, 2020 · 9 comments · Fixed by #267
Closed

[summary] converting to date index to datetime by default #113

miroine opened this issue Mar 19, 2020 · 9 comments · Fixed by #267
Assignees
Labels
enhancement New feature or request

Comments

@miroine
Copy link

miroine commented Mar 19, 2020

In the current behavior the indexes (Date) are an object ... would be much easier if they were by default as a datetime64
image

@miroine miroine added the enhancement New feature or request label Mar 19, 2020
@berland
Copy link
Collaborator

berland commented Mar 20, 2020

It makes technically sense to return it as datetime64, but I am not convinced it will be easier for users in all cases. But this is not cast in stone, and if it is to be changed, it should not be changed to late.

@asnyv
Copy link
Collaborator

asnyv commented Apr 7, 2020

For me it is not that important if it is a Date object or datetime64/Pandas timestamp, but would prefer it to be the same all the way. I see that fmu-ensemble (and I assume ecl2df as it is a copy of fmu-ensemble for summaries) returns datetime64 for "raw" time_index, and the Date object if you define a time_index like "monthly", which isn't that easy to guess before I stumble opon it.
In general I would prefer most of the equivalents like ecl.summary.EclSum.pandas_frame(), fmu-ensemble's .get_smry()/.load_smry() and ecl2df.summary.df() to return at as similar formats as possible

@berland
Copy link
Collaborator

berland commented Apr 14, 2020

Any change in default behaviour of this must be coordinated with fmu-ensemble. Consequences for users must be examined upfront. A less intrusive change could be to add an option alwaysdatetime=True (default is False as now) to the API, so that caller functions can choose to always have the DATE column converted to Datetime when returned.

@asnyv
Copy link
Collaborator

asnyv commented Apr 14, 2020

I could live with that @berland 👍

@berland
Copy link
Collaborator

berland commented Apr 16, 2020

#134 is merged, so API users can always get this behaviour when wanted.

@berland berland changed the title converting to date index to datetime by default [summary] converting to date index to datetime by default Jun 25, 2020
@berland
Copy link
Collaborator

berland commented Dec 28, 2020

PR #207 is taking one step towards returning DatetimeIndex, by issuing a FutureWarning if an explicit datetime=True is not passed to summary.df()

@berland
Copy link
Collaborator

berland commented Feb 2, 2021

Note: Pandas has a hard limit at 2262-04-11 when using DatetimeIndex (64-bits and nanosecond accuracy only allows representing 584 years). Eclipse simulations can go on for longer than year 2262.

@berland
Copy link
Collaborator

berland commented Feb 2, 2021

Context (and workaround): pandas-dev/pandas#7307

@berland
Copy link
Collaborator

berland commented Feb 10, 2021

The foreseeable future in reservoir simulation is defined as 500 years. This is a showstopper for having DatetimeIndex as default in Pandas dataframes.

https://equinor.slack.com/archives/C68CNC0M7/p1612947250054500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants