Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = hecdss
version = 0.1.27
version = 0.1.28
author = Hydrologic Engineering Center
author_email [email protected]
description = Python wrapper for the HEC-DSS file database C library.
Expand Down
1 change: 1 addition & 0 deletions src/hecdss/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 1 addition & 1 deletion src/hecdss/download_hecdss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions src/hecdss/hecdss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'")
Expand Down