pingmapper 5.4.5__tar.gz → 5.4.6__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 (59) hide show
  1. {pingmapper-5.4.5 → pingmapper-5.4.6}/PKG-INFO +15 -1
  2. {pingmapper-5.4.5 → pingmapper-5.4.6}/README.md +14 -0
  3. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/__main__.py +8 -1
  4. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/class_rectObj.py +4 -16
  5. pingmapper-5.4.6/pingmapper/self_check.py +62 -0
  6. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/test_PINGMapper.py +16 -16
  7. pingmapper-5.4.6/pingmapper/version.py +1 -0
  8. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper.egg-info/PKG-INFO +15 -1
  9. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper.egg-info/SOURCES.txt +1 -0
  10. {pingmapper-5.4.5 → pingmapper-5.4.6}/pyproject.toml +2 -0
  11. pingmapper-5.4.5/pingmapper/version.py +0 -1
  12. {pingmapper-5.4.5 → pingmapper-5.4.6}/LICENSE +0 -0
  13. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/__init__.py +0 -0
  14. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/class_mapSubstrateObj.py +0 -0
  15. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/class_portstarObj.py +0 -0
  16. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/class_sonObj.py +0 -0
  17. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/class_sonObj_nadirgaptest.py +0 -0
  18. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/default_params.json +0 -0
  19. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/doWork.py +0 -0
  20. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/funcs_common.py +0 -0
  21. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/funcs_model.py +0 -0
  22. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/funcs_rectify.py +0 -0
  23. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/gui_main.py +0 -0
  24. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/main_mapSubstrate.py +0 -0
  25. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/main_readFiles.py +0 -0
  26. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/main_rectify.py +0 -0
  27. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/nonGUI_batch_main.py +0 -0
  28. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/nonGui_main.py +0 -0
  29. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/processing_scripts/main_batchDirectory_2024-01-18_0926.py +0 -0
  30. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/processing_scripts/main_batchDirectory_2024-01-18_0929.py +0 -0
  31. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/scratch/funcs_pyhum_correct.py +0 -0
  32. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/scratch/main.py +0 -0
  33. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/scratch/main_batchDirectory.py +0 -0
  34. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/test_dq_filter.py +0 -0
  35. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/test_time.py +0 -0
  36. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/DRAFT_Workflows/avg_predictions_Mussel_WBL.py +0 -0
  37. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/DRAFT_Workflows/gen_centerline.py +0 -0
  38. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/DRAFT_Workflows/gen_centerline_from_bankline.py +0 -0
  39. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/DRAFT_Workflows/gen_centerline_trkpnts_fitspline_DRAFT.py +0 -0
  40. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/DRAFT_Workflows/testEXAMPLE_mosaic_logit.py +0 -0
  41. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/RawEGN_avg_predictions.py +0 -0
  42. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/Substrate_Summaries/00_substrate_logits_mosaic_transects.py +0 -0
  43. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/Substrate_Summaries/00_substrate_shps_mosaic_transects.py +0 -0
  44. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/Substrate_Summaries/01_gen_centerline_from_coverage.py +0 -0
  45. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/Substrate_Summaries/02_gen_summary_stamp_shps.py +0 -0
  46. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/Substrate_Summaries/03_gen_summary_shp.py +0 -0
  47. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/Substrate_Summaries/04_combine_summary_shp_csv.py +0 -0
  48. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/Substrate_Summaries/05_gen_summary_shp_plots.py +0 -0
  49. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/Substrate_Summaries/06_compare_raw-egn_volume.py +0 -0
  50. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/Substrate_Summaries/08_raw-egn_hardReacheFreq_hist.py +0 -0
  51. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/Substrate_Summaries/09_raw-egn_PatchSize_density.py +0 -0
  52. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/Substrate_Summaries/summarize_project_substrate.py +0 -0
  53. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/export_coverage.py +0 -0
  54. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper/utils/main_mosaic_transects.py +0 -0
  55. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper.egg-info/dependency_links.txt +0 -0
  56. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper.egg-info/requires.txt +0 -0
  57. {pingmapper-5.4.5 → pingmapper-5.4.6}/pingmapper.egg-info/top_level.txt +0 -0
  58. {pingmapper-5.4.5 → pingmapper-5.4.6}/setup.cfg +0 -0
  59. {pingmapper-5.4.5 → pingmapper-5.4.6}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pingmapper
