From bbc68b45a75aa024b2183e5aca470ed9a3f0b5b4 Mon Sep 17 00:00:00 2001 From: Greg Lucas Date: Wed, 13 Nov 2024 15:55:56 -0700 Subject: [PATCH] MNT: Python3.13 and minor updates --- .github/workflows/docs.yml | 4 ++-- .github/workflows/tests.yml | 2 +- .github/workflows/wheels.yml | 10 ++-------- .pre-commit-config.yaml | 2 +- CITATION.cff | 2 +- README.md | 8 ++++---- docs/source/conf.py | 1 + meson.build | 2 +- pymsis/__init__.py | 2 +- pymsis/msis.py | 2 +- pyproject.toml | 10 +++++++--- tests/test_msis.py | 10 +++++----- 12 files changed, 27 insertions(+), 28 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bf851d1..a32f4e9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.13' - name: Download source files run: | @@ -38,7 +38,7 @@ jobs: cd docs make html - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: DocumentationHTML path: docs/build/html/ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 291fc79..f4663b5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,7 +29,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest, macos-14] - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12', '3.13'] defaults: run: shell: bash diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index c3f5759..fd66eb0 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -41,9 +41,6 @@ jobs: steps: - uses: actions/checkout@v4 - # Used to host cibuildwheel - - uses: actions/setup-python@v3 - - name: Download source files run: | python .github/workflows/download_mirror.py @@ -78,12 +75,9 @@ jobs: echo "PYTHONUTF8=1" >> $GITHUB_ENV - name: Build wheels - uses: pypa/cibuildwheel@v2.17.0 + uses: pypa/cibuildwheel@v2.21.3 env: - CIBW_BUILD: "cp310-* cp311-* cp312-*" - # skip 32 bit windows and linux builds because numpy - # does not provide wheels for these platforms - CIBW_SKIP: "*-win32 *_i686" + MACOSX_DEPLOYMENT_TARGET: "${{ matrix.os == 'macos-13' && '13' || '14' }}" - uses: actions/upload-artifact@v4 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 39d5212..b23f54a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ ci: autoupdate_schedule: 'quarterly' repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.5.0' + rev: 'v0.7.3' hooks: - id: ruff args: [--fix] diff --git a/CITATION.cff b/CITATION.cff index c720be6..270526e 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -9,7 +9,7 @@ authors: Atmospheric and Space Physics (LASP) orcid: "https://orcid.org/0000-0003-1331-1863" title: "pymsis" -version: v0.9.0 +version: v0.10.0 doi: 10.5281/zenodo.5348502 date-released: 2024-04-04 url: "https://github.com/SWxTREC/pymsis" diff --git a/README.md b/README.md index e8d584d..c585090 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,10 @@ models (MSISE-00, MSIS2.0, MSIS2.1). ## Quickstart -[Web viewer](https://swx-trec.com/msis): An interactive website using pymsis through cloud-based serverless functions. -[Project homepage](https://swxtrec.github.io/pymsis/): Location for all documentation. -[API Reference](https://swxtrec.github.io/pymsis/reference/index.html): Details about the various options and configurations available in the functions. -[Examples](https://swxtrec.github.io/pymsis/examples/index.html): Demo for how to access and plot the data. +- [Documentation](https://swxtrec.github.io/pymsis/) +- [API Reference](https://swxtrec.github.io/pymsis/reference/index.html): Details about the various options and configurations available in the functions. +- [Examples](https://swxtrec.github.io/pymsis/examples/index.html): Demo for how to access and plot the data. +- [Web viewer](https://swx-trec.com/msis): An interactive website using pymsis through cloud-based serverless functions. **A few short lines of code to get started quickly with pymsis.** diff --git a/docs/source/conf.py b/docs/source/conf.py index 72c703a..48fc284 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -76,6 +76,7 @@ # Autosummary autosummary_generate = True +autodoc_typehints = "none" # Sphinx gallery sphinx_gallery_conf = { diff --git a/meson.build b/meson.build index 6cb4bca..64ea852 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project( 'pymsis', 'c', # Note that the git commit hash cannot be added dynamically here - version: '0.9.0', + version: '0.10.0', license: 'MIT', meson_version: '>=1.2.99', default_options: [ diff --git a/pymsis/__init__.py b/pymsis/__init__.py index 3ade27f..6dc9ab1 100644 --- a/pymsis/__init__.py +++ b/pymsis/__init__.py @@ -1,3 +1,3 @@ """Python interface to the MSIS codes.""" -__version__ = "0.9.0" +__version__ = "0.10.0" diff --git a/pymsis/msis.py b/pymsis/msis.py index 01d31f0..6b56676 100644 --- a/pymsis/msis.py +++ b/pymsis/msis.py @@ -69,7 +69,7 @@ def run( ------- ndarray (ndates, nlons, nlats, nalts, 11) or (ndates, 11) | The data calculated at each grid point: - | [Total mass density (kg/m3) + | [Total mass density (kg/m3), | N2 # density (m-3), | O2 # density (m-3), | O # density (m-3), diff --git a/pyproject.toml b/pyproject.toml index 6df5f76..1c161dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,12 +2,12 @@ build-backend = "mesonpy" requires = [ "meson-python>=0.10.0", - "numpy>=2.0.0rc1", + "numpy>=2", ] [project] name = "pymsis" -version = "0.9.0" +version = "0.10.0" description = "A Python wrapper around the NRLMSIS model." readme = "README.md" license = {file = "LICENSE"} @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Software Development", "Topic :: Scientific/Engineering", "Operating System :: Microsoft :: Windows", @@ -39,7 +40,7 @@ tests = [ ] docs = [ "matplotlib", - "sphinx<6", + "sphinx", "sphinx_gallery", "pydata-sphinx-theme", ] @@ -64,6 +65,9 @@ addopts = [ ] [tool.cibuildwheel] +build = "cp310-* cp311-* cp312-* cp313-*" +# skip 32 bit windows and linux builds for lack of numpy wheels +skip = "*-win32 *_i686" test-requires = "pytest" test-command = "pytest --pyargs pymsis" diff --git a/tests/test_msis.py b/tests/test_msis.py index 10bbe4a..610c2a9 100644 --- a/tests/test_msis.py +++ b/tests/test_msis.py @@ -5,7 +5,7 @@ from pymsis import msis, msis00f, msis20f, msis21f -@pytest.fixture() +@pytest.fixture def input_data(): date = np.datetime64("2010-01-01T12:00") lon = 0 @@ -17,12 +17,12 @@ def input_data(): return (date, lon, lat, alt, f107, f107a, ap) -@pytest.fixture() +@pytest.fixture def expected_input(): return [1.0, 86400 / 2, 0, 0, 200, 150, 150] + [3] * 7 -@pytest.fixture() +@pytest.fixture def expected_output(): return np.array( [ @@ -42,7 +42,7 @@ def expected_output(): ) -@pytest.fixture() +@pytest.fixture def expected_output00(): return np.array( [ @@ -62,7 +62,7 @@ def expected_output00(): ) -@pytest.fixture() +@pytest.fixture def input_auto_f107_ap(): return ( np.datetime64("2000-07-01T12:00"),