diff --git a/openmc_plotter/__init__.py b/openmc_plotter/__init__.py index f0ede3d..bb88f5b 100644 --- a/openmc_plotter/__init__.py +++ b/openmc_plotter/__init__.py @@ -1 +1,3 @@ -__version__ = '0.4.1' +from importlib.metadata import version + +__version__ = version("openmc-plotter") diff --git a/openmc_plotter/plotgui.py b/openmc_plotter/plotgui.py index cd850da..c33d161 100644 --- a/openmc_plotter/plotgui.py +++ b/openmc_plotter/plotgui.py @@ -280,7 +280,7 @@ def mouseMoveEvent(self, event): if self.model.tally_data is not None: tid, value = self.getTallyInfo(event) - if value is not None and value != np.nan: + if value is not None and not np.isnan(value): self.updateTallyDataIndicatorValue(value) tallyInfo = "Tally {} {}: {:.5E}".format( tid, cv.tallyValue, value) diff --git a/pyproject.toml b/pyproject.toml index c953815..ca4045b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,57 @@ [build-system] -requires = ["setuptools", "wheel"] \ No newline at end of file +requires = ["setuptools>=80", "setuptools_scm>=8", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "openmc-plotter" +dynamic = ["version"] +authors = [ + { name = "OpenMC Development Team", email = "openmc@anl.gov" }, +] +license = "MIT" +description = "Plotting tool for OpenMC models and tally data" +readme = "README.md" +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: End Users/Desktop", + "Intended Audience :: Science/Research", + "Natural Language :: English", + "Topic :: Scientific/Engineering", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", +] +requires-python = ">=3.10" +dependencies = [ + "openmc>=0.15.0", + "numpy", + "matplotlib", + "PySide6", +] + +[project.optional-dependencies] +test = ["pytest", "pytest-qt"] +vtk = ["vtk"] + +[project.urls] +"Homepage" = "https://github.com/openmc-dev/plotter" +"Download" = "https://github.com/openmc-dev/plotter" +"Issue Tracker" = "https://github.com/openmc-dev/plotter/issues" +"Source Code" = "https://github.com/openmc-dev/plotter" + +[project.scripts] +openmc-plotter = "openmc_plotter.__main__:main" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +include = ["openmc_plotter*"] + +[tool.setuptools.package-data] +openmc_plotter = ["assets/*.png"] + +[tool.setuptools_scm] diff --git a/setup.py b/setup.py deleted file mode 100644 index c0fdaf1..0000000 --- a/setup.py +++ /dev/null @@ -1,63 +0,0 @@ -from pathlib import Path - -from setuptools import setup - -# Get version information from __init__.py. This is ugly, but more reliable than -# using an import. -with open('openmc_plotter/__init__.py', 'r') as f: - version = f.readlines()[-1].split()[-1].strip("'") - -# read the contents of your README file -long_description = Path(__file__).with_name("README.md").read_text() - -kwargs = { - 'name': 'openmc-plotter', - 'version': version, - 'packages': ['openmc_plotter'], - 'package_data': {'openmc_plotter' : ['assets/*.png']}, - 'entry_points': { - 'console_scripts': [ - 'openmc-plotter=openmc_plotter.__main__:main' - ] - }, - - # Metadata - 'author': 'OpenMC Development Team', - 'author_email': 'openmc@anl.gov', - 'description': 'Plotting tool for OpenMC models and tally data', - 'long_description': long_description, - 'long_description_content_type': 'text/markdown', - 'url': 'https://github.com/openmc-dev/plotter', - 'download_url': 'https://github.com/openmc-dev/plotter', - 'project_urls': { - 'Issue Tracker': 'https://github.com/openmc-dev/plotter/issues', - 'Source Code': 'https://github.com/openmc-dev/plotter', - }, - 'classifiers': [ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Intended Audience :: End Users/Desktop', - 'Intended Audience :: Science/Research', - 'Natural Language :: English', - 'Topic :: Scientific/Engineering', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - ], - - # Dependencies - 'python_requires': '>=3.8', - 'install_requires': [ - 'openmc>0.14.0', 'numpy', 'matplotlib', 'PySide6' - ], - 'extras_require': { - 'test' : ['pytest', 'pytest-qt'], - 'vtk' : ['vtk'] - }, -} - -setup(**kwargs)