pingwizard 1.0.0__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.
pingwizard/__init__.py ADDED
@@ -0,0 +1 @@
1
+ from .version import __version__
pingwizard/__main__.py ADDED
@@ -0,0 +1,22 @@
1
+
2
+ import os, sys
3
+
4
+ # Add 'pingwizard' to the path, may not need after pypi package...
5
+ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
6
+ PACKAGE_DIR = os.path.dirname(SCRIPT_DIR)
7
+ sys.path.append(PACKAGE_DIR)
8
+
9
+ def main():
10
+
11
+ # Launch the wizard
12
+ from pingwizard.gui_wizard import wizard
13
+ wizard()
14
+
15
+ if __name__ == "__main__":
16
+
17
+ if len(sys.argv) == 1:
18
+ main()
19
+
20
+ elif sys.argv[1] == "shortcut":
21
+ from pingwizard.create_shortcut import create_shortcut
22
+ create_shortcut()
@@ -0,0 +1,79 @@
1
+
2
+ import os, sys
3
+ import platform
4
+ import subprocess
5
+
6
+ from pathlib import Path
7
+ home_path = os.path.join(Path.home())
8
+
9
+ def windows_shortcut(conda_base: str, conda_env: str, f: str):
10
+
11
+ to_write = "set conda_base={}\n".format(conda_base)+\
12
+ """set conda_env="{}"\n""".format(conda_env)+\
13
+ "\n"+\
14
+ '''call %conda_base%\\Scripts\\activate %conda_env%\n\n'''+\
15
+ "call conda env list\n\n"+\
16
+ "echo Launching PINGWizard\n"+\
17
+ "python -m pingwizard\n"+\
18
+ "pause"
19
+
20
+ print('\n\n', to_write)
21
+
22
+ with open(f, 'w') as f:
23
+ f.write(to_write)
24
+
25
+ return
26
+
27
+ def linux_shortcut(conda_base: str, conda_env: str, f: str):
28
+
29
+ to_write = "#!/bin/bash\n"+\
30
+ """conda_base="{}"\n""".format(conda_base)+\
31
+ """conda_env="{}"\n""".format(conda_env)+\
32
+ "\n"+\
33
+ '''source $conda_base/bin/activate $conda_env\n'''+\
34
+ "\n"+\
35
+ "echo Launching PINGWizard\n"+\
36
+ "python -m pingwizard\n"
37
+
38
+ print('\n\n', to_write)
39
+
40
+ with open(f, 'w') as file:
41
+ file.write(to_write)
42
+
43
+ # Make executable
44
+ subprocess.run('''chmod u+x "{}"'''.format(f), shell=True)
45
+
46
+ # Print instructions
47
+ print('\n\nLaunch PINGWizard from the console by passing')
48
+ print(f)
49
+ print('OR')
50
+ print('./PINGWizard.sh')
51
+ print('after navigating console to Desktop.\n\n')
52
+
53
+ pass
54
+
55
+ def create_shortcut():
56
+
57
+ # Get ping Environment Path
58
+ conda_env = os.environ['CONDA_PREFIX']
59
+
60
+ # Get Conda base path from ping environment path
61
+ conda_base = conda_env.split('envs')[0]
62
+
63
+ # Reset conda_env
64
+ conda_env = 'ping'
65
+
66
+ # Make the file
67
+ if "Windows" in platform.system():
68
+ # Set file_path
69
+ file_path = os.path.join(home_path, "Desktop", "PINGWizard.bat")
70
+ windows_shortcut(conda_base=conda_base, conda_env=conda_env, f=file_path)
71
+
72
+ else:
73
+ # Set file_path
74
+ file_path = os.path.join(home_path, "Desktop", "PINGWizard.sh")
75
+ linux_shortcut(conda_base=conda_base, conda_env=conda_env, f=file_path)
76
+
77
+
78
+ if __name__ == "__main__":
79
+ create_shortcut()
@@ -0,0 +1,133 @@
1
+
2
+ import sys, os
3
+ import runpy
4
+
5
+ PySimpleGUI_License = 'e3yAJ9MVaOWANplCbmndNNl2VwHvlCwpZTSjIl6DIjkiRGpYc53aRty8aBWpJF1qdwGLlzv9bUiHILs3Inkyxpp5Yq2OVku8cg2ZVrJ7RNCQI66bMcTLcnyKMbTRMK57OCTPMGxGNtS8whirTBGTlLjxZEWg5DzWZdUXRUlLcDGfxnv7eiWB1jlOb6nqR8WTZ2XsJVzbabW19ouWI6j0oXiKN0Si4AwtI7iFw8iGTBmtFftjZEUxZMpYcLncNk0rIJj4oyisQq2uFCtqZnXWJvvqbEiCICsSIbkC5jhKbvWTVqM2YtX6Ni0XIJjloji1QEmU9Ak5ayWp5nlnIwi3wiiOQK279ytqcKGwFGuvepS6IH6iIOiYIGs7I4kYNQ13cY33RkvIbqWkVyypSKUOQoiZO2ijIFzaMNTEAp0bNxyWI1sLIwkRRjhZdNGBVoJkcZ3MNN1yZMWTQtihOiieIYyXMDDIIF0ILaTyAt36LKTREj5JI1iYwcixRgGuFk0BZGU5VZ4dciGUl3ykZ3XtMbilOMiBIhy1M5DtId1mL6T1A935LYTLEN5iI3iJwoirR8Wa12h5a0WtxkBNZdGiRJyYZXX9N5zZI2jSoZizYpmp9YkHaIWz5YluLTmcNXzNQmGZd0twYGW6l3sALZmTNWvubcSEItsPITk6lFQgQUWZRrkfcEmAVxz0c9y7IG6sILjZEYyzO8Cf4c0WLDj3QCwSLwjPEt2BMMi0J69p854e39898f71ea82d3a530f7a6ed8a02a4eea9ffd2c7b1279074b491c71b411f392e6d726a2d2f9dbf63388356cf4e083e358fe428852d676073e128607b9ad194c15e34a4feb463a749fd3295606caa293b823d102e854cd845b79b5ec5eaec0b2ef7f9cf0c87b2dfcad3f14cd0d66a2da97e6b38a535eb8707b4486c9802a4bfeb09703382e157449096f0e3551af9f444197cacb3f3d42187cea97ab61978985ddeecd086b9cb86c4ec1c08082d47b3ed0ae9c044d9aa65e5c9bf6e00238f78ed858cfdaf0021fb95d636e0cce84d84d2c2da7ac57f2e54fe793fce44a8b8abf96ce7c381f4b7eeb55dc4b68768e8172a4dffc1b683e62a108b2dfc2ef340dab058e6ee5c1f525f93e89d39258862f099987a8ec7022db5aecb5a58e81d02370d5717d18498ae58749aa5e463cf757ab7fa84efe49c1b770da397eef22423696ad433e7232646e279906bef084b21714ac5fc2af564a03ebc789123aed44531765b3e72c6165131feab68e35e0276a64760ee9abf043bece1e3cd148bcec97ab835395391387ff9d2b74a835a15ea5bac9c7e1218c217481a3999a91e037a138aaf5dddadb2247141242140b130e273aab5e1e6855fae8b7ee80d64be2d09a46f3d49555f53a7a849138fc3b9d2323658ea7e86a0039c40f3c15fd3647f99ec98232d9734a5933177c48c6575a1415e2808640cfb27773e728fe128b99757'
6
+ import PySimpleGUI as sg
7
+
8
+ # Script directory
9
+ # Add 'pingmapper' to the path, may not need after pypi package...
10
+ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
11
+ PACKAGE_DIR = os.path.dirname(SCRIPT_DIR)
12
+
13
+ # Logo's
14
+ env_dir = os.environ['CONDA_PREFIX']
15
+ pingmapper_logo_name = "PINGMapper_Logo_small.png"
16
+ pingmapper_logo = os.path.join(env_dir, 'pingmapper_config', pingmapper_logo_name)
17
+ if not os.path.isfile(pingmapper_logo):
18
+ pingmapper_logo = os.path.join(SCRIPT_DIR, "assets", pingmapper_logo_name)
19
+
20
+ def wizard():
21
+
22
+ print("Welcome to the PING Wizard!")
23
+
24
+ # Save the original sys.argv
25
+ original_argv = sys.argv
26
+
27
+ ##########################
28
+ # Define the layout blocks
29
+
30
+ # Title #
31
+ title = sg.Text("PING Wizard", font=("Helvetica", 20), justification="center", size=(30, 1))
32
+
33
+ # PINGMapper #
34
+ ## Title
35
+ pm_title = sg.Text("PINGMapper", font=("Helvetica", 16), justification="center")
36
+
37
+ ## Description
38
+ pm_desc = sg.Text("PINGMapper - Open-source interface for processing recreation-grade side scan sonar datasets and reproducibly mapping benthic habitat.", font=("Helvetica", 10), justification="left", size=(30, 5))
39
+
40
+ ## Logo
41
+ pm_logo = sg.Image(pingmapper_logo, size=(200, 120))
42
+
43
+ ## Launch GUI Buttons
44
+ pm_gui_text = sg.Text("Process\nSonar Log", font=("Helvetica", 10, "bold"), size=(11, 2))
45
+ pm_gui_btn = sg.Button("Single Log", key="launch_pingmapper_gui", button_color="green", size=(10, 2))
46
+ pm_batch_gui_btn = sg.Button("Batch\nSonar Logs", key="launch_pingmapper_batch_gui", button_color="darkgreen", size=(10, 2))
47
+
48
+ ## Test Buttons
49
+ pm_test_text = sg.Text("Test\nPINGMapper", font=("Helvetica", 10, "bold"),size=(11, 2))
50
+ pm_test_single_btn = sg.Button("Small\nDataset", key="test", button_color="navy", size=(10, 2))
51
+ pm_test_batch_btn = sg.Button("Large\nDataset", key="test_large", size=(10, 2))
52
+
53
+ ## Update Installation Buttons
54
+ pm_install_text = sg.Text("Update\nPINGMapper", font=("Helvetica", 10, "bold"),size=(11, 2))
55
+ pm_install_btn = sg.Button("Update", key="pinginstaller", button_color="darkorange", size=(10, 2))
56
+
57
+
58
+ #############
59
+ # Exit Button
60
+ exit_btn = sg.Button("Quit", key="exit_pingwizard", font=("Helvetica", 12, "bold"), button_color="darkred", size=(10, 1))
61
+
62
+ layout = [
63
+ [title],
64
+ [sg.HorizontalSeparator()],
65
+ [sg.HorizontalSeparator()],
66
+ [pm_logo, pm_desc],
67
+ # [pm_title],
68
+ # [pm_desc],
69
+ [pm_gui_text, sg.VerticalSeparator(), pm_gui_btn, pm_batch_gui_btn],
70
+ [pm_test_text, sg.VerticalSeparator(), pm_test_single_btn, pm_test_batch_btn],
71
+ [pm_install_text, sg.VerticalSeparator(), pm_install_btn],
72
+ [sg.HorizontalSeparator()],
73
+ [sg.HorizontalSeparator()],
74
+ [exit_btn],
75
+ ]
76
+
77
+
78
+ layout2 =[[sg.Column(layout, scrollable=True, vertical_scroll_only=True, size_subsample_height=1)]]
79
+ window = sg.Window('PING Wizard', layout2, resizable=True)
80
+
81
+
82
+ #################
83
+ # Open the wizard
84
+ while True:
85
+ event, values = window.read()
86
+ if event == "exit_pingwizard" or event == "Submit":
87
+ break
88
+
89
+
90
+ # Launch PINGMapper GUI
91
+ if event == "launch_pingmapper_gui":
92
+ print("Launching PINGMapper GUI...")
93
+ # Set the arguments for the PINGMapper GUI
94
+ module_name = "pingmapper"
95
+ module_args = ["gui"]
96
+
97
+ elif event == "launch_pingmapper_batch_gui":
98
+ print("Launching PINGMapper Batch GUI...")
99
+ # Set the arguments for the PINGMapper Batch GUI
100
+ module_name = "pingmapper"
101
+ module_args = ["gui_batch"]
102
+
103
+ elif event == "test":
104
+ print("Testing PINGMapper...")
105
+ # Set the arguments for the PINGMapper GUI
106
+ module_name = "pingmapper"
107
+ module_args = ["test"]
108
+
109
+ elif event == "test_large":
110
+ print("Testing PINGMapper Batch...")
111
+ # Set the arguments for the PINGMapper Batch GUI
112
+ module_name = "pingmapper"
113
+ module_args = ["test_large"]
114
+
115
+ elif event == "pinginstaller":
116
+ print("Updating PINGMapper...")
117
+ # Set the arguments for the PINGMapper Batch GUI
118
+ module_name = "pinginstaller"
119
+ module_args = []
120
+
121
+ sys.argv = [module_name, *module_args]
122
+
123
+ runpy.run_module(module_name, run_name="__main__")
124
+
125
+ # window.close()
126
+
127
+ if event == "Quit":
128
+ window.close()
129
+ sys.exit()
130
+
131
+ if __name__ == "__main__":
132
+
133
+ wizard()
pingwizard/version.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = '1.0.0'
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Cameron Bodine
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.1
2
+ Name: pingwizard
3
+ Version: 1.0.0
4
+ Summary: Light-weight interface for running PING ecosystem (PINGMapper, etc.)
5
+ Author: Cameron Bodine
6
+ Author-email: bodine.cs@gmail.email
7
+ Project-URL: Issues, https://github.com/CameronBodine/PINGWizard/issues
8
+ Project-URL: GitHub, https://github.com/CameronBodine/PINGWizard
9
+ Project-URL: Homepage, https://cameronbodine.github.io/PINGMapper/
10
+ Keywords: pingmapper,sonar,ecology,remotesensing,sidescan,sidescan-sonar,aquatic,humminbird,lowrance,gis,oceanography,limnology
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Topic :: Scientific/Engineering
16
+ Classifier: Topic :: Scientific/Engineering :: Visualization
17
+ Classifier: Topic :: Scientific/Engineering :: Oceanography
18
+ Classifier: Topic :: Scientific/Engineering :: GIS
19
+ Classifier: Topic :: Scientific/Engineering :: Hydrology
20
+ Requires-Python: <3.13
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+
24
+ # PINGWizard
25
+ Light-weight interface for running PING ecosystem (PINGMapper, etc.)
26
+
27
+ [![PyPI - Version](https://img.shields.io/pypi/v/pingwizard?style=flat-square&label=Latest%20Version%20(PyPi))](https://pypi.org/project/pingwizard/)
@@ -0,0 +1,11 @@
1
+ pingwizard/__init__.py,sha256=8zLGg-DfQhnDl2Ky0n-zXpN-8e-g7iR0AcaI4l4Vvpk,32
2
+ pingwizard/__main__.py,sha256=XjuCkOJ7Ue1SB9sjObEnmaq8kXwHg4qFrujHAhusqtM,524
3
+ pingwizard/create_shortcut.py,sha256=wvyN875FpEqGZkjO8lRcL1mZarSTu_z9WDSt-Yi1blw,2266
4
+ pingwizard/gui_wizard.py,sha256=xRKZAQdxUmlvrEevWHBA7Rdb_epEilPPnSbDwD8blYQ,6490
5
+ pingwizard/version.py,sha256=dHuoY6voK7np1A7oRzw1xyBy7CK9_KBAc4FCKW29uRQ,21
6
+ pingwizard-1.0.0.data/data/pingmapper_config/PINGMapper_Logo_small.png,sha256=gmoOoDrsMkV7LLhW_1jOZ1NQ0I9nbJIdadiY1KErZwM,11692
7
+ pingwizard-1.0.0.dist-info/LICENSE,sha256=e1msmChkqLNv3MljTU25M3MRnJp8HWLl4zUjI0IrvAg,1092
8
+ pingwizard-1.0.0.dist-info/METADATA,sha256=YUiQOhOCOtmL8gizcdV5WTMXOtVNScndHUqfMAuY7XI,1332
9
+ pingwizard-1.0.0.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
10
+ pingwizard-1.0.0.dist-info/top_level.txt,sha256=xuh7tnCLM7SQVrtQYfgO6Wc7gRtpQd7ldE5JhUr8sYc,11
11
+ pingwizard-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.7.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ pingwizard