From 5445f79b90437db2aa5193721063ae33f9b08b28 Mon Sep 17 00:00:00 2001 From: Zachary Sherman Date: Thu, 11 Apr 2024 17:32:31 +0000 Subject: [PATCH 1/2] FIX: Update datetimeutcnow to new syntax to fix depreciation warning. --- src/icartt/dataset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/icartt/dataset.py b/src/icartt/dataset.py index e4a685b..7d53901 100644 --- a/src/icartt/dataset.py +++ b/src/icartt/dataset.py @@ -983,8 +983,8 @@ class Dataset: self.missionName = "MUSTEREX" # .utcnow() should not be used in general, but it is ok if you just need the timetuple. - self.dateOfCollection = datetime.datetime.utcnow().timetuple()[:3] - self.dateOfRevision = datetime.datetime.utcnow().timetuple()[:3] + self.dateOfCollection = datetime.datetime.now(datetime.UTC).timetuple()[:3] + self.dateOfRevision = datetime.datetime.now(datetime.UTC).timetuple()[:3] self.dataIntervalCode = [0.0] self.independentVariable = None -- GitLab From 1d2eacf46162afa5917b984c14779b88f3b1fb47 Mon Sep 17 00:00:00 2001 From: Zachary Sherman Date: Thu, 11 Apr 2024 18:51:21 +0000 Subject: [PATCH 2/2] FIX: Use timezone.utc instead of datetime.UTC --- src/icartt/dataset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/icartt/dataset.py b/src/icartt/dataset.py index 7d53901..5538606 100644 --- a/src/icartt/dataset.py +++ b/src/icartt/dataset.py @@ -983,8 +983,8 @@ class Dataset: self.missionName = "MUSTEREX" # .utcnow() should not be used in general, but it is ok if you just need the timetuple. - self.dateOfCollection = datetime.datetime.now(datetime.UTC).timetuple()[:3] - self.dateOfRevision = datetime.datetime.now(datetime.UTC).timetuple()[:3] + self.dateOfCollection = datetime.datetime.now(datetime.timezone.utc).timetuple()[:3] + self.dateOfRevision = datetime.datetime.now(datetime.timezone.utc).timetuple()[:3] self.dataIntervalCode = [0.0] self.independentVariable = None -- GitLab