transformez 0.4.2__tar.gz → 0.4.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. {transformez-0.4.2 → transformez-0.4.3}/CHANGELOG.md +6 -0
  2. {transformez-0.4.2 → transformez-0.4.3}/CITATION.cff +2 -2
  3. {transformez-0.4.2 → transformez-0.4.3}/PKG-INFO +8 -7
  4. {transformez-0.4.2 → transformez-0.4.3}/README.md +7 -6
  5. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/_version.py +1 -1
  6. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/cli.py +15 -4
  7. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/grid_engine.py +25 -1
  8. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/htdp.py +63 -3
  9. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/transform.py +2 -1
  10. {transformez-0.4.2 → transformez-0.4.3}/AUTHORS.md +0 -0
  11. {transformez-0.4.2 → transformez-0.4.3}/CONTRIBUTING.md +0 -0
  12. {transformez-0.4.2 → transformez-0.4.3}/LICENSE +0 -0
  13. {transformez-0.4.2 → transformez-0.4.3}/pyproject.toml +0 -0
  14. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/__init__.py +0 -0
  15. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/_spatial.py +0 -0
  16. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/api.py +0 -0
  17. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/definitions.py +0 -0
  18. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/hooks.py +0 -0
  19. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/modules.py +0 -0
  20. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/srs.py +0 -0
  21. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/utils.py +0 -0
  22. {transformez-0.4.2 → transformez-0.4.3}/src/transformez/vdatum.py +0 -0
  23. {transformez-0.4.2 → transformez-0.4.3}/tests/test_cli.py +0 -0
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.3] - 2026-05-04
9
+
10
+ ### Added
11
+ - new logo
12
+ - force htdp 3.5.0
13
+
8
14
  ## [0.3.5] - 2026-04-08
9
15
 
10
16
  ### Added
@@ -14,6 +14,6 @@ authors:
14
14
 
15
15
  website: https://transformez.readthedocs.io
16
16
  title: "Transformez"
17
- version: 0.3.6
18
- date-released: 2026-04-08
17
+ version: 0.4.3
18
+ date-released: 2026-06-04
19
19
  url: "https://github.com/continuous-dems/transformez"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: transformez
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: A standalone utility for vertical elevation datum transformations.
5
5
  Project-URL: Homepage, https://github.com/continuous-dems/transformez
6
6
  Project-URL: Issues, https://github.com/continuous-dems/transformez/issues
@@ -47,16 +47,16 @@ Provides-Extra: preview
47
47
  Requires-Dist: matplotlib; extra == 'preview'
48
48
  Description-Content-Type: text/markdown
49
49
 
50
- <!-- <p align="center"> -->
51
- <!-- <a href="https://github.com/continuous-dems"> -->
52
- <!-- <img src="https://github.com/continuous-dems/fetchez/blob/modules/docs/source/_static/continuous_dems_logo.svg" height="80" alt="Continuous DEMs Logo"> -->
53
- <!-- </a> -->
54
- <!-- </p> -->
50
+ <p align="center">
51
+ <a href="https://github.com/continuous-dems">
52
+ <img src="https://raw.githubusercontent.com/continuous-dems/transformez/refs/heads/main/docs/source/_static/continuous_dems_logo_mini_inf.svg" height="80" alt="Continuous DEMs Logo">
53
+ </a>
54
+ </p>
55
55
  <h1 align="center">Transformez</h1>
56
56
  <p align="center"><strong>Global vertical datum transformations, simplified.</strong></p>
57
57
 
58
58
  <p align="center">
59
- <a href="https://github.com/continuous-dems/transformez"><img src="https://img.shields.io/badge/version-0.3.6-blue.svg" alt="Version"></a>
59
+ <a href="https://github.com/continuous-dems/transformez"><img src="https://img.shields.io/badge/version-0.4.3-blue.svg" alt="Version"></a>
60
60
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
61
61
  <a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.12+-yellow.svg" alt="Python"></a>
