Skip to content

Commit c97b703

Browse files
committed
MNT: Python3.13 and minor updates
1 parent d30ab27 commit c97b703

File tree

13 files changed

+41
-40
lines changed

13 files changed

+41
-40
lines changed

.github/workflows/docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set up Python
2323
uses: actions/setup-python@v4
2424
with:
25-
python-version: '3.10'
25+
python-version: '3.13'
2626

2727
- name: Download source files
2828
run: |
@@ -38,7 +38,7 @@ jobs:
3838
cd docs
3939
make html
4040
41-
- uses: actions/upload-artifact@v2
41+
- uses: actions/upload-artifact@v4
4242
with:
4343
name: DocumentationHTML
4444
path: docs/build/html/

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
matrix:
3131
os: [windows-latest, ubuntu-latest, macos-latest, macos-14]
32-
python-version: ['3.10', '3.11', '3.12']
32+
python-version: ['3.10', '3.11', '3.12', '3.13']
3333
defaults:
3434
run:
3535
shell: bash

.github/workflows/wheels.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ jobs:
4141
steps:
4242
- uses: actions/checkout@v4
4343

44-
# Used to host cibuildwheel
45-
- uses: actions/setup-python@v3
46-
4744
- name: Download source files
4845
run: |
4946
python .github/workflows/download_mirror.py
@@ -78,12 +75,13 @@ jobs:
7875
echo "PYTHONUTF8=1" >> $GITHUB_ENV
7976
8077
- name: Build wheels
81-
uses: pypa/cibuildwheel@v2.17.0
78+
uses: pypa/cibuildwheel@v2.21.3
8279
env:
83-
CIBW_BUILD: "cp310-* cp311-* cp312-*"
84-
# skip 32 bit windows and linux builds because numpy
85-
# does not provide wheels for these platforms
86-
CIBW_SKIP: "*-win32 *_i686"
80+
# The brew built gfortran linked libraries have minimum macOS versions
81+
# of the macOS version they were built on. We would need to compile
82+
# from source rather than use setup-fortran if we want to support
83+
# lower macOS versions.
84+
MACOSX_DEPLOYMENT_TARGET: "${{ matrix.os == 'macos-13' && '13.0' || '14.0' }}"
8785

8886
- uses: actions/upload-artifact@v4
8987
with:

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ci:
33
autoupdate_schedule: 'quarterly'
44
repos:
55
- repo: https://github.com/astral-sh/ruff-pre-commit
6-
rev: 'v0.5.0'
6+
rev: 'v0.7.3'
77
hooks:
88
- id: ruff
99
args: [--fix]

CITATION.cff

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ authors:
99
Atmospheric and Space Physics (LASP)
1010
orcid: "https://orcid.org/0000-0003-1331-1863"
1111
title: "pymsis"
12-
version: v0.9.0
12+
version: v0.10.0
1313
doi: 10.5281/zenodo.5348502
1414
date-released: 2024-04-04
1515
url: "https://github.com/SWxTREC/pymsis"

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ models (MSISE-00, MSIS2.0, MSIS2.1).
1313

1414
## Quickstart
1515

16-
[Web viewer](https://swx-trec.com/msis): An interactive website using pymsis through cloud-based serverless functions.
17-
[Project homepage](https://swxtrec.github.io/pymsis/): Location for all documentation.
18-
[API Reference](https://swxtrec.github.io/pymsis/reference/index.html): Details about the various options and configurations available in the functions.
19-
[Examples](https://swxtrec.github.io/pymsis/examples/index.html): Demo for how to access and plot the data.
16+
- [Documentation](https://swxtrec.github.io/pymsis/)
17+
- [API Reference](https://swxtrec.github.io/pymsis/reference/index.html): Details about the various options and configurations available in the functions.
18+
- [Examples](https://swxtrec.github.io/pymsis/examples/index.html): Demo for how to access and plot the data.
19+
- [Web viewer](https://swx-trec.com/msis): An interactive website using pymsis through cloud-based serverless functions.
2020

2121
**A few short lines of code to get started quickly with pymsis.**
2222

docs/source/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676

7777
# Autosummary
7878
autosummary_generate = True
79+
autodoc_typehints = "none"
7980

8081
# Sphinx gallery
8182
sphinx_gallery_conf = {

meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ project(
22
'pymsis',
33
'c',
44
# Note that the git commit hash cannot be added dynamically here
5-
version: '0.9.0',
5+
version: '0.10.0',
66
license: 'MIT',
77
meson_version: '>=1.2.99',
88
default_options: [

pymsis/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Python interface to the MSIS codes."""
22

3-
__version__ = "0.9.0"
3+
__version__ = "0.10.0"

pymsis/msis.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Interface for running and creating input for the MSIS models."""
22

33
from pathlib import Path
4-
from typing import Optional, Union
54

65
import numpy as np
76
import numpy.typing as npt
@@ -15,12 +14,12 @@ def run(
1514
lons: npt.ArrayLike,
1615
lats: npt.ArrayLike,
1716
alts: npt.ArrayLike,
18-
f107s: Optional[npt.ArrayLike] = None,
19-
f107as: Optional[npt.ArrayLike] = None,
20-
aps: Optional[npt.ArrayLike] = None,
17+
f107s: npt.ArrayLike | None = None,
18+
f107as: npt.ArrayLike | None = None,
19+
aps: npt.ArrayLike | None = None,
2120
*,
22-
options: Optional[list[float]] = None,
23-
version: Union[float, str] = 2.1,
21+
options: list[float] | None = None,
22+
version: float | str = 2.1,
2423
**kwargs: dict,
2524
) -> npt.NDArray:
2625
"""
@@ -69,7 +68,7 @@ def run(
6968
-------
7069
ndarray (ndates, nlons, nlats, nalts, 11) or (ndates, 11)
7170
| The data calculated at each grid point:
72-
| [Total mass density (kg/m3)
71+
| [Total mass density (kg/m3),
7372
| N2 # density (m-3),
7473
| O2 # density (m-3),
7574
| O # density (m-3),
@@ -266,9 +265,9 @@ def create_input(
266265
lons: npt.ArrayLike,
267266
lats: npt.ArrayLike,
268267
alts: npt.ArrayLike,
269-
f107s: Optional[npt.ArrayLike] = None,
270-
f107as: Optional[npt.ArrayLike] = None,
271-
aps: Optional[npt.ArrayLike] = None,
268+
f107s: npt.ArrayLike | None = None,
269+
f107as: npt.ArrayLike | None = None,
270+
aps: npt.ArrayLike | None = None,
272271
) -> tuple[tuple, npt.NDArray]:
273272
"""
274273
Combine all input values into a single flattened array.

pymsis/utils.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import warnings
55
from io import BytesIO
66
from pathlib import Path
7-
from typing import Optional
87

98
import numpy as np
109
import numpy.typing as npt
@@ -15,7 +14,7 @@
1514
_DATA_FNAME: str = "SW-All.csv"
1615
_F107_AP_URL: str = f"https://celestrak.org/SpaceData/{_DATA_FNAME}"
1716
_F107_AP_PATH: Path = Path(pymsis.__file__).parent / _DATA_FNAME
18-
_DATA: Optional[dict[str, npt.NDArray]] = None
17+
_DATA: dict[str, npt.NDArray] | None = None
1918

2019

2120
def download_f107_ap() -> None:

pyproject.toml

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
build-backend = "mesonpy"
33
requires = [
44
"meson-python>=0.10.0",
5-
"numpy>=2.0.0rc1",
5+
"numpy>=2",
66
]
77

88
[project]
99
name = "pymsis"
10-
version = "0.9.0"
10+
version = "0.10.0"
1111
description = "A Python wrapper around the NRLMSIS model."
1212
readme = "README.md"
1313
license = {file = "LICENSE"}
@@ -22,6 +22,7 @@ classifiers = [
2222
"Programming Language :: Python :: 3.10",
2323
"Programming Language :: Python :: 3.11",
2424
"Programming Language :: Python :: 3.12",
25+
"Programming Language :: Python :: 3.13",
2526
"Topic :: Software Development",
2627
"Topic :: Scientific/Engineering",
2728
"Operating System :: Microsoft :: Windows",
@@ -39,7 +40,7 @@ tests = [
3940
]
4041
docs = [
4142
"matplotlib",
42-
"sphinx<6",
43+
"sphinx",
4344
"sphinx_gallery",
4445
"pydata-sphinx-theme",
4546
]
@@ -64,11 +65,14 @@ addopts = [
6465
]
6566

6667
[tool.cibuildwheel]
68+
build = "cp310-* cp311-* cp312-* cp313-*"
69+
# skip 32 bit windows and linux builds for lack of numpy wheels
70+
skip = "*-win32 *_i686"
6771
test-requires = "pytest"
6872
test-command = "pytest --pyargs pymsis"
6973

7074
[tool.ruff]
71-
target-version = "py39"
75+
target-version = "py310"
7276
lint.select = ["B", "D", "E", "F", "I", "N", "S", "W", "PL", "PT", "UP", "RUF", "ANN"]
7377
lint.ignore = ["B028", "D203", "D212", "PLR0913", "S310"]
7478

tests/test_msis.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pymsis import msis, msis00f, msis20f, msis21f
66

77

8-
@pytest.fixture()
8+
@pytest.fixture
99
def input_data():
1010
date = np.datetime64("2010-01-01T12:00")
1111
lon = 0
@@ -17,12 +17,12 @@ def input_data():
1717
return (date, lon, lat, alt, f107, f107a, ap)
1818

1919

20-
@pytest.fixture()
20+
@pytest.fixture
2121
def expected_input():
2222
return [1.0, 86400 / 2, 0, 0, 200, 150, 150] + [3] * 7
2323

2424

25-
@pytest.fixture()
25+
@pytest.fixture
2626
def expected_output():
2727
return np.array(
2828
[
@@ -42,7 +42,7 @@ def expected_output():
4242
)
4343

4444

45-
@pytest.fixture()
45+
@pytest.fixture
4646
def expected_output00():
4747
return np.array(
4848
[
@@ -62,7 +62,7 @@ def expected_output00():
6262
)
6363

6464

65-
@pytest.fixture()
65+
@pytest.fixture
6666
def input_auto_f107_ap():
6767
return (
6868
np.datetime64("2000-07-01T12:00"),

0 commit comments

Comments
 (0)