From 5b54ba321915885877111a8bc1ec139b37e58363 Mon Sep 17 00:00:00 2001 From: Mike Perryman Date: Wed, 15 Oct 2025 16:26:56 -0500 Subject: [PATCH 1/2] Fix for reading text records. --- pyproject.toml | 2 +- setup.cfg | 2 +- src/hecdss/__init__.py | 1 + src/hecdss/hecdss.py | 5 +++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a2401a4..1b196ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hec-dss-python" -version = "0.1.26" +version = "0.1.28" description = "Python wrapper for the HEC-DSS file database C library." authors = ["Hydrologic Engineering Center"] license = "MIT" diff --git a/setup.cfg b/setup.cfg index d63384b..38066a4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = hecdss -version = 0.1.27 +version = 0.1.28 author = Hydrologic Engineering Center author_email =hec.dss@usace.army.mil description = Python wrapper for the HEC-DSS file database C library. diff --git a/src/hecdss/__init__.py b/src/hecdss/__init__.py index 04673ef..65c231e 100644 --- a/src/hecdss/__init__.py +++ b/src/hecdss/__init__.py @@ -6,4 +6,5 @@ from hecdss.regular_timeseries import RegularTimeSeries from hecdss.array_container import ArrayContainer from hecdss.paired_data import PairedData +from hecdss.text import Text diff --git a/src/hecdss/hecdss.py b/src/hecdss/hecdss.py index a3a2d7f..de50b43 100644 --- a/src/hecdss/hecdss.py +++ b/src/hecdss/hecdss.py @@ -138,15 +138,16 @@ def _get_text(self, pathname: str): textLength = 1024 - BUFFER_TOO_SMALL = -1 + BUFFER_TOO_SMALL = -17 textArray = [] status = self._native.hec_dss_textRetrieve(pathname, textArray, textLength) while status == BUFFER_TOO_SMALL: textLength *= 2 - status = self._native.hec_dss_textRetrieve(pathname, textArray, textLength) if textLength > 2*1048576: # 2 MB print(f"Text record too large to read from '{pathname}'") return None + textArray = [] # otherwise we get an entry for each attempt + status = self._native.hec_dss_textRetrieve(pathname, textArray, textLength) if status != 0: print(f"Error reading text from '{pathname}'") From f79f4be4f55a235c619688c7b3caf9b5d6a08cf8 Mon Sep 17 00:00:00 2001 From: Karl Tarbet Date: Thu, 16 Oct 2025 10:02:14 -0700 Subject: [PATCH 2/2] update dss library (#110) --- src/hecdss/download_hecdss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hecdss/download_hecdss.py b/src/hecdss/download_hecdss.py index cc3c388..ad07c1b 100644 --- a/src/hecdss/download_hecdss.py +++ b/src/hecdss/download_hecdss.py @@ -36,7 +36,7 @@ def download_and_unzip(url, zip_file, destination_dir): print(f"Failed to download zip file. Status code: {response.status_code}") base_url = "https://www.hec.usace.army.mil/nexus/repository/maven-public/mil/army/usace/hec/hecdss/" -version = "7-IW-3" +version = "7-IW-4" destination_dir = Path(__file__).parent.joinpath("lib") zip_url = f"{base_url}{version}-win-x86_64/hecdss-{version}-win-x86_64.zip"