@@ -105,7 +105,11 @@ def get(self, pathname: str, startdatetime=None, enddatetime=None, trim=False):
105105 varies: RegularTimeSeries, PairedData, Grid, or Array.
106106 """
107107 if type == RecordType .RegularTimeSeries or type == RecordType .IrregularTimeSeries :
108- new_pathname = DssPath (pathname ).path_without_date ().__str__ ()
108+ new_pathname = pathname
109+ if (DssPath (pathname ).D .lower () != "ts-pattern" ):
110+ 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" )
109113 ts = self ._get_timeseries (new_pathname , startdatetime , enddatetime , trim )
110114 return ts
111115 elif type == RecordType .PairedData :
@@ -315,7 +319,7 @@ def _get_julian_time_range(self, pathname, boolFullSet):
315319 firstSeconds = [0 ]
316320 lastValidJulian = [0 ]
317321 lastSeconds = [0 ]
318- self ._native .hec_dss_tsGetDateTimeRange (
322+ status = self ._native .hec_dss_tsGetDateTimeRange (
319323 pathname ,
320324 boolFullSet ,
321325 firstValidJulian ,
@@ -464,8 +468,17 @@ def _get_timeseries(self, pathname, startDateTime, endDateTime, trim):
464468 timeZoneName = timeZoneName [0 ]
465469 if (timeZoneName ):
466470 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+
467475 location_info = self ._get_location_info (pathname )
468476 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+
469482 return ts
470483
471484 def _get_location_info (self , pathname : str ):
@@ -561,6 +574,8 @@ def put(self, container) -> int:
561574 self ._catalog = None
562575 elif type (container ) is IrregularTimeSeries :
563576 its = container
577+ if (DssPath (its .id ).D .lower () == "ts-pattern" ):
578+ raise ValueError ("ts-pattern is not fully supported for irregular time series" )
564579 # def hec_dss_tsStoreRegular(dss, pathname, startDate, startTime, valueArray, qualityArray,
565580 # saveAsFloat, units, type):
566581 start_date_base = (datetime (1900 , 1 , 1 )+ timedelta (days = its .julian_base_date ))
0 commit comments