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

update usage of isodatetime methods #2579

Merged
merged 5 commits into from
Apr 11, 2022

Conversation

wxtim
Copy link
Contributor

@wxtim wxtim commented Apr 10, 2022

Use new names of Isodatetime interfaces.

@wxtim wxtim self-assigned this Apr 10, 2022
@wxtim wxtim marked this pull request as draft April 10, 2022 08:50
@wxtim wxtim requested a review from MetRonnie April 10, 2022 09:07
@wxtim wxtim marked this pull request as ready for review April 10, 2022 09:07
@wxtim wxtim added this to the 2.0rc3 milestone Apr 10, 2022
This was referenced Apr 10, 2022
Copy link
Contributor

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spotted another needed fix:

diff --git a/metomi/rose/date.py b/metomi/rose/date.py
index dd4511c3..de9cf31c 100644
--- a/metomi/rose/date.py
+++ b/metomi/rose/date.py
@@ -302,8 +302,7 @@ class RoseDateTimeOperator:
     @classmethod
     def get_datetime_strftime(cls, time_point, print_format):
         """Use the datetime library's strftime as a fallback."""
-        calendar_date = time_point.copy().to_calendar_date()
-        year, month, day = calendar_date.get_calendar_date()
+        year, month, day = time_point.get_calendar_date()
         hour, minute, second = time_point.get_hour_minute_second()
         microsecond = int(1.0e6 * (second - int(second)))
         hour = int(hour)

Also, I think we should specify this version range, because we rely on the 3.x API:

diff --git a/setup.cfg b/setup.cfg
index d89a5b80..40e9fe36 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -53,7 +53,7 @@ install_requires =
     aiofiles
     jinja2>=2.10.1
     ldap3
-    metomi-isodatetime
+    metomi-isodatetime==3.*
     psutil>=5.6.0
     requests
     sqlalchemy

Possibly even 3.0.*? (Update from team catchup: whatever)

wxtim and others added 2 commits April 11, 2022 13:56
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
@wxtim wxtim requested a review from MetRonnie April 11, 2022 12:57
@@ -53,7 +53,7 @@ install_requires =
aiofiles
jinja2>=2.10.1
ldap3
metomi-isodatetime
metomi-isodatetime==1!3.*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot about the epoch

@oliver-sanders oliver-sanders merged commit 99d8355 into metomi:master Apr 11, 2022
@MetRonnie MetRonnie changed the title update set_time_zone_to_... methods update usage of isodatetime methods Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants