Skip to content

Commit 7c7b488

Browse files
committed
Fixed issue with end of timestamp writing to dss files for "PER-*" data type
1 parent 9d0d9f7 commit 7c7b488

5 files changed

Lines changed: 10 additions & 3 deletions

File tree

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.pythonPath": "D:\\Programs\\Anaconda2\\envs\\dev\\python.exe"
3+
}

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
=========
22
CHANGELOG
33
=========
4+
0.2.9
5+
-----
6+
Fixed issue with end of timestamp writing to dss files for "PER-*" data type
7+
48
0.2.8
59
-----
610
Recompiled heclib in linux with latest compilers to resolve issue 8

pyhecdss/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
__author__ = """Nicky Sandhu"""
22
__email__ = 'psandhu@water.ca.gov'
3-
__version__ = "0.2.8"
3+
__version__ = "0.2.9"
44
from .pyhecdss import *

pyhecdss/pyhecdss.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,12 @@ def write_rts(self, pathname, df, cunits, ctype):
406406
parts[5] = DSSFile.FREQ_EPART_MAP[df.index.freq]
407407
pathname = "/".join(parts)
408408
if isinstance(df.index[0], pd.Period):
409-
sp = df.index[0]+df.index.freq
409+
sp = df.index[0].to_timestamp(how='end')
410410
else:
411411
sp = df.index[0]
412412
istat = pyheclib.hec_zsrtsxd(self.ifltab, pathname,
413413
sp.strftime("%d%b%Y").upper(
414-
), sp.strftime("%H%M"),
414+
), sp.round(freq='T').strftime("%H%M"),
415415
df.iloc[:, 0].values, cunits[:8], ctype[:8])
416416
self._respond_to_istat_state(istat)
417417

tests/test1.dss

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)