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
API: Rm default value from time_delta for cd_index. #6953
Conversation
I agree we should let users decide this bit. We should also update the error raised in line 106-108, there is no default datetime type anymore. |
Great catch! Should be fixed in 4048403. |
The failures here are not related... And geospatial example somehow doubled the size of its array. And because I tried to use a github comment "suggestion" instead of just pushing to this PR, ended up with two commits instead of one and my test was hidden (unless you click "show resolved"). So here's that text:
|
Co-authored-by: Mridul Seth <git@mriduls.com>
e8e77e7
to
4a9bd8b
Compare
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.
I think this is ready for merging (or at least review). It improves the current interface and improves the docs.
* API: Rm default value from time_delta for cd_index. * Update exception message. Co-authored-by: Mridul Seth <git@mriduls.com> * TST: modify pytest.raises regex. * Second cd_index example with integer times * typo * warn about leap years --------- Co-authored-by: Mridul Seth <git@mriduls.com> Co-authored-by: Dan Schult <dschult@colgate.edu>
* API: Rm default value from time_delta for cd_index. * Update exception message. Co-authored-by: Mridul Seth <git@mriduls.com> * TST: modify pytest.raises regex. * Second cd_index example with integer times * typo * warn about leap years --------- Co-authored-by: Mridul Seth <git@mriduls.com> Co-authored-by: Dan Schult <dschult@colgate.edu>
* API: Rm default value from time_delta for cd_index. * Update exception message. Co-authored-by: Mridul Seth <git@mriduls.com> * TST: modify pytest.raises regex. * Second cd_index example with integer times * typo * warn about leap years --------- Co-authored-by: Mridul Seth <git@mriduls.com> Co-authored-by: Dan Schult <dschult@colgate.edu>
I'd like to propose a change to the
cd_index
API: removing the default value fortime_delta
. The current default of 5 years as atimedelta
object feels arbitrary, and I can't think of a strong reason why a default value makes sense here. Furthermore, providing adatetime.timedelta
object suggests that thetime
node attribute must bedatetime.datetime
objects by default, which feels like too strong a recommendation IMO.