Skip to content

Commit

Permalink
Fixed issue with end of timestamp writing to dss files for "PER-*" da…
Browse files Browse the repository at this point in the history
…ta type
  • Loading branch information
dwr-psandhu committed Oct 18, 2019
1 parent 9d0d9f7 commit 7c7b488
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "D:\\Programs\\Anaconda2\\envs\\dev\\python.exe"
}
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
=========
CHANGELOG
=========
0.2.9
-----
Fixed issue with end of timestamp writing to dss files for "PER-*" data type
0.2.8
-----
Recompiled heclib in linux with latest compilers to resolve issue 8
Expand Down
2 changes: 1 addition & 1 deletion pyhecdss/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__author__ = """Nicky Sandhu"""
__email__ = 'psandhu@water.ca.gov'
__version__ = "0.2.8"
__version__ = "0.2.9"
from .pyhecdss import *
4 changes: 2 additions & 2 deletions pyhecdss/pyhecdss.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,12 @@ def write_rts(self, pathname, df, cunits, ctype):
parts[5] = DSSFile.FREQ_EPART_MAP[df.index.freq]
pathname = "/".join(parts)
if isinstance(df.index[0], pd.Period):
sp = df.index[0]+df.index.freq
sp = df.index[0].to_timestamp(how='end')
else:
sp = df.index[0]
istat = pyheclib.hec_zsrtsxd(self.ifltab, pathname,
sp.strftime("%d%b%Y").upper(
), sp.strftime("%H%M"),
), sp.round(freq='T').strftime("%H%M"),
df.iloc[:, 0].values, cunits[:8], ctype[:8])
self._respond_to_istat_state(istat)

Expand Down
Binary file modified tests/test1.dss
Binary file not shown.

0 comments on commit 7c7b488

Please sign in to comment.