Skip to content

Commit

Permalink
changes for abc 2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
giumas committed Jan 28, 2024
1 parent 64a63fa commit 707b8e1
Show file tree
Hide file tree
Showing 21 changed files with 141 additions and 207 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ HydrOffice Sound Speed
:alt: PyPi version
.. image:: https://img.shields.io/badge/docs-latest-brightgreen.svg
:target: https://www.hydroffice.org/manuals/soundspeed/index.html
:target: https://www.hydroffice.org/manuals/ssm2/index.html
:alt: Latest Documentation

.. image:: https://ci.appveyor.com/api/projects/status/6krhsxkcqo0jrvu6?svg=true
Expand Down
61 changes: 27 additions & 34 deletions hyo2/ssm2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

import os
import logging
from hyo2.abc2.lib.lib_info import LibInfo

from hyo2.abc2.lib.package.pkg_info import PkgInfo

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
Expand All @@ -15,35 +14,29 @@
__version__ = '2024.0.0'
__copyright__ = 'Copyright 2024 University of New Hampshire, Center for Coastal and Ocean Mapping'

lib_info = LibInfo()

lib_info.lib_name = name
lib_info.lib_version = __version__
lib_info.lib_author = "Giuseppe Masetti(UNH,JHC-CCOM); Barry Gallagher(NOAA,OCS); " \
"Chen Zhang(NOAA,OCS)"
lib_info.lib_author_email = "gmasetti@ccom.unh.edu; barry.gallagher@noaa.gov; " \
"chen.zhang@noaa.gov"

lib_info.lib_license = "LGPLv2.1 or CCOM-UNH Industrial Associate license"
lib_info.lib_license_url = "https://www.hydroffice.org/license/"

lib_info.lib_path = os.path.abspath(os.path.dirname(__file__))

lib_info.lib_url = "https://www.hydroffice.org/soundspeed/"
lib_info.lib_manual_url = "https://www.hydroffice.org/manuals/ssm2/index.html"
lib_info.lib_support_email = "soundspeed@hydroffice.org"
lib_info.lib_latest_url = "https://www.hydroffice.org/latest/soundspeed.txt"

lib_info.lib_dep_dict = {
"hyo2.abc2": "hyo2.abc2",
"hyo2.ssm2": "hyo2.ssm2",
"hyo2.surveydatamonitor": "hyo2.surveydatamonitor",
"gsw": "gsw",
"netCDF4": "netCDF4",
"gdal": "osgeo",
"numpy": "numpy",
"pyproj": "pyproj",
"matplotlib": "matplotlib",
"cartopy": "cartopy",
"PySide6": "PySide6"
}
pkg_info = PkgInfo(
name=name,
version=__version__,
author="Giuseppe Masetti(UNH,JHC-CCOM); Barry Gallagher(NOAA,OCS); Chen Zhang(NOAA,OCS)",
author_email="gmasetti@ccom.unh.edu; barry.gallagher@noaa.gov; chen.zhang@noaa.gov",
lic="LGPLv2.1 or CCOM-UNH Industrial Associate license",
lic_url="https://www.hydroffice.org/license/",
path=os.path.abspath(os.path.dirname(__file__)),
url="https://www.hydroffice.org/soundspeed/",
manual_url="https://www.hydroffice.org/manuals/ssm2/index.html",
support_email="soundspeed@hydroffice.org",
latest_url="https://www.hydroffice.org/latest/soundspeed.txt",
deps_dict={
"hyo2.abc2": "hyo2.abc2",
"hyo2.ssm2": "hyo2.ssm2",
"hyo2.sdm2": "hyo2.sdm2",
"gsw": "gsw",
"netCDF4": "netCDF4",
"gdal": "osgeo",
"numpy": "numpy",
"pyproj": "pyproj",
"matplotlib": "matplotlib",
"cartopy": "cartopy",
"PySide6": "PySide6"
}
)
48 changes: 12 additions & 36 deletions hyo2/ssm2/app/gui/soundspeedmanager/__init__.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,19 @@
"""
Hydro-Package
Sound Speed Manager
"""
import logging
import os

from hyo2.abc2.app.app_info import AppInfo
from hyo2.ssm2 import pkg_info

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())

name = "Sound Speed Manager"
__version__ = "2024.0.0"
__copyright__ = "Copyright 2024 University of New Hampshire, Center for Coastal and Ocean Mapping"

app_info = AppInfo()

app_info.app_name = name
app_info.app_version = __version__
app_info.app_author = "Giuseppe Masetti(UNH,CCOM); Barry Gallagher(NOAA,OCS); " \
"Chen Zhang(NOAA,OCS)"
app_info.app_author_email = "gmasetti@ccom.unh.edu; barry.gallagher@noaa.gov; " \
"chen.zhang@noaa.gov"

app_info.app_license = "LGPLv2.1 or CCOM-UNH Industrial Associate license"
app_info.app_license_url = "https://www.hydroffice.org/license/"

app_info.app_path = os.path.abspath(os.path.dirname(__file__))

app_info.app_url = "https://www.hydroffice.org/soundspeed/"
app_info.app_manual_url = "https://www.hydroffice.org/manuals/soundspeed/index.html"
app_info.app_support_email = "soundspeedmanager@hydroffice.org"
app_info.app_latest_url = "https://www.hydroffice.org/latest/soundspeedmanager.txt"

app_info.app_media_path = os.path.join(app_info.app_path, "media")
app_info.app_main_window_object_name = "MainWindow"
app_info.app_license_path = os.path.join(app_info.app_media_path, "LICENSE")
app_info.app_icon_path = os.path.join(app_info.app_media_path, "app_icon.png")

# icon size
app_info.app_tabs_icon_size = 36
app_info.app_toolbars_icon_size = 24
app_path = os.path.abspath(os.path.dirname(__file__))
app_media_path = os.path.join(app_path, "media")

app_info = pkg_info.app_info(
app_name="Sound Speed Manager",
app_beta=True,
app_path=app_path,
app_media_path=app_media_path,
app_license_path=os.path.join(app_media_path, "LICENSE"),
app_icon_path=os.path.join(app_media_path, "app_icon.png")
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from PySide6 import QtCore, QtWidgets

from hyo2.abc2.lib.helper import Helper
from hyo2.abc2.lib.package.pkg_helper import PkgHelper
from hyo2.ssm2.app.gui.soundspeedmanager.dialogs.dialog import AbstractDialog
from hyo2.ssm2.app.gui.soundspeedmanager.dialogs.output_folders_dialog import OutputFoldersDialog
from hyo2.ssm2.lib.profile.dicts import Dicts
Expand Down Expand Up @@ -299,7 +299,7 @@ def on_export_profile_btn(self):

for output_folder in output_folders.values():
if output_folder not in opened_folders:
Helper.explore_folder(output_folder)
PkgHelper.explore_folder(output_folder)
opened_folders.append(output_folder)

if all_exported:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging

from hyo2.abc2.lib.helper import Helper
from hyo2.abc2.lib.package.pkg_helper import PkgHelper
from hyo2.ssm2.app.gui.soundspeedmanager.dialogs.dialog import AbstractDialog
from hyo2.ssm2.app.gui.soundspeedmanager.dialogs.output_folders_dialog import OutputFoldersDialog
from hyo2.ssm2.lib.profile.dicts import Dicts
Expand Down Expand Up @@ -259,7 +259,7 @@ def on_export_profile_btn(self):
opened_folders = list()
for output_folder in output_folders.values():
if output_folder not in opened_folders:
Helper.explore_folder(output_folder) # open the output folder
PkgHelper.explore_folder(output_folder) # open the output folder
opened_folders.append(output_folder)
self.progress.end()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from PySide6 import QtCore, QtWidgets

from hyo2.abc2.lib.helper import Helper
from hyo2.ssm2 import lib_info
from hyo2.abc2.lib.package.pkg_helper import PkgHelper
from hyo2.ssm2 import pkg_info
from hyo2.ssm2.app.gui.soundspeedmanager.dialogs.dialog import AbstractDialog

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -100,7 +100,7 @@ def on_click_import(self, btn):
quantum = 100 / (nr_profiles * 2 + 1)
self.progress.start()

self.main_win.change_info_url(Helper(lib_info=lib_info).web_url(suffix="%s" % name))
self.main_win.change_info_url(PkgHelper(pkg_info=pkg_info).web_url(suffix="%s" % name))

for i, selection in enumerate(selections):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from PySide6 import QtCore, QtWidgets

from hyo2.abc2.lib.helper import Helper
from hyo2.ssm2 import lib_info
from hyo2.abc2.lib.package.pkg_helper import PkgHelper
from hyo2.ssm2 import pkg_info
from hyo2.ssm2.app.gui.soundspeedmanager.dialogs.dialog import AbstractDialog
from hyo2.ssm2.app.gui.soundspeedmanager.dialogs.seacat_dialog import SeacatDialog

Expand Down Expand Up @@ -287,7 +287,7 @@ def do_import(self, idx):
settings.setValue("import_folders_%s" % name, os.path.dirname(selection))
logger.debug('user selection: %s' % selection)

self.main_win.change_info_url(Helper(lib_info=lib_info).web_url(suffix="%s" % name))
self.main_win.change_info_url(PkgHelper(pkg_info=pkg_info).web_url(suffix="%s" % name))

self.progress.start()
try:
Expand Down
12 changes: 6 additions & 6 deletions hyo2/ssm2/app/gui/soundspeedmanager/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from PySide6 import QtCore, QtWidgets, QtGui

from hyo2.abc2.app.app_style import AppStyle
from hyo2.abc2.lib.helper import Helper
from hyo2.abc2.app.app_style.app_style import AppStyle
from hyo2.abc2.lib.package.pkg_helper import PkgHelper
from hyo2.abc2.lib.logging import set_logging
from hyo2.ssm2.app.gui.soundspeedmanager import app_info

Expand All @@ -28,15 +28,15 @@ def qt_custom_handler(error_type: QtCore.QtMsgType, error_context: QtCore.QMessa
QtCore.qInstallMessageHandler(qt_custom_handler)


def gui(beta: bool = True):
def gui():
"""Create the application and show the Sound Speed Manager gui"""
from hyo2.ssm2.app.gui.soundspeedmanager.mainwin import MainWin

logger.debug("Init app ...")
app = QtWidgets.QApplication(sys.argv)
AppStyle.apply(app=app)

if Helper.is_script_already_running():
if PkgHelper.is_script_already_running():
txt = "The app is already running!"
logger.warning(txt)
msg_box = QtWidgets.QMessageBox()
Expand All @@ -50,8 +50,8 @@ def gui(beta: bool = True):
sys.exit(app.exit())

logger.debug("Init main win ...")
main_win = MainWin(beta=beta)
sys.excepthook = main_win.exception_hook # install the exception hook
main_win = MainWin()
sys.excepthook = main_win.exception_hook # install the pkg_exception hook
main_win.show()
main_win.do()

Expand Down
Loading

0 comments on commit 707b8e1

Please sign in to comment.