Skip to content
Snippets Groups Projects
Commit 2ce501ae authored by Shavers, Nicholas H's avatar Shavers, Nicholas H
Browse files

removed time_format code

parent dd4896c0
No related branches found
No related tags found
1 merge request!380xmlfactory mvp
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment