Skip to content

Commit

Permalink
Python >= 3.9 required
Browse files Browse the repository at this point in the history
Hasn't been CI'd with Python 3.8 in many months.
  • Loading branch information
scivision committed Jan 24, 2024
1 parent 8f7b6cb commit 1a69076
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Atmospheric Science"
]
requires-python = ">=3.8"
requires-python = ">=3.9"
dynamic = ["version", "readme"]
dependencies = ["python-dateutil", "numpy", "xarray>=0.16.0", "scipy", "h5py", "matplotlib >= 3.1"]

Expand Down
4 changes: 0 additions & 4 deletions scripts/plot_all_subdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@
import concurrent.futures
import itertools
import os
import sys

import gemini3d.plot as plot

if sys.version_info < (3, 9):
raise RuntimeError("Python 3.9 or later is required")


def plot_dir(d: Path, resume: bool) -> None:
if resume and (d / "plots").is_dir():
Expand Down
1 change: 0 additions & 1 deletion src/gemini3d/plot/cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ def plot3d_slice(
clim: tuple[float, float],
ref_alt: float,
) -> None:

axs = fg.subplots(1, 3, sharey=False, sharex=False) # type: T.Any
# fg.suptitle(f"{name}: {time.isoformat()} {meta['commit']}", y=0.98)
# %% CONVERT TO DISTANCE UP, EAST, NORTH (left panel)
Expand Down
4 changes: 3 additions & 1 deletion src/gemini3d/plot/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def frame(

if saveplot_fmt:
plot_fn = (
direc / "plots" / f"{k}-{time.isoformat().replace(':', '')}.{saveplot_fmt}"
direc
/ "plots"
/ f"{k}-{time.isoformat().replace(':', '')}.{saveplot_fmt}"
)
plot_fn.parent.mkdir(exist_ok=True)
print(f"{dat['time']} => {plot_fn}")
Expand Down
11 changes: 3 additions & 8 deletions src/gemini3d/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import shutil
from pathlib import Path
import importlib.resources as pkgr
import sys

from datetime import datetime, timedelta
import typing as T
Expand Down Expand Up @@ -41,12 +40,8 @@ def get_pkg_file(package: str, filename: str) -> Path:
NOTE: this probably assumes the install is Zip safe
"""

if sys.version_info < (3, 9):
with pkgr.path(package, filename) as f:
return f
else:
with pkgr.as_file(pkgr.files(package).joinpath(filename)) as f:
return f
with pkgr.as_file(pkgr.files(package).joinpath(filename)) as f:
return f


def str2func(name: str, path: Path | None = None) -> T.Callable:
Expand Down Expand Up @@ -228,7 +223,7 @@ def get_cpu_count() -> int:
try:
import psutil

max_cpu = psutil.cpu_count(logical=False)
max_cpu: int | None = psutil.cpu_count(logical=False)
if max_cpu is None:
max_cpu = psutil.cpu_count()
extradiv = 2
Expand Down

0 comments on commit 1a69076

Please sign in to comment.