diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f5f2790 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "D:\\Programs\\Anaconda2\\envs\\dev\\python.exe" +} \ No newline at end of file diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 90f7c9e..e8e585c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 diff --git a/pyhecdss/__init__.py b/pyhecdss/__init__.py index 65c756c..b4f1427 100644 --- a/pyhecdss/__init__.py +++ b/pyhecdss/__init__.py @@ -1,4 +1,4 @@ __author__ = """Nicky Sandhu""" __email__ = 'psandhu@water.ca.gov' -__version__ = "0.2.8" +__version__ = "0.2.9" from .pyhecdss import * diff --git a/pyhecdss/pyhecdss.py b/pyhecdss/pyhecdss.py index e08b7b4..fc1bb2c 100755 --- a/pyhecdss/pyhecdss.py +++ b/pyhecdss/pyhecdss.py @@ -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) diff --git a/tests/test1.dss b/tests/test1.dss index ded906e..fa26bb8 100755 Binary files a/tests/test1.dss and b/tests/test1.dss differ