PyGeoFetch 2.0.6__py3-none-any.whl → 2.0.7__py3-none-any.whl

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.
pygeofetch/__init__.py CHANGED
@@ -1,5 +1,5 @@
1
1
  """
2
- PyGeoFetch v2.0.6 — Universal Satellite Data Pipeline.
2
+ PyGeoFetch v2.0.7 — Universal Satellite Data Pipeline.
3
3
 
4
4
  Unified access to 22+ satellite data providers with a consistent
5
5
  Python API and CLI. Supports authentication management, federated search,
@@ -30,7 +30,7 @@ CLI::
30
30
  pygeofetch doctor
31
31
  """
32
32
 
33
- __version__ = "2.0.6"
33
+ __version__ = "2.0.7"
34
34
  __author__ = "PyGeoFetch Contributors"
35
35
  __license__ = "MIT"
36
36
 
pygeofetch/cli/main.py CHANGED
@@ -1,5 +1,5 @@
1
1
  """
2
- PyGeoFetch CLI v2.0.6 main entry point.
2
+ PyGeoFetch CLI v2.0.7 main entry point.
3
3
 
4
4
  Full command reference:
5
5
  pygeofetch auth — credential management
@@ -71,7 +71,7 @@ def cli(
71
71
  ) -> None:
72
72
  """
73
73
  \b
74
- PyGeoFetch v2.0.6 — Universal Satellite Data Pipeline
74
+ PyGeoFetch v2.0.7 — Universal Satellite Data Pipeline
75
75
  ===========================================================
76
76
  Unified access to 22+ satellite data providers.
77
77
 
@@ -452,13 +452,14 @@ class PhaseUnwrapper:
452
452
  """
453
453
  Fallback unwrapping using the SNAPHU CLI executable.
454
454
  Bypasses Python C-extension compilation issues on Windows entirely.
455
+ Includes auto-repair for the infamous 0xC0000135 (STATUS_DLL_NOT_FOUND) error.
455
456
  """
456
457
  import numpy as np
457
458
 
458
459
  cli_path = _ensure_snaphu_cli()
459
460
  height, width = igram.shape
460
461
 
461
- with tempfile.TemporaryDirectory() as tmp_dir:
462
+ def _run_snaphu(tmp_dir):
462
463
  tmp = Path(tmp_dir)
463
464
  igram_path = tmp / "igram.cpx"
464
465
  corr_path = tmp / "corr.cor"
@@ -473,29 +474,47 @@ class PhaseUnwrapper:
473
474
  # Write config file using relative paths to avoid Windows space issues
474
475
  nlooks_int = max(1, int(nlooks))
