viewtif 0.2.2__tar.gz → 0.2.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: viewtif
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Lightweight GeoTIFF, NetCDF, HDF/HDF5, and Esri File Geodatabase (.gdb) viewer with optional shapefile overlay. NetCDF and cartopy support available via pip install viewtif[netcdf].
5
5
  Project-URL: Homepage, https://github.com/nkeikon/tifviewer
6
6
  Project-URL: Source, https://github.com/nkeikon/tifviewer
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "viewtif"
7
- version = "0.2.2"
7
+ version = "0.2.4"
8
8
  description = "Lightweight GeoTIFF, NetCDF, HDF/HDF5, and Esri File Geodatabase (.gdb) viewer with optional shapefile overlay. NetCDF and cartopy support available via pip install viewtif[netcdf]."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -42,7 +42,7 @@ import matplotlib.cm as cm
42
42
  import warnings
43
43
  warnings.filterwarnings("ignore", category=RuntimeWarning, module="shapely")
44
44
 
45
- __version__ = "0.2.2"
45
+ __version__ = "0.2.4"
46
46
 
47
47
  # Optional overlay deps
48
48
  try:
@@ -210,6 +210,9 @@ class TiffViewer(QMainWindow):
210
210
  self.tif_path = self.tif_path or (os.path.commonprefix([red, green, blue]) or red)
211
211
 
212
212
  elif tif_path:
213
+ # --- Warn for large files before loading ---
214
+ warn_if_large(tif_path, scale=self._scale_arg)
215
+
213
216
  # --------------------- Detect NetCDF --------------------- #
214
217
  if tif_path and tif_path.lower().endswith((".nc", ".netcdf")):
215
218
  try:
@@ -377,8 +380,8 @@ class TiffViewer(QMainWindow):
377
380
  print(f"[WARN] Could not inspect FileGDB: {e}")
378
381
  sys.exit(0)
379
382
 
380
- # --- Universal size check before loading ---
381
- warn_if_large(tif_path, scale=self._scale_arg)
383
+ # # --- Universal size check before loading ---
384
+ # warn_if_large(tif_path, scale=self._scale_arg)
382
385
 
383
386
  if False: # Placeholder for previous if condition
384
387
  pass
@@ -765,7 +768,7 @@ class TiffViewer(QMainWindow):
765
768
  # If first pixel row corresponds to southernmost lat → flip to make north at top
766
769
  # We'll assume data[0, :] corresponds to lats[0]
767
770
  if lat_ascending:
768
- print("[DEBUG] Flipping latitude orientation (lat ascending, data starts south)")
771
+ # print("[DEBUG] Flipping latitude orientation (lat ascending, data starts south)")
769
772
  frame = np.flipud(frame)
770
773
  # else:
771
774
  # print("[DEBUG] No flip (lat descending, already north-up)")
@@ -776,7 +779,7 @@ class TiffViewer(QMainWindow):
776
779
  first_col = lats[:, 0]
777
780
  lat_ascending = first_col[0] < first_col[-1]
778
781
  if lat_ascending:
779
- print("[DEBUG] Flipping latitude orientation (2D grid ascending)")
782
+ # print("[DEBUG] Flipping latitude orientation (2D grid ascending)")
780
783
  frame = np.flipud(frame)
781
784
  # else:
782
785
  # print("[DEBUG] No flip (2D grid already north-up)")
@@ -790,7 +793,7 @@ class TiffViewer(QMainWindow):
790
793
  return frame
791
794
 
792
795
  step = int(self._scale_arg)
793
- print(f"[DEBUG] Applying scale factor {step} to current frame")
796
+ print(f"Applying scale factor {step} to current frame")
794
797
 
795
798
  # Downsample the frame
796
799
  frame = frame[::step, ::step]
@@ -1046,12 +1049,12 @@ class TiffViewer(QMainWindow):
1046
1049
 
1047
1050
  # --- Synchronize latitude orientation with normalized data ---
1048
1051
  if np.ndim(lats) == 1 and lats[0] < lats[-1]:
1049
- print("[DEBUG] Lat ascending → flip lats_downsampled to match flipped data")
1052
+ # print("[DEBUG] Lat ascending → flip lats_downsampled to match flipped data")
1050
1053
  lats_downsampled = lats_downsampled[::-1]
1051
1054
  elif np.ndim(lats) == 2:
1052
1055
  first_col = lats[:, 0]
1053
1056
  if first_col[0] < first_col[-1]:
1054
- print("[DEBUG] 2D lat grid ascending → flip lats_downsampled vertically")
1057
+ # print("[DEBUG] 2D lat grid ascending → flip lats_downsampled vertically")
1055
1058
  lats_downsampled = np.flipud(lats_downsampled)
1056
1059
 
1057
1060
  # Convert 0–360 longitude to −180–180 if needed
@@ -1318,7 +1321,7 @@ def run_viewer(
1318
1321
  import click
1319
1322
 
1320
1323
  @click.command()
1321
- @click.version_option("0.2.2", prog_name="viewtif")
1324
+ @click.version_option("0.2.4", prog_name="viewtif")
1322
1325
  @click.argument("tif_path", required=False)
1323
1326
  @click.option("--band", default=1, show_default=True, type=int, help="Band number to display")
1324
1327
  @click.option("--scale", default=1.0, show_default=True, type=int, help="Scale factor for display")
File without changes
File without changes
File without changes