3
- Version: 5.4.5
3
+ Version: 5.4.6
4
4
  Summary: Open-source interface for processing recreation-grade side scan sonar datasets and reproducibly mapping benthic habitat
5
5
  Author: Cameron Bodine, Daniel Buscombe, Iury T Simoes-Sousa
6
6
  Author-email: bodine.cs@gmail.email
@@ -168,6 +168,20 @@ python -m pingmapper gui
168
168
  pixi run -e full gui # GUI with ML support
169
169
  ```
170
170
 
171
+ ### Verify Installation
172
+
173
+ Run a lightweight self-check (same check used in CI):
174
+
175
+ ```bash
176
+ python -m pingmapper check
177
+ ```
178
+
179
+ Optional longer end-to-end processing validation:
180
+
181
+ ```bash
182
+ python -m pingmapper test
183
+ ```
184
+
171
185
  ## Ready to get started?
172
186
 
173
187
  Follow the installation and testing instructions to [Get Started!](https://cameronbodine.github.io/PINGMapper/docs/gettingstarted)
@@ -130,6 +130,20 @@ python -m pingmapper gui
130
130
  pixi run -e full gui # GUI with ML support
131
131
  ```
132
132
 
133
+ ### Verify Installation
134
+
135
+ Run a lightweight self-check (same check used in CI):
136
+
137
+ ```bash
138
+ python -m pingmapper check
139
+ ```
140
+
141
+ Optional longer end-to-end processing validation:
142
+
143
+ ```bash
144
+ python -m pingmapper test
145
+ ```
146
+
133
147
  ## Ready to get started?
134
148
 