475
476
  conf_text = f"""INFILE igram.cpx
476
- INFILEFORMAT COMPLEX_DATA
477
- CORRFILE corr.cor
478
- CORRFILEFORMAT FLOAT_DATA
479
- OUTFILE unw.unw
480
- OUTFILEFORMAT FLOAT_DATA
481
- CONNCOMPFILE conncomp.cc
482
- CONNCOMPOUTFORMAT UINT_DATA
483
- LINELENGTH {width}
484
- STATCOSTMODE {self._cost_mode.upper()}
485
- INITMETHOD {self._init_method.upper()}
486
- NLOOKSRANGE {nlooks_int}
487
- NLOOKSAZ {nlooks_int}
488
- """
477
+ INFILEFORMAT COMPLEX_DATA
478
+ CORRFILE corr.cor
479
+ CORRFILEFORMAT FLOAT_DATA
480
+ OUTFILE unw.unw
481
+ OUTFILEFORMAT FLOAT_DATA
482
+ CONNCOMPFILE conncomp.cc
483
+ CONNCOMPOUTFORMAT UINT_DATA
484
+ LINELENGTH {width}
485
+ STATCOSTMODE {self._cost_mode.upper()}
486
+ INITMETHOD {self._init_method.upper()}
487
+ NLOOKSRANGE {nlooks_int}
488
+ NLOOKSAZ {nlooks_int}
489
+ """
489
490
  conf_path.write_text(conf_text)
490
491
 
491
492
  # Run SNAPHU from within the temp directory
492
- try:
493
- cmd = [cli_path, "-f", "snaphu.conf"]
494
- result = subprocess.run(cmd, capture_output=True, text=True, cwd=str(tmp), timeout=3600)
495
- if result.returncode != 0:
496
- raise RuntimeError(f"SNAPHU CLI failed with code {result.returncode}: {result.stderr}")
497
- except Exception as e:
498
- raise RuntimeError(f"SNAPHU CLI execution failed: {e}")
493
+ cmd = [cli_path, "-f", "snaphu.conf"]
494
+ result = subprocess.run(cmd, capture_output=True, text=True, cwd=str(tmp), timeout=3600)
495
+ return result, unw_path, cc_path
496
+
497
+ with tempfile.TemporaryDirectory() as tmp_dir:
498
+ result, unw_path, cc_path = _run_snaphu(tmp_dir)
499
+
500
+ # ═══════════════════════════════════════════════════════════════
501
+ # AUTO-REPAIR: Catch Windows STATUS_DLL_NOT_FOUND (0xC0000135)
502
+ # 3221225781 is the unsigned int representation of 0xC0000135
503
+ # -1073741515 is the signed int representation. We check both.
504
+ # ═══════════════════════════════════════════════════════════════
505
+ if result.returncode in (3221225781, -1073741515):
506
+ logger.warning(
507
+ "SNAPHU crashed with STATUS_DLL_NOT_FOUND (0xC0000135). "
508
+ "This means the Microsoft Visual C++ Redistributable is missing."
509
+ )
510
+ self._ensure_msvc_runtime()
511
+
512
+ # Retry after installation
513
+ logger.info("Retrying SNAPHU after MSVC runtime installation...")
514
+ result, unw_path, cc_path = _run_snaphu(tmp_dir)
515
+
516
+ if result.returncode != 0:
517
+ raise RuntimeError(f"SNAPHU CLI failed with code {result.returncode}: {result.stderr}")
499
518
 
500
519
  # Read outputs
501
520
  unw = np.fromfile(str(unw_path), dtype=np.float32).reshape((height, width))
@@ -512,6 +531,49 @@ class PhaseUnwrapper:
512
531
 
513
532
  return unw, conncomp.astype(np.int32)
514
533
 
534
+ def _ensure_msvc_runtime(self):
535
+ """
536
+ Fixes the 0xC0000135 (STATUS_DLL_NOT_FOUND) error by ensuring the
537
+ Microsoft Visual C++ Redistributable is installed.
538
+ """
539
+ import ctypes
540
+
541
+ # Check if vcruntime140.dll is already available in the system PATH
542
+ try:
543
+ ctypes.WinDLL("vcruntime140.dll")
544
+ return # Already installed
545
+ except OSError:
546
+ pass
547
+
548
+ logger.info("Downloading official Microsoft Visual C++ Redistributable...")
549
+ vc_url = "https://aka.ms/vs/17/release/vc_redist.x64.exe"
550
+
551
+ with tempfile.TemporaryDirectory() as tmp_dir:
552
+ installer_path = Path(tmp_dir) / "vc_redist.x64.exe"
553
+ try:
554
+ urllib.request.urlretrieve(vc_url, str(installer_path))
555
+ except Exception as e:
556
+ raise RuntimeError(
557
+ f"Failed to download MSVC installer: {e}\n"
558
+ "Please install manually: https://aka.ms/vs/17/release/vc_redist.x64.exe"
559
+ )
560
+
561
+ logger.info("Installing MSVC runtime (this may prompt for Administrator permission)...")
562
+ try:
563
+ # /quiet = no UI, /norestart = no reboot prompt, /install = install
564
+ result = subprocess.run(
565
+ [str(installer_path), "/install", "/quiet", "/norestart"],
566
+ timeout=120
567
+ )
568
+ # Return code 0 = success, 3010 = success but reboot required
569
+ if result.returncode not in (0, 3010):
570
+ logger.warning(f"Installer returned code {result.returncode}. You may need to install manually.")
571
+ except Exception as e:
572
+ raise RuntimeError(
573
+ f"Failed to run MSVC installer: {e}\n"
574
+ "Please install manually: https://aka.ms/vs/17/release/vc_redist.x64.exe"
575
+ )
576
+
515
577
  def unwrap(
516
578
  self,
517
579
  interferogram: Any,
pygeofetch/meta.yaml CHANGED
@@ -1,4 +1,4 @@
1
- {% set version = "2.0.6" %}
1
+ {% set version = "2.0.7" %}
2
2
 
3
3
  package:
4
4
  name: pygeofetch
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygeofetch
3
- Version: 2.0.6
3
+ Version: 2.0.7
4
4
  Summary: Universal satellite data pipeline + geospatial processing platform
5
5
  Author-email: Samuel Appiah Kubi <appiahkubis14@gmail.com>
6
6
  License: MIT License
@@ -1,11 +1,11 @@
1
- pygeofetch/__init__.py,sha256=3yLt-AAmxfVvNxheH_dkgFpAvvR5gGty792nzcEDrLY,1990
2
- pygeofetch/meta.yaml,sha256=J6CAyHoKfSfopdAL2fti7SG8bmr8R2JEeaiozvB79Uk,1280
1
+ pygeofetch/__init__.py,sha256=es1NnDlUPyd398z_sdJdxLCLOgFjJRiPM8TZtHduffw,1990
2
+ pygeofetch/meta.yaml,sha256=pROZbqnqqxyDmRQkXL1W3CvoiFPDgBow-3BGBAuFmqE,1280
3
3
  pygeofetch/cli/__init__.py,sha256=QZMIIHEgmjGFieucqq9fZ5uephxP9-jdu1s8Q4qqw8o,30
4
4
  pygeofetch/cli/auth_commands.py,sha256=YqbrN_BYcAYCaUIYLpSJ_VIw35tKFUiD9Kc55SWbDWg,7742
5
5
  pygeofetch/cli/config_commands.py,sha256=1Pps0HLCLPODMlM6SFV8ru3IKCDpexSTz8uKIXvIIF8,3918
6
6
  pygeofetch/cli/download_commands.py,sha256=reQ9vmA50mj1zqechjLHAOe_cjBfa1miqfWa8UiIlxU,11741
7
7
  pygeofetch/cli/index_commands.py,sha256=IoLGrsSU-lTcBitFFsg8EtucqSKZtNL-0ODj_I8Twew,10020
8
- pygeofetch/cli/main.py,sha256=Qg2L7eJQSJsz671XKEVuSkNPEHnvbBQ1jvWxeqCONo4,30335
8
+ pygeofetch/cli/main.py,sha256=3omUpxJmaOwR88USqfLTxxL07B14_emhsXPC12P3qDA,30335
9
9
  pygeofetch/cli/pipeline_process_commands.py,sha256=OvuouT35zZlrC-7hWAJRfaY_aUNk4ScK0Fia9WVB_Gw,6904
10
10
  pygeofetch/cli/postprocess_commands.py,sha256=kof_f-kjjvYl5eqPqrcNHSOUM_qVkGdSh6-N4vcx2y4,5825
11
11
  pygeofetch/cli/preprocess_commands.py,sha256=cFp1VR03Q1pmCwiBWYmS5lXF3NOnzVAq3XgrZh3rBdU,8696
@@ -39,7 +39,7 @@ pygeofetch/insar/splitspectrum_diagnostic.py,sha256=_IlfBs__BW7Yz2RwdmWxfrOspe67
39
39
  pygeofetch/insar/stack_selection.py,sha256=ebFwO063cCT9kn3zLPlkYu6fpnfx-SRC90Ch18E7qJk,13157
40
40
  pygeofetch/insar/synthetic.py,sha256=FazdaG_u3GR1qk8022T92W2uxDJPg7OJaUSGY0wR0pw,16248
41
41
  pygeofetch/insar/timeseries.py,sha256=EtLJiPySMaUWwyNxI2GyfBdkqB4W-uvL-_E_T_POHz4,32063
42
- pygeofetch/insar/unwrap.py,sha256=V2dsGULL8SaHwOu5uUNw8nX51v2mxrYQTjHM9O3WFmQ,27846
42
+ pygeofetch/insar/unwrap.py,sha256=zADKrh_7YW6NQ7f7PwJD1WyNdskQWEzyIQf2U2GRnvg,31128
43
43
  pygeofetch/insar/validate.py,sha256=BZaVvaPNllfDzoPwat0vDA4do6H5xh5Ju_g4r5YNogE,10110
44
44
  pygeofetch/insar/visualize.py,sha256=D_KlWkpuOvfjke6ThHcMBkZTRwWn1KdBFNL1TBcy6kI,7543
45
45
  pygeofetch/insar/workflow.py,sha256=8IxGgabdz9fDLoGAVrJRCdw16GP3sSDSoFPXyv1RXcg,11713
@@ -104,9 +104,9 @@ pygeofetch/utils/validators.py,sha256=f-k3mGFP4byjimyDymhPEdsz5I16jZacx1HSnwrARj
104
104
  pygeofetch/viz/__init__.py,sha256=xf2C9IL4n3bv3oxk8RYkogq7nkuNyt18V-urAoXWRQY,449
105
105
  pygeofetch/viz/map.py,sha256=vYO99NvTumCAVXVtXcEzMx_cpmH-FvSVNWl8X0PNSgE,15494
106
106
  pygeofetch/viz/plot.py,sha256=I16rdOWb80gcjYDsDvTMzuyek7QHgUNOQxY2RejBAPs,53675
107
- pygeofetch-2.0.6.dist-info/licenses/LICENSE,sha256=zavMyhODD6NvZTmmKFEtATrngwY4CU_NEtY7lhjxGnI,1075
108
- pygeofetch-2.0.6.dist-info/METADATA,sha256=iC8gufbHrAU2vQvJhceZOlXy7UK3XnpNDTdTnZeMqKI,43254
109
- pygeofetch-2.0.6.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
110
- pygeofetch-2.0.6.dist-info/entry_points.txt,sha256=dHiUXLF5xNJ8vgtXZoUQNleEMQUeDPZiKQOE1tW8SDY,55
111
- pygeofetch-2.0.6.dist-info/top_level.txt,sha256=rOmnZargIfNk99fwVOqt6OJyJvpSTBBAYO5HU37yhHk,11
112
- pygeofetch-2.0.6.dist-info/RECORD,,
107
+ pygeofetch-2.0.7.dist-info/licenses/LICENSE,sha256=zavMyhODD6NvZTmmKFEtATrngwY4CU_NEtY7lhjxGnI,1075
108
+ pygeofetch-2.0.7.dist-info/METADATA,sha256=uBJ7EPhqnv0VdJOGkYEkF4PHNeiQRaA6NCA6iONZRxY,43254
109
+ pygeofetch-2.0.7.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
110
+ pygeofetch-2.0.7.dist-info/entry_points.txt,sha256=dHiUXLF5xNJ8vgtXZoUQNleEMQUeDPZiKQOE1tW8SDY,55
111
+ pygeofetch-2.0.7.dist-info/top_level.txt,sha256=rOmnZargIfNk99fwVOqt6OJyJvpSTBBAYO5HU37yhHk,11
112
+ pygeofetch-2.0.7.dist-info/RECORD,,