62
62
  <a href="https://badge.fury.io/py/transformez"><img src="https://badge.fury.io/py/transformez.svg" alt="PyPI version"></a>
@@ -127,4 +127,5 @@ Would you like to know more? Check out our [Official Documentation](https://tran
127
127
  ## ⚖ License
128
128
 
129
129
  This project is licensed under the MIT License - see the [LICENSE](https://github.com/ciresdem/transformez/blob/main/LICENSE) file for details.
130
+
130
131
  Copyright (c) 2010-2026 Regents of the University of Colorado
@@ -1,13 +1,13 @@
1
- <!-- <p align="center"> -->
2
- <!-- <a href="https://github.com/continuous-dems"> -->
3
- <!-- <img src="https://github.com/continuous-dems/fetchez/blob/modules/docs/source/_static/continuous_dems_logo.svg" height="80" alt="Continuous DEMs Logo"> -->
4
- <!-- </a> -->
5
- <!-- </p> -->
1
+ <p align="center">
2
+ <a href="https://github.com/continuous-dems">
3
+ <img src="https://raw.githubusercontent.com/continuous-dems/transformez/refs/heads/main/docs/source/_static/continuous_dems_logo_mini_inf.svg" height="80" alt="Continuous DEMs Logo">
4
+ </a>
5
+ </p>
6
6
  <h1 align="center">Transformez</h1>
7
7
  <p align="center"><strong>Global vertical datum transformations, simplified.</strong></p>
8
8
 
9
9
  <p align="center">
10
- <a href="https://github.com/continuous-dems/transformez"><img src="https://img.shields.io/badge/version-0.3.6-blue.svg" alt="Version"></a>
10
+ <a href="https://github.com/continuous-dems/transformez"><img src="https://img.shields.io/badge/version-0.4.3-blue.svg" alt="Version"></a>
11
11
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
12
12
  <a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.12+-yellow.svg" alt="Python"></a>
13
13
  <a href="https://badge.fury.io/py/transformez"><img src="https://badge.fury.io/py/transformez.svg" alt="PyPI version"></a>
@@ -78,4 +78,5 @@ Would you like to know more? Check out our [Official Documentation](https://tran
78
78
  ## ⚖ License
79
79
 
80
80
  This project is licensed under the MIT License - see the [LICENSE](https://github.com/ciresdem/transformez/blob/main/LICENSE) file for details.
81
+
81
82
  Copyright (c) 2010-2026 Regents of the University of Colorado
@@ -1,4 +1,4 @@
1
1
  # This file is auto-generated by Hatchling. As such, do not:
2
2
  # - modify
3
3
  # - track in version control e.g. be sure to add to .gitignore
4
- __version__ = VERSION = '0.4.2'
4
+ __version__ = VERSION = '0.4.3'
@@ -19,6 +19,12 @@ from fetchez.cli import setup_logging
19
19
 
20
20
  from transformez import api
21
21
 
22
+ TRANSFORMEZ_COMMANDS = {
23
+ "Execution": ["run", "grid", "raster"],
24
+ "Discovery": ["list"],
25
+ "External": ["htdp", "vdatum"],
26
+ }
27
+
22
28
 
23
29
  class TransformezMainGroup(FetchezMainGroup):
24
30
  """A custom Click Group that handles deprecated aliases."""
@@ -68,7 +74,7 @@ class TransformezMainGroup(FetchezMainGroup):
68
74
  @click.group(
69
75
  name="transform",
70
76
  cls=TransformezMainGroup,
71
- fetchez_commands=["run", "grid", "raster", "list", "htdp", "vdatum"],
77
+ fetchez_commands=TRANSFORMEZ_COMMANDS,
72
78
  )
73
79
  @click.version_option(package_name="transformez")
74
80
  @click.option("--verbose", is_flag=True, help="Enable verbose debug logging.")
@@ -395,12 +401,17 @@ def htdp_group():
395
401
 
396
402
 
397
403
  @htdp_group.command("install", cls=FetchezMainCommand)
398
- def install_htdp():
399
- """Downloads and compiles the HTDP executable."""
404
+ @click.option(
405
+ "--version",
406
+ default="3.5.0",
407
+ help="HTDP version to install (e.g., 3.3.0, 3.5.0, 3.6.0)",
408
+ )
409
+ def install_htdp(version):
410
+ """Downloads and compiles the HTDP executable from github."""
400
411
 
401
412
  from transformez.htdp import install_htdp_binary
402
413
 
403
- install_htdp_binary()
414
+ install_htdp_binary(version=version)
404
415
 
405
416
 
406
417
  # --- VDATUM CLI GROUP ---
@@ -22,6 +22,8 @@ from rasterio.transform import from_bounds
22
22
  from scipy import ndimage
23
23
  from scipy.interpolate import Rbf
24
24
 
25
+ os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE"
26
+
25
27
  logger = logging.getLogger(__name__)
26
28
 
27
29
 
@@ -139,6 +141,7 @@ class GridEngine:
139
141
 
140
142
  try:
141
143
  with rasterio.open(fn) as src:
144
+ # logger.info(f"{fn}: {src}")
142
145
  src_data = src.read(1).astype(np.float32)
143
146
  src_nodata = src.nodata
144
147
 
@@ -165,8 +168,29 @@ class GridEngine:
165
168
  valid_mask = ~np.isnan(temp_buffer)
166
169
  mosaic[valid_mask] = temp_buffer[valid_mask]
167
170
 
171
+ # except Exception as e:
172
+ # error_msg = str(e)
173
+
174
+ # if "-101" in error_msg or "HDF error" in error_msg:
175
+ # logger.error(f" CRITICAL: Corrupted NetCDF chunk detected in {fn}!")
176
+
177
+ # # Extract the real file path from the GDAL netcdf string
178
+ # real_path = fn.split(":")[1] if fn.startswith("netcdf:") else fn
179
+
180
+ # if os.path.exists(real_path):
181
+ # logger.warning(f"Auto-deleting corrupted cache file: {real_path}")
182
+ # os.remove(real_path)
183
+
184
+ # raise RuntimeError(
185
+ # f"Transformation aborted to prevent math corruption. "
186
+ # f"The corrupted file has been deleted. Please re-run your command to fetch a fresh copy!"
187
+ # )
188
+
189
+ # # For all other normal errors, log and continue as usual
190
+ # logger.exception(f"Failed to reproject {fn}: {e}")
191
+ # continue
168
192
  except Exception as e:
169
- logger.warning(f"Failed to reproject {fn}: {e}")
193
+ logger.exception(f"Failed to reproject {fn}: {e}")
170
194
  continue
171
195
 
172
196
  # Fill inland areas (decaying to 0) before we clear the remaining NaNs
@@ -16,6 +16,7 @@ import sys
16
16
  import os
17
17
  import subprocess
18
18
  import tempfile
19
+ import shutil
19
20
  import logging
20
21
  import urllib.request
21
22
  import zipfile
@@ -40,11 +41,16 @@ HAS_HTDP = utils.cmd_check(f"htdp{ae}", htdp_cmd)
40
41
  class HTDP:
41
42
  """Wrapper for the NGS HTDP software."""
42
43
 
43
- def __init__(self, htdp_bin: str = "htdp", verbose: bool = True):
44
+ def __init__(
45
+ self, htdp_bin: str = "htdp", version: str = "3.5.0", verbose: bool = True
46
+ ):
44
47
  self.htdp_bin = htdp_bin
48
+ self.version = version
45
49
  self.verbose = verbose
46
50
  if not HAS_HTDP:
47
- logger.error("HTDP is not installed or not in PATH.")
51
+ logger.error(
52
+ f"HTDP {self.version} is not installed or not in PATH. Run 'transformez htdp install --version {self.version}"
53
+ )
48
54
 
49
55
  def run_grid(self, region, nx, ny, epsg_in, epsg_out, epoch_in, epoch_out):
50
56
  """Main entry point called by transform.py.
@@ -244,7 +250,61 @@ def download_htdp(target_dir=None):
244
250
  logger.error(f"Failed to download or extract HTDP source: {e}")
245
251
 
246
252
 
247
- def install_htdp_binary():
253
+ def install_htdp_binary(version="3.5.0"):
254
+ """Downloads and automatically compiles a specific HTDP version from GitHub."""
255
+
256
+ cache_dir = os.path.join(os.getcwd(), "transformez_cache", "bin")
257
+ os.makedirs(cache_dir, exist_ok=True)
258
+
259
+ # Format the GitHub Tag (e.g., "v3.5.0")
260
+ v_tag = f"v{version}" if not version.startswith("v") else version
261
+ clean_version = v_tag.replace("v", "")
262
+
263
+ if sys.platform == "win32":
264
+ logger.info(f"Downloading Windows HTDP executable ({v_tag})...")
265
+ url = f"https://github.com/noaa-ngs/HTDP/releases/download/{v_tag}/htdp.exe"
266
+ exe_path = os.path.join(cache_dir, f"htdp_{clean_version}.exe")
267
+
268
+ try:
269
+ urllib.request.urlretrieve(url, exe_path)
270
+ logger.info(f"HTDP {clean_version} installed successfully to: {exe_path}")
271
+ except Exception as e:
272
+ logger.error(f"Failed to download {v_tag} from GitHub: {e}")
273
+
274
+ else:
275
+ logger.info(f"Downloading Unix HTDP source code ({v_tag})...")
276
+ url = f"https://github.com/noaa-ngs/HTDP/archive/refs/tags/{v_tag}.zip"
277
+ zip_path = os.path.join(cache_dir, f"htdp_{clean_version}.zip")
278
+
279
+ try:
280
+ urllib.request.urlretrieve(url, zip_path)
281
+
282
+ extract_dir = os.path.join(cache_dir, f"htdp_src_{clean_version}")
283
+ with zipfile.ZipFile(zip_path, "r") as z:
284
+ z.extractall(extract_dir)
285
+ os.remove(zip_path)
286
+
287
+ # GitHub extracts to a folder named Repository-Tag (e.g., HTDP-3.5.0)
288
+ source_folder = os.path.join(extract_dir, f"HTDP-{clean_version}")
289
+ fortran_file = os.path.join(source_folder, "htdp.f")
290
+ out_bin = os.path.join(cache_dir, f"htdp_{clean_version}")
291
+
292
+ logger.info(f"Compiling HTDP {clean_version} with gfortran...")
293
+ subprocess.run(
294
+ ["gfortran", "-o", out_bin, fortran_file],
295
+ check=True,
296
+ capture_output=True,
297
+ )
298
+ logger.info(f"HTDP compiled successfully to: {out_bin}")
299
+
300
+ # Clean up the raw source files
301
+ shutil.rmtree(extract_dir)
302
+
303
+ except Exception as e:
304
+ logger.error(f"Failed to install HTDP {clean_version}: {e}")
305
+
306
+
307
+ def _install_htdp_binary():
248
308
  """Downloads and automatically compiles HTDP."""
249
309
 
250
310
  cache_dir = os.path.join(os.getcwd(), "transformez_cache", "bin")
@@ -110,6 +110,7 @@ class VerticalTransform:
110
110
  region=self.region.to_list(),
111
111
  outdir=self.cache_dir,
112
112
  threads=2,
113
+ check_size=True,
113
114
  **kwargs,
114
115
  )
115
116
 
@@ -317,7 +318,7 @@ class VerticalTransform:
317
318
 
318
319
  try:
319
320
  logger.info(f" [HTDP] Frame Shift: EPSG:{epsg_from} -> EPSG:{epsg_to}")
320
- tool = htdp.HTDP(verbose=False)
321
+ tool = htdp.HTDP(version="3.5.0", verbose=False)
321
322
  grid = tool.run_grid(
322
323
  self.region, self.nx, self.ny, epsg_from, epsg_to, epoch_from, epoch_to
323
324
  )
File without changes
File without changes
File without changes
File without changes