135
149
  Follow the installation and testing instructions to [Get Started!](https://cameronbodine.github.io/PINGMapper/docs/gettingstarted)
@@ -49,5 +49,12 @@ def main(process):
49
49
  from pingmapper.test_PINGMapper import test
50
50
  test(2)
51
51
 
52
+ elif process in ('check', 'test_unit'):
53
+ print('\n\nRunning PINGMapper self-check...\n\n')
54
+ from pingmapper.self_check import run_self_check
55
+ return run_self_check(verbose=True)
56
+
57
+ return 0
58
+
52
59
  if __name__ == "__main__":
53
- main(to_do)
60
+ sys.exit(main(to_do))
@@ -327,10 +327,7 @@ class rectObj(sonObj):
327
327
  if self.egn_stretch > 0:
328
328
  self._egnDoStretch()
329
329
 
330
- img = self._reserve_zero_for_nodata(
331
- self.sonDat,
332
- preserve_zeros=(not bool(getattr(self, 'son8bit', False))),
333
- )
330
+ img = self._reserve_zero_for_nodata(self.sonDat, preserve_zeros=True)
334
331
  img = self._prepare_export_uint16(img)
335
332
  vals = img[img > 0]
336
333
  if vals.size == 0:
@@ -1864,10 +1861,7 @@ class rectObj(sonObj):
1864
1861
  col = df[xPix].to_numpy().astype(int)
1865
1862
  data = df[sonCol].to_numpy()
1866
1863
  if son:
1867
- data = self._reserve_zero_for_nodata(
1868
- data,
1869
- preserve_zeros=(not bool(getattr(self, 'son8bit', False))),
1870
- )
1864
+ data = self._reserve_zero_for_nodata(data, preserve_zeros=True)
1871
1865
  apply_post_rect_colormap = use_16bit and self._rect_colormap_selected(son=son)
1872
1866
  source_scale_bounds = None
1873
1867
  if apply_post_rect_colormap:
@@ -2727,10 +2721,7 @@ class rectObj(sonObj):
2727
2721
 
2728
2722
  img = self.sonDat.copy()
2729
2723
  if son:
2730
- img = self._reserve_zero_for_nodata(
2731
- img,
2732
- preserve_zeros=(not bool(getattr(self, 'son8bit', False))),
2733
- )
2724
+ img = self._reserve_zero_for_nodata(img, preserve_zeros=True)
2734
2725
  apply_post_rect_colormap = use_16bit and self._rect_colormap_selected(son=son)
2735
2726
  source_scale_bounds = None
2736
2727
  if apply_post_rect_colormap:
@@ -2821,10 +2812,7 @@ class rectObj(sonObj):
2821
2812
 
2822
2813
  img = self.sonDat
2823
2814
  if son:
2824
- img = self._reserve_zero_for_nodata(
2825
- img,
2826
- preserve_zeros=(not bool(getattr(self, 'son8bit', False))),
2827
- )
2815
+ img = self._reserve_zero_for_nodata(img, preserve_zeros=True)
2828
2816
  apply_post_rect_colormap = son and use_16bit and self._rect_colormap_selected(son=son)
2829
2817
  source_scale_bounds = None
2830
2818
  if apply_post_rect_colormap:
@@ -0,0 +1,62 @@
1
+ """Lightweight install/runtime checks for CI and end-user validation."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import importlib
6
+ import sys
7
+ import unittest
8
+
9
+
10
+ REQUIRED_MODULES = [
11
+ "osgeo",
12
+ "numpy",
13
+ "pandas",
14
+ "geopandas",
15
+ "rasterio",
16
+ "pyproj",
17
+ "cv2",
18
+ "pinginstaller",
19
+ "pingwizard",
20
+ "pingverter",
21
+ ]
22
+
23
+
24
+ def _missing_required_modules() -> list[str]:
25
+ """Return required modules that fail to import."""
26
+ missing = []
27
+ for mod_name in REQUIRED_MODULES:
28
+ try:
29
+ importlib.import_module(mod_name)
30
+ except Exception:
31
+ missing.append(mod_name)
32
+ return missing
33
+
34
+
35
+ def run_self_check(verbose: bool = True) -> int:
36
+ """Run dependency checks and unit tests. Returns process exit code."""
37
+ print("\nPINGMapper self-check\n")
38
+
39
+ missing = _missing_required_modules()
40
+ if missing:
41
+ print("Missing required modules:")
42
+ for name in missing:
43
+ print(f" - {name}")
44
+ print("\nSelf-check failed: install appears incomplete.")
45
+ return 1
46
+
47
+ print("Dependency import checks passed.")
48
+
49
+ suite = unittest.defaultTestLoader.loadTestsFromName("pingmapper.test_dq_filter")
50
+ runner = unittest.TextTestRunner(verbosity=2 if verbose else 1)
51
+ result = runner.run(suite)
52
+
53
+ if not result.wasSuccessful():
54
+ print("\nSelf-check failed: unit tests did not pass.")
55
+ return 1
56
+
57
+ print("\nSelf-check passed.")
58
+ return 0
59
+
60
+
61
+ if __name__ == "__main__":
62
+ sys.exit(run_self_check())
@@ -72,7 +72,7 @@ def test(ds):
72
72
  # ds = int(sys.argv[1])
73
73
  # else:
74
74
  # print("\n\nERROR: \nPlease enter argument to choose which test file to process:")
75
- # print("1 = Short recording \n2 = Long recording \n\nSYNTAX: python test_PINGMapper.py <1 or 2>\n\n")
75
+ # print("1 = Short recording \n2 = Long recording \n\nSYNTAX: python -m pingmapper test <1 or 2>\n\n")
76
76
  # sys.exit()
77
77
 
78
78
  #################
@@ -87,15 +87,15 @@ def test(ds):
87
87
  download_name = 'sample_recording'
88
88
  else:
89
89
  print("\n\nERROR: \nPlease enter argument to choose which test file to process:")
90
- print("1 = Short recording \n2 = Long recording \n\nSYNTAX: python test_PINGMapper.py <1 or 2>\n\n")
90
+ print("1 = Short recording \n2 = Long recording \n\nSYNTAX: python -m pingmapper test <1 or 2>\n\n")
91
91
  sys.exit()
92
92
 
93
- repo_root = PACKAGE_DIR
94
- d = os.environ.get(
95
- 'PINGMAPPER_DATA_DIR',
96
- os.path.join(repo_root, '.data'),
97
- )
98
- exampleDir = os.path.join(d, 'example_data')
93
+ repo_root = PACKAGE_DIR
94
+ d = os.environ.get(
95
+ 'PINGMAPPER_DATA_DIR',
96
+ os.path.join(repo_root, '.data'),
97
+ )
98
+ exampleDir = os.path.join(d, 'example_data')
99
99
  ds_path = os.path.join(exampleDir, ds_name)
100
100
  ds_path = os.path.normpath(ds_path)
101
101
 
@@ -122,12 +122,12 @@ def test(ds):
122
122
  # Path to data/output
123
123
  inFile = ds_path+'.DAT'
124
124
  sonPath = ds_path
125
- proj_base_dir = os.environ.get(
126
- 'PINGMAPPER_TEST_OUTPUT_DIR',
127
- os.path.join(d, 'test_runs'),
128
- )
129
-
130
- projDir = os.path.join(proj_base_dir, 'PINGMapper-'+ds_name)
125
+ proj_base_dir = os.environ.get(
126
+ 'PINGMAPPER_TEST_OUTPUT_DIR',
127
+ os.path.join(d, 'test_runs'),
128
+ )
129
+
130
+ projDir = os.path.join(proj_base_dir, 'PINGMapper-'+ds_name)
131
131
 
132
132
  inFile = os.path.abspath(inFile)
133
133
  sonPath = os.path.abspath(sonPath)
@@ -246,7 +246,7 @@ def test(ds):
246
246
  if project_mode == 0:
247
247
  # Create new project
248
248
  if not os.path.exists(projDir):
249
- os.makedirs(projDir, exist_ok=False)
249
+ os.makedirs(projDir, exist_ok=False)
250
250
  else:
251
251
  projectMode_1_inval()
252
252
 
@@ -255,7 +255,7 @@ def test(ds):
255
255
  if os.path.exists(projDir):
256
256
  shutil.rmtree(projDir)
257
257
 
258
- os.makedirs(projDir, exist_ok=False)
258
+ os.makedirs(projDir, exist_ok=False)
259
259
 
260
260
  elif project_mode == 2:
261
261
  # Update project
@@ -0,0 +1 @@
1
+ __version__ = '5.4.6'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pingmapper
3
- Version: 5.4.5
3
+ Version: 5.4.6
4
4
  Summary: Open-source interface for processing recreation-grade side scan sonar datasets and reproducibly mapping benthic habitat
5
5
  Author: Cameron Bodine, Daniel Buscombe, Iury T Simoes-Sousa
6
6
  Author-email: bodine.cs@gmail.email
@@ -168,6 +168,20 @@ python -m pingmapper gui
168
168
  pixi run -e full gui # GUI with ML support
169
169
  ```
170
170
 
171
+ ### Verify Installation
172
+
173
+ Run a lightweight self-check (same check used in CI):
174
+
175
+ ```bash
176
+ python -m pingmapper check
177
+ ```
178
+
179
+ Optional longer end-to-end processing validation:
180
+
181
+ ```bash
182
+ python -m pingmapper test
183
+ ```
184
+
171
185
  ## Ready to get started?
172
186
 
173
187
  Follow the installation and testing instructions to [Get Started!](https://cameronbodine.github.io/PINGMapper/docs/gettingstarted)
@@ -20,6 +20,7 @@ pingmapper/main_readFiles.py
20
20
  pingmapper/main_rectify.py
21
21
  pingmapper/nonGUI_batch_main.py
22
22
  pingmapper/nonGui_main.py
23
+ pingmapper/self_check.py
23
24
  pingmapper/test_PINGMapper.py
24
25
  pingmapper/test_dq_filter.py
25
26
  pingmapper/test_time.py
@@ -105,5 +105,7 @@ full = { features = ["ml"], solve-group = "default" }
105
105
  pingmapper = "python -m pingwizard"
106
106
  gui = "python -m pingmapper gui"
107
107
  gui-batch = "python -m pingmapper gui_batch"
108
+ check = "python -m pingmapper check"
109
+ test-unit = "python -m pingmapper test_unit"
108
110
  test = "python -m pingmapper test"
109
111
  test-large = "python -m pingmapper test_large"
@@ -1 +0,0 @@
1
- __version__ = '5.4.5'
File without changes
File without changes
File without changes