@@ -108,6 +108,8 @@ def get(self, pathname: str, startdatetime=None, enddatetime=None, trim=False):
108108 new_pathname = pathname
109109 if (DssPath (pathname ).D .lower () != "ts-pattern" ):
110110 new_pathname = DssPath (pathname ).path_without_date ().__str__ ()
111+ elif type == RecordType .IrregularTimeSeries :
112+ raise ValueError ("ts-pattern is not fully supported for irregular time series" )
111113 ts = self ._get_timeseries (new_pathname , startdatetime , enddatetime , trim )
112114 return ts
113115 elif type == RecordType .PairedData :
@@ -317,7 +319,7 @@ def _get_julian_time_range(self, pathname, boolFullSet):
317319 firstSeconds = [0 ]
318320 lastValidJulian = [0 ]
319321 lastSeconds = [0 ]
320- self ._native .hec_dss_tsGetDateTimeRange (
322+ status = self ._native .hec_dss_tsGetDateTimeRange (
321323 pathname ,
322324 boolFullSet ,
323325 firstValidJulian ,
@@ -340,8 +342,7 @@ def _get_date_time_range(self, pathname, boolFullSet):
340342
341343 def _get_timeseries (self , pathname , startDateTime , endDateTime , trim ):
342344 # get sizes
343- if (DssPath (pathname ).D .lower () != "ts-pattern" ):
344- firstValidJulian , firstSeconds , lastValidJulian , lastSeconds = self ._get_julian_time_range (pathname , 1 )
345+ firstValidJulian , firstSeconds , lastValidJulian , lastSeconds = self ._get_julian_time_range (pathname , 1 )
345346 if startDateTime is None :
346347 _startDateTime = DateConverter .date_time_from_julian_second (firstValidJulian [0 ], firstSeconds [0 ])
347348 firstSeconds , firstJulian = firstSeconds , firstValidJulian
@@ -467,8 +468,17 @@ def _get_timeseries(self, pathname, startDateTime, endDateTime, trim):
467468 timeZoneName = timeZoneName [0 ]
468469 if (timeZoneName ):
469470 new_times = [i .replace (tzinfo = ZoneInfo (timeZoneName )) for i in new_times ]
471+ elif (DssPath (pathname ).D .lower () == "ts-pattern" ):
472+ new_times = []
473+ start_date = _startDateTime - timedelta (seconds = interval_seconds )
474+
470475 location_info = self ._get_location_info (pathname )
471476 ts = ts .create (values = values , times = new_times , quality = quality , units = units , data_type = data_type , start_date = start_date , time_granularity_seconds = time_granularity_seconds , julian_base_date = julian_base_date , time_zone_name = timeZoneName , path = pathname , location_info = location_info )
477+
478+ if (DssPath (pathname ).D .lower () == "ts-pattern" ):
479+ new_interval = ts ._get_interval_path ()
480+ ts ._interval_to_times (new_interval )
481+
472482 return ts
473483
474484 def _get_location_info (self , pathname : str ):
@@ -564,6 +574,8 @@ def put(self, container) -> int:
564574 self ._catalog = None
565575 elif type (container ) is IrregularTimeSeries :
566576 its = container
577+ if (DssPath (its .id ).D .lower () == "ts-pattern" ):
578+ raise ValueError ("ts-pattern is not fully supported for irregular time series" )
567579 # def hec_dss_tsStoreRegular(dss, pathname, startDate, startTime, valueArray, qualityArray,
568580 # saveAsFloat, units, type):
569581 start_date_base = (datetime (1900 , 1 , 1 )+ timedelta (days = its .julian_base_date ))
0 commit comments