From 246664d3bf5e1afe91c2f426f10ff664130d0e88 Mon Sep 17 00:00:00 2001 From: Kip Hart <41959581+kip-hart@users.noreply.github.com> Date: Thu, 5 Oct 2023 10:53:57 -0700 Subject: [PATCH] add support for Python 3.12 (#92) --- .github/workflows/python_package.yaml | 2 +- CHANGELOG.rst | 9 +++++++-- docs/requirements.txt | 4 ++-- requirements.txt | 8 ++++---- setup.py | 1 + src/microstructpy/__init__.py | 2 +- src/microstructpy/examples/uniform_seeding.py | 2 +- src/microstructpy/geometry/ellipse.py | 2 +- src/microstructpy/geometry/rectangle.py | 2 +- src/microstructpy/seeding/seedlist.py | 4 ++-- 10 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/python_package.yaml b/.github/workflows/python_package.yaml index ecdd19cf..82e406dd 100644 --- a/.github/workflows/python_package.yaml +++ b/.github/workflows/python_package.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.8, 3.9, '3.10', '3.11'] + python-version: [3.8, 3.9, '3.10', '3.11', '3.12'] os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] steps: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 98467d7b..6c44047d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,8 +6,12 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog`_, and this project adheres to `Semantic Versioning`_. -`Unreleased`_ +`1.5.9`_ - 2023-10-05 -------------------------- +Added +''''' +- Support for Python 3.12 + Changed ''''''' - Updated version numbers of dependencies per security report. @@ -318,7 +322,8 @@ Added .. LINKS -.. _`Unreleased`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.8...HEAD +.. _`Unreleased`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.9...HEAD +.. _`1.5.9`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.8...v1.5.9 .. _`1.5.8`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.7...v1.5.8 .. _`1.5.7`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.6...v1.5.7 .. _`1.5.6`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.5...v1.5.6 diff --git a/docs/requirements.txt b/docs/requirements.txt index e6ef2a01..b701f490 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,6 @@ gmsh==4.11.1 -matplotlib==3.7.2 -numpy==1.24.4 +matplotlib>=3.7.3 +numpy>=1.24.4 pybind11==2.4.3 setuptools>=65.5.1 sphinx==4.2.0 diff --git a/requirements.txt b/requirements.txt index e9528c35..8235f94a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,12 @@ aabbtree==2.5.0 -matplotlib==3.7.2 +matplotlib>=3.7.3 pybind11==2.4.3 pygmsh==7.1.17 -MeshPy==2018.2.1 -numpy==1.24.4 +MeshPy==2022.1.3 +numpy>=1.24.4 pyquaternion==0.9.5 pyvoro-mmalahe==1.3.4 -scipy==1.10.1 +scipy>=1.10.1 setuptools>=65.5.1 xmltodict==0.12.0 tox==3.14.0 diff --git a/setup.py b/setup.py index b597cd53..d856f4f0 100644 --- a/setup.py +++ b/setup.py @@ -61,6 +61,7 @@ def find_version(*fname): 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Mathematics', 'Topic :: Scientific/Engineering :: Physics' diff --git a/src/microstructpy/__init__.py b/src/microstructpy/__init__.py index 8982fe7c..bd7e9430 100644 --- a/src/microstructpy/__init__.py +++ b/src/microstructpy/__init__.py @@ -4,4 +4,4 @@ import microstructpy.seeding import microstructpy.verification -__version__ = '1.5.8' +__version__ = '1.5.9' diff --git a/src/microstructpy/examples/uniform_seeding.py b/src/microstructpy/examples/uniform_seeding.py index 74bccf4e..adeb7f63 100644 --- a/src/microstructpy/examples/uniform_seeding.py +++ b/src/microstructpy/examples/uniform_seeding.py @@ -61,7 +61,7 @@ norm = mpl.colors.Normalize(vmin=min_area, vmax=max_area) sm = plt.cm.ScalarMappable(cmap=cmap, norm=norm) sm.set_array([]) -cb = plt.colorbar(sm, ticks=[min_area, std_area, max_area], +cb = plt.colorbar(sm, ticks=[min_area, std_area, max_area], ax=plt.gca(), orientation='horizontal', fraction=0.046, pad=0.08) cb.set_label('Cell Area') diff --git a/src/microstructpy/geometry/ellipse.py b/src/microstructpy/geometry/ellipse.py index fe2e01a4..364d9c70 100644 --- a/src/microstructpy/geometry/ellipse.py +++ b/src/microstructpy/geometry/ellipse.py @@ -569,7 +569,7 @@ def plot(self, **kwargs): """ # NOQA: E501 p = patches.Ellipse(self.center, 2 * self.a, 2 * self.b, - self.angle_deg, **kwargs) + angle=self.angle_deg, **kwargs) plt.gca().add_patch(p) # ----------------------------------------------------------------------- # diff --git a/src/microstructpy/geometry/rectangle.py b/src/microstructpy/geometry/rectangle.py index 59b807b9..eb31f8e9 100644 --- a/src/microstructpy/geometry/rectangle.py +++ b/src/microstructpy/geometry/rectangle.py @@ -396,7 +396,7 @@ def plot(self, **kwargs): w = self.length h = self.width ang = self.angle - c = patches.Rectangle(pt, w, h, ang, **kwargs) + c = patches.Rectangle(pt, w, h, angle=ang, **kwargs) plt.gca().add_patch(c) diff --git a/src/microstructpy/seeding/seedlist.py b/src/microstructpy/seeding/seedlist.py index 574f657b..0aade885 100644 --- a/src/microstructpy/seeding/seedlist.py +++ b/src/microstructpy/seeding/seedlist.py @@ -575,7 +575,7 @@ def plot(self, index_by='seed', material=[], loc=0, **kwargs): rects = [Rectangle(xy=xyi, width=wi, height=hi, angle=ai) for xyi, wi, hi, ai in zip(rect_data['xy'], rect_data['w'], rect_data['h'], rect_data['angle'])] - rc = collections.PatchCollection(rects, False, **rect_kwargs) + rc = collections.PatchCollection(rects, match_original=False, **rect_kwargs) ax.add_collection(rc) # Plot Polygons @@ -1161,7 +1161,7 @@ def _plot_2d(ax, seeds, seed_args): # Plot Rectangles rects = [Rectangle(**rect_inps) for rect_inps in rect_data] - rc = collections.PatchCollection(rects, False, **rect_kwargs) + rc = collections.PatchCollection(rects, match_original=False, **rect_kwargs) ax.add_collection(rc) ax.autoscale_view()