From 2ce501ae0662b472ca94b5da10aac04513c8f123 Mon Sep 17 00:00:00 2001 From: Nicholas Shavers <nshavers@contractor.usgs.gov> Date: Wed, 15 Jan 2025 14:09:59 -0800 Subject: [PATCH] removed time_format code --- geomagio/api/xml/XMLFactory.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/geomagio/api/xml/XMLFactory.py b/geomagio/api/xml/XMLFactory.py index 4e6850de..d5a63f71 100644 --- a/geomagio/api/xml/XMLFactory.py +++ b/geomagio/api/xml/XMLFactory.py @@ -10,19 +10,9 @@ class XMLFactory(TimeseriesFactory): def __init__( self, - time_format="iso8601", # could be "iso8601" or "numeric" **kwargs, ): - """ - Parameters - ---------- - time_format : {"iso8601", "numeric"} - - "iso8601": each time value is an ISO8601 string - - "numeric": each time value is numeric (epoch milliseconds) - - """ super().__init__(**kwargs) - self.time_format = time_format def parse_string(self, data: str, **kwargs): """ @@ -67,13 +57,10 @@ class XMLFactory(TimeseriesFactory): start_time_str = description.findtext("StartTime", default="") sample_period = float(description.findtext("SamplePeriod", default="60000")) - if self.time_format == "numeric": - starttime = UTCDateTime(float(start_time_str) / 1000.0) - else: - try: - starttime = UTCDateTime(start_time_str) - except Exception: - starttime = UTCDateTime() + try: + starttime = UTCDateTime(start_time_str) + except Exception: + starttime = UTCDateTime() # Parse Data data_element = root.find("Data") -- GitLab