From 3e14868b55aa4cee13f197cc2c8dfa9c363fd157 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 14 Aug 2025 12:23:24 +0700 Subject: [PATCH 1/4] Use np.isnan instead of comparing to np.nan --- openmc_plotter/plotgui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 5a5ec1ef50dfb1f80eabab206603d7f05cb1bbe6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 15 Aug 2025 14:05:38 +0800 Subject: [PATCH 2/4] Update version dependencies --- setup.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index c0fdaf1..1f63518 100644 --- a/setup.py +++ b/setup.py @@ -41,18 +41,16 @@ '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', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', ], # Dependencies - 'python_requires': '>=3.8', + 'python_requires': '>=3.10', 'install_requires': [ - 'openmc>0.14.0', 'numpy', 'matplotlib', 'PySide6' + 'openmc>=0.15.0', 'numpy', 'matplotlib', 'PySide6' ], 'extras_require': { 'test' : ['pytest', 'pytest-qt'], From 401ff258f320c21cb3d92f39f0255377b1a62511 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 15 Aug 2025 14:17:41 +0800 Subject: [PATCH 3/4] Convert setup.py to pyproject.toml --- pyproject.toml | 58 ++++++++++++++++++++++++++++++++++++++++++++++- setup.py | 61 -------------------------------------------------- 2 files changed, 57 insertions(+), 62 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index c953815..9189a21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,58 @@ [build-system] -requires = ["setuptools", "wheel"] \ No newline at end of file +requires = ["setuptools>=61", "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.dynamic] +version = { attr = "openmc_plotter.__version__" } diff --git a/setup.py b/setup.py deleted file mode 100644 index 1f63518..0000000 --- a/setup.py +++ /dev/null @@ -1,61 +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.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - ], - - # Dependencies - 'python_requires': '>=3.10', - 'install_requires': [ - 'openmc>=0.15.0', 'numpy', 'matplotlib', 'PySide6' - ], - 'extras_require': { - 'test' : ['pytest', 'pytest-qt'], - 'vtk' : ['vtk'] - }, -} - -setup(**kwargs) From ce5d4e697f951ec23cfdb8dd3b89d1482380ae99 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 15 Aug 2025 17:11:07 +0800 Subject: [PATCH 4/4] Use setuptools_scm for versioning --- openmc_plotter/__init__.py | 4 +++- pyproject.toml | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) 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/pyproject.toml b/pyproject.toml index 9189a21..ca4045b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=61", "wheel"] +requires = ["setuptools>=80", "setuptools_scm>=8", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -54,5 +54,4 @@ include = ["openmc_plotter*"] [tool.setuptools.package-data] openmc_plotter = ["assets/*.png"] -[tool.setuptools.dynamic] -version = { attr = "openmc_plotter.__version__" } +[tool.setuptools_scm]