diff --git a/Makefile b/Makefile deleted file mode 100644 index 5f1b500c47e1baabee20379cd300da1e8243fdc0..0000000000000000000000000000000000000000 --- a/Makefile +++ /dev/null @@ -1,89 +0,0 @@ -.PHONY: clean clean-test clean-pyc clean-build docs help -.DEFAULT_GOAL := help - -define BROWSER_PYSCRIPT -import os, webbrowser, sys - -try: - from urllib import pathname2url -except: - from urllib.request import pathname2url - -webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) -endef -export BROWSER_PYSCRIPT - -define PRINT_HELP_PYSCRIPT -import re, sys - -for line in sys.stdin: - match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) - if match: - target, help = match.groups() - print("%-20s %s" % (target, help)) -endef -export PRINT_HELP_PYSCRIPT - -BROWSER := python -c "$$BROWSER_PYSCRIPT" - -help: - @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) - -clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts - -clean-build: ## remove build artifacts - rm -fr build/ - rm -fr dist/ - rm -fr .eggs/ - find . -name '*.egg-info' -exec rm -fr {} + - find . -name '*.egg' -exec rm -f {} + - -clean-pyc: ## remove Python file artifacts - find . -name '*.pyc' -exec rm -f {} + - find . -name '*.pyo' -exec rm -f {} + - find . -name '*~' -exec rm -f {} + - find . -name '__pycache__' -exec rm -fr {} + - -clean-test: ## remove test and coverage artifacts - rm -fr .tox/ - rm -f .coverage - rm -fr htmlcov/ - rm -fr .pytest_cache - -lint: ## check style with flake8 - flake8 nexus tests - -test: ## run tests quickly with the default Python - python setup.py test - - -test-all: ## run tests on every Python version with tox - tox - -coverage: ## check code coverage quickly with the default Python - coverage run --source nexus setup.py test - coverage report -m - coverage html - $(BROWSER) htmlcov/index.html - -docs: ## generate Sphinx HTML documentation, including API docs - rm -f docs/nexus.rst - rm -f docs/modules.rst - sphinx-apidoc -o docs/ nexus - $(MAKE) -C docs clean - $(MAKE) -C docs html - $(BROWSER) docs/_build/html/index.html - -servedocs: docs ## compile the docs watching for changes - watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D . - -release: dist ## package and upload a release - twine upload dist/* - -dist: clean ## builds source and wheel package - python setup.py sdist - python setup.py bdist_wheel - ls -l dist - -install: clean ## install the package to the active Python's site-packages - python setup.py install diff --git a/README.rst b/README.rst index c8685719d8861bfd0d9e457ac8ae2ce8f8787667..3611b0c552733666522979a80cc7245b216016ff 100644 --- a/README.rst +++ b/README.rst @@ -4,26 +4,3 @@ nexus StationXML creation GUI - - -* Free software: GNU General Public License v3 (GPLv3) - -Build ------ -It may be necessary to run this at build or install - -pyrcc5 icons.qrc -o icons_rc.py - - -Features --------- - -* TODO - -Credits -------- - -This package was created with Cookiecutter_ and the `passoft/cookiecutter`_ project template. - -.. _Cookiecutter: https://github.com/audreyr/cookiecutter -.. _`passoft/cookiecutter`: https://git.passcal.nmt.edu/passoft/cookiecutter diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index e75eb654549b124edfa552b2ad751bf975eea441..720281c336e8afc518673525b229bd7f8e1fd5a7 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -1,6 +1,6 @@ package: name: nexus-passoft - version: "2023.4.5.0" + version: "2023.4.6.0" source: path: ../ diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 3f03c3307f6a44ed7eb7e8fef23e19eaa65844dd..0000000000000000000000000000000000000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = python -msphinx -SPHINXPROJ = nexus -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/authors.rst b/docs/authors.rst deleted file mode 100644 index e122f914a87b277e565fc9567af1a7545ec9872b..0000000000000000000000000000000000000000 --- a/docs/authors.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../AUTHORS.rst diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100755 index 59e5a33b730e7f70cee1442ad772944d642cd9c4..0000000000000000000000000000000000000000 --- a/docs/conf.py +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# nexus documentation build configuration file, created by -# sphinx-quickstart on Fri Jun 9 13:47:02 2017. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -# If extensions (or modules to document with autodoc) are in another -# directory, add these directories to sys.path here. If the directory is -# relative to the documentation root, use os.path.abspath to make it -# absolute, like shown here. -# -import os -import sys -sys.path.insert(0, os.path.abspath('..')) - -import nexus - -# -- General configuration --------------------------------------------- - -# If your documentation needs a minimal Sphinx version, state it here. -# -# needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# -# source_suffix = ['.rst', '.md'] -source_suffix = '.rst' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'nexus' -copyright = u"2018, IRIS PASSCAL" -author = u"IRIS PASSCAL" - -# The version info for the project you're documenting, acts as replacement -# for |version| and |release|, also used in various other places throughout -# the built documents. -# -# The short X.Y version. -version = nexus.__version__ -# The full version, including alpha/beta/rc tags. -release = nexus.__version__ - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = False - - -# -- Options for HTML output ------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = 'alabaster' - -# Theme options are theme-specific and customize the look and feel of a -# theme further. For a list of options available for each theme, see the -# documentation. -# -# html_theme_options = {} - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - - -# -- Options for HTMLHelp output --------------------------------------- - -# Output file base name for HTML help builder. -htmlhelp_basename = 'nexusdoc' - - -# -- Options for LaTeX output ------------------------------------------ - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # - # 'papersize': 'letterpaper', - - # The font size ('10pt', '11pt' or '12pt'). - # - # 'pointsize': '10pt', - - # Additional stuff for the LaTeX preamble. - # - # 'preamble': '', - - # Latex figure (float) alignment - # - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass -# [howto, manual, or own class]). -latex_documents = [ - (master_doc, 'nexus.tex', - u'nexus Documentation', - u'IRIS PASSCAL', 'manual'), -] - - -# -- Options for manual page output ------------------------------------ - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'nexus', - u'nexus Documentation', - [author], 1) -] - - -# -- Options for Texinfo output ---------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - (master_doc, 'nexus', - u'nexus Documentation', - author, - 'nexus', - 'One line description of project.', - 'Miscellaneous'), -] - - - diff --git a/docs/contributing.rst b/docs/contributing.rst deleted file mode 100644 index e582053ea018c369be05aae96cf730744f1dc616..0000000000000000000000000000000000000000 --- a/docs/contributing.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../CONTRIBUTING.rst diff --git a/docs/history.rst b/docs/history.rst deleted file mode 100644 index 250649964bbc36f4bec2942f69238aa6f7c02c1a..0000000000000000000000000000000000000000 --- a/docs/history.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../HISTORY.rst diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 5ae2cbf4da4f0a2ba663005a9e557cb3437d45b6..0000000000000000000000000000000000000000 --- a/docs/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -Welcome to nexus's documentation! -====================================== - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - readme - installation - usage - modules - contributing - authors - history - -Indices and tables -================== -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/docs/installation.rst b/docs/installation.rst deleted file mode 100644 index 9d58fcd40a4bc008b3e8169b3c359737d1811c3b..0000000000000000000000000000000000000000 --- a/docs/installation.rst +++ /dev/null @@ -1,51 +0,0 @@ -.. highlight:: shell - -============ -Installation -============ - - -Stable release --------------- - -To install nexus, run this command in your terminal: - -.. code-block:: console - - $ pip install nexus - -This is the preferred method to install nexus, as it will always install the most recent stable release. - -If you don't have `pip`_ installed, this `Python installation guide`_ can guide -you through the process. - -.. _pip: https://pip.pypa.io -.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/ - - -From sources ------------- - -The sources for nexus can be downloaded from the `Github repo`_. - -You can either clone the public repository: - -.. code-block:: console - - $ git clone https://git.passcal.nmt.edu/passoft/nexus - -Or download the `tarball`_: - -.. code-block:: console - - $ curl -OL https://git.passcal.nmt.edu/passoft/nexus/tarball/master - -Once you have a copy of the source, you can install it with: - -.. code-block:: console - - $ python setup.py install - - -.. _Github repo: https://git.passcal.nmt.edu/passoft/nexus -.. _tarball: https://git.passcal.nmt.edu/passoft/nexus/tarball/master diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index bdff72501e7d359a66b4da2183a13167e1974334..0000000000000000000000000000000000000000 --- a/docs/make.bat +++ /dev/null @@ -1,36 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=python -msphinx -) -set SOURCEDIR=. -set BUILDDIR=_build -set SPHINXPROJ=nexus - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The Sphinx module was not found. Make sure you have Sphinx installed, - echo.then set the SPHINXBUILD environment variable to point to the full - echo.path of the 'sphinx-build' executable. Alternatively you may add the - echo.Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% - -:end -popd diff --git a/docs/readme.rst b/docs/readme.rst deleted file mode 100644 index 72a33558153fb57def85612b021ec596ef2a51b9..0000000000000000000000000000000000000000 --- a/docs/readme.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../README.rst diff --git a/docs/usage.rst b/docs/usage.rst deleted file mode 100644 index f570c8de90d9a053a7a533c9d824f055a153af33..0000000000000000000000000000000000000000 --- a/docs/usage.rst +++ /dev/null @@ -1,7 +0,0 @@ -===== -Usage -===== - -To use nexus in a project:: - - import nexus diff --git a/nexus/ChannelSelectDialog.py b/nexus/ChannelSelectDialog.py index 90621310a187b8a9cd30d8bb99b4ac84a9f7cb3c..e3c8d940d72839eb79e51dfcee98f95f072e743a 100644 --- a/nexus/ChannelSelectDialog.py +++ b/nexus/ChannelSelectDialog.py @@ -6,14 +6,13 @@ Lloyd Carothers IRIS/PASSCAL """ -import sys import os from PySide6.QtCore import Qt from PySide6.QtGui import QFontMetrics from PySide6.QtUiTools import loadUiType -from PySide6.QtWidgets import (QApplication, QTableWidgetItem, - QAbstractItemView, QHeaderView) +from PySide6.QtWidgets import (QTableWidgetItem, QAbstractItemView, + QHeaderView) from .obspyImproved import utc_to_str @@ -90,20 +89,3 @@ class ChannelSelectDialog(*load_ui('ChannelSelectDialog.ui')): assert True self.tableWidget.resizeColumnsToContents() self.tableWidget.horizontalHeader().setSectionResizeMode(QHeaderView.Fixed) - - -if __name__ == '__main__': - # Test - from obspy import read_inventory - - inv = read_inventory('test/data/xml/XW.2017.dmc.xml') - sta = inv[0][0] - - app = QApplication(sys.argv) - main = ChannelSelectDialog(station=sta) - if main.exec_(): - print('Selected:') - for c in main.selected_channels: - print(c) - else: - print('Canceled') diff --git a/nexus/NRLWizard.py b/nexus/NRLWizard.py index 61c84c62301142d34877f63b414ce0a288b33449..340bb38f8515a7ff347c98dd8eb9831efdd0f017 100644 --- a/nexus/NRLWizard.py +++ b/nexus/NRLWizard.py @@ -5,7 +5,7 @@ Lloyd Carothers Qt Wizard for selecting responses from the IRIS NRL ''' -from PySide6 import QtCore, QtGui, QtWidgets +from PySide6 import QtWidgets from obspy.clients.nrl import NRL @@ -114,26 +114,3 @@ class NRLPage(QtWidgets.QWizardPage): self.parent.q_and_as.pop() except IndexError: pass - - -if __name__ == '__main__': - import sys - app = QtWidgets.QApplication(sys.argv) - - # Sensor - w = NRLWizard() - ret = w.exec_() - print(ret) - if ret: - print(w.q_and_as) - print(w.final) - print(w.nickname) - - # Datalogger - w = NRLWizard(DATALOGGER) - ret = w.exec_() - if ret: - print(w.q_and_as) - print(w.final) - print(w.nickname) - print(ret) diff --git a/nexus/__init__.py b/nexus/__init__.py index 001e7f1fc0faee12d16b91434b76203897d81aed..aabd166049a70e1e286f8330db4f63634f44e871 100644 --- a/nexus/__init__.py +++ b/nexus/__init__.py @@ -4,4 +4,4 @@ __author__ = """IRIS PASSCAL""" __email__ = 'software-support@passcal.nmt.edu' -__version__ = '2023.4.5.0' +__version__ = '2023.4.6.0' diff --git a/nexus/hardware.py b/nexus/hardware.py index c255785df0f9064c819b40e241b1f31661a7c2ac..0717ea10fa4a204d5e73ce9ad741dde417f4f4cd 100644 --- a/nexus/hardware.py +++ b/nexus/hardware.py @@ -262,9 +262,3 @@ def create_defaults(): with open(os.path.join(resp_dir, filename), 'r') as f: d.soh_resps[chan] = read_inventory( f, format='RESP')[0][0][0].response - - -if __name__ == '__main__': - create_defaults() - print(sensors) - print(dataloggers) diff --git a/nexus/inv_model.py b/nexus/inv_model.py index d8549f19fde35dae3ced78f77338bd3ba6ebd192..fcc0f43fce854a8579a1205d5c3376f165ac476f 100644 --- a/nexus/inv_model.py +++ b/nexus/inv_model.py @@ -4,10 +4,9 @@ """ Channel Widget model play """ -import sys -from PySide6 import QtCore, QtGui, QtWidgets -from obspy import Inventory, read_inventory +from PySide6 import QtCore +from obspy import Inventory class InventoryModel(QtCore.QAbstractListModel): @@ -36,24 +35,3 @@ class InventoryModel(QtCore.QAbstractListModel): station.end_date.year, station.end_date.julday, ) - -if __name__ == '__main__': - app = QtWidgets.QApplication(sys.argv) - - listview = QtWidgets.QListView() - listview.show() - listview.setFont(QtGui.QFont('Consolas',16)) - - treeview = QtWidgets.QTreeView() - treeview.show() - treeview.setFont(QtGui.QFont('Consolas',16)) - - inv = read_inventory('/Users/lloyd/code/nexus/nexuseis/test/data/' - 'ANDIVOLC.xml', - format="STATIONXML") - inv_model = InventoryModel(inventory=inv) - - listview.setModel(inv_model) - treeview.setModel(inv_model) - - sys.exit(app.exec_()) diff --git a/nexus/inventorymodel.py b/nexus/inventorymodel.py index 3b1dbcfe33ebba52aa0c21e208fdeccacf87041a..da5bd45d4e46ce12210a675e7dc8a2037ea10c8a 100644 --- a/nexus/inventorymodel.py +++ b/nexus/inventorymodel.py @@ -6,10 +6,7 @@ Inventory Model PyQt5 Lloyd Carothers """ -import sys - -from PySide6 import QtCore, QtGui, QtWidgets -import obspy +from PySide6 import QtCore class Node(object): def __init__(self, name, inv_object, parent=None): @@ -127,30 +124,3 @@ class InventoryModel(QtCore.QAbstractItemModel): if parent == self._root_node: return QtCore.QModelIndex() return self.createIndex(parent.row(), 0, parent) - - -if __name__ == '__main__': - app = QtWidgets.QApplication(sys.argv) - - root_node = Node('', None, None) - - xx_node = Network('XX', None, root_node) - sta1_node = Station('STA1', None, xx_node) - chan1z_node = Channel('LHZ', None, sta1_node) - chan11_node = Channel('LH1', None, sta1_node) - chan12_node = Channel('LH2', None, sta1_node) - chan1log_node = Channel('LOG', None, sta1_node) - sta2_node = Station('STA2', None, xx_node) - chan2z_node = Channel('LHZ', None, sta2_node) - chan21 = Channel('LH1', None, sta2_node) - chan22_node = Channel('LH2', None, sta2_node) - chan2log_node = Channel('LOG', None, sta2_node) - - print(root_node) - - model = InventoryModel(root_node) - treeview = QtWidgets.QTreeView() - treeview.show() - treeview.setModel(model) - - sys.exit(app.exec_()) diff --git a/nexus/ms_sum.py b/nexus/ms_sum.py index d5ce8ef11af88d64a0151642d6469984a131bd32..25cf0eee12a03df6e130b1786779d86852ca524b 100755 --- a/nexus/ms_sum.py +++ b/nexus/ms_sum.py @@ -25,5 +25,3 @@ def main(): inv.scan_quick(path,log_message=lambda x:None) inv.print_sum() -if __name__ == '__main__': - main() diff --git a/nexus/nexus.py b/nexus/nexus.py index 49692fae8bc40ff390bb1692f447375e6ba570da..349441b8e326ea8d9aea6ea16f28026f54550c94 100755 --- a/nexus/nexus.py +++ b/nexus/nexus.py @@ -5,7 +5,6 @@ Lloyd Carothers """ -from copy import deepcopy import os import sys import traceback diff --git a/nexus/obspyImproved.py b/nexus/obspyImproved.py index c71617bbc94f8947b412239ebcff6b6fc536176c..df44c73f66b4ed94d4d14d7d191a05666ee54b1a 100644 --- a/nexus/obspyImproved.py +++ b/nexus/obspyImproved.py @@ -10,15 +10,8 @@ import os from obspy import read as obspy_read from obspy import Inventory from obspy import UTCDateTime -from obspy.core.inventory import ( - Network, - Station, - Channel, - Comment, - Site, - Equipment, - Response, - ) +from obspy.core.inventory import (Network, Station, Channel, + Site, Equipment) from obspy.io.mseed.core import _is_mseed from obspy.io.mseed import util diff --git a/pyinstaller.sh b/pyinstaller.sh deleted file mode 100644 index 77e085d6a050176f46a81ad90922d7e4a0f1d6b0..0000000000000000000000000000000000000000 --- a/pyinstaller.sh +++ /dev/null @@ -1,3 +0,0 @@ -pyinstaller -d -y --clean debug_nexus --log-level DEBUG\ - --add-data '/Users/lloyd/code/obspy/obspy/imaging/data/*.npz:obspy/imaging/data/' -#pyinstaller -d -y --clean debug_nexus --log-level DEBUG\ diff --git a/run_nexus b/run_nexus deleted file mode 100755 index 1c580c31bcbc585d67f4b529752ba235fb7eca04..0000000000000000000000000000000000000000 --- a/run_nexus +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python -''' -Launch nexus in a similar way as entry_point console_scripts. -For testing, don't use -''' -from nexus import nexus - -nexus.main() diff --git a/setup.py b/setup.py index 775e43ce2183a08b18af84eac2b35dc1fab584f6..470e82c55a019ae86e5d17b645ef46e8c383312a 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,8 @@ setup( 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 'Natural Language :: English', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], description="StationXML creation GUI", entry_points={ @@ -50,6 +52,6 @@ setup( packages=find_packages(include=['nexus']), test_suite='tests', url='https://git.passcal.nmt.edu/software_public/passoft/nexus', - version='2023.4.5.0', + version='2023.4.6.0', zip_safe=False, )