Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fa0d595
Merge pull request #273 from NCAR/main
kafitzgerald May 15, 2025
7643b9b
Remove np.float_ as a fill option
kprussing Mar 6, 2025
7f6dc99
adjust tolerance to allow for precision level diffs introduced by ups…
kafitzgerald Jul 16, 2025
f87adf8
add NumPy version conditional for default fill mapping
kafitzgerald Jul 16, 2025
acd95e1
Update environment.yml
kafitzgerald Jul 16, 2025
a219727
Update constants.py
kafitzgerald Jul 17, 2025
0ff309d
Merge pull request #261 from kprussing/develop
kafitzgerald Jul 17, 2025
683a5ec
Update subproducts.txt
halderm100 May 24, 2025
876b29c
Merge pull request #276 from halderm100/develop
kafitzgerald Jul 17, 2025
bb3d983
Bump conda-incubator/setup-miniconda from 3.1.1 to 3.2.0
dependabot[bot] Jul 17, 2025
6197c5a
Merge pull request #277 from NCAR/dependabot/github_actions/conda-inc…
kafitzgerald Jul 17, 2025
0940ff0
Add python 3.13 to CI and metadata
akrherz Jun 14, 2025
c69331b
Merge pull request #278 from akrherz/py313
kafitzgerald Jul 17, 2025
b9dbdd3
remove deprecated use of pkg_resources
kafitzgerald Jul 17, 2025
4c2e356
remove import as well
kafitzgerald Jul 17, 2025
cef7105
Merge pull request #281 from kafitzgerald/rm_pkg_resources
kafitzgerald Jul 18, 2025
24b4037
Bump actions/checkout from 4 to 5
dependabot[bot] Aug 12, 2025
efed1d3
Merge pull request #283 from NCAR/dependabot/github_actions/actions/c…
kafitzgerald Aug 12, 2025
c4563d3
Update docs to show lat lon labels and remove outdated note
kafitzgerald Aug 22, 2025
ba1f360
Merge pull request #285 from kafitzgerald/docs_latlon_labels
kafitzgerald Aug 22, 2025
5d7ad25
Bump actions/setup-python from 5 to 6
dependabot[bot] Sep 8, 2025
b3188dd
Merge pull request #289 from NCAR/dependabot/github_actions/actions/s…
kafitzgerald Sep 8, 2025
9313e05
Bump pypa/gh-action-pypi-publish from 1.12.4 to 1.13.0
dependabot[bot] Sep 8, 2025
127bce2
Merge pull request #288 from NCAR/dependabot/github_actions/pypa/gh-a…
kafitzgerald Sep 8, 2025
3616f0f
fix for netCDF4 v1.7.3 iterator changes
kafitzgerald Oct 21, 2025
72017e5
oops update the check to work for the older version of netcdf4
kafitzgerald Oct 22, 2025
2705aae
Merge pull request #291 from kafitzgerald/iter_bug
kafitzgerald Oct 29, 2025
6542224
Update Python version metadata to reflect support for 3.13 (#292)
kafitzgerald Oct 31, 2025
30b2e49
Release notes and version bump for v1.4.1 (#293)
kafitzgerald Nov 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "macos-latest", "macos-14" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: environment setup
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0
with:
python-version: ${{ matrix.python-version }}
channels: conda-forge
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
if: github.repository == 'NCAR/wrf-python'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install dependencies
Expand All @@ -28,9 +28,9 @@ jobs:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install dependencies
Expand All @@ -44,7 +44,7 @@ jobs:
run: |
python -m twine check dist/*
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
user: __token__
password: ${{ secrets.PYPI_WRF_PYTHON }}
Expand Down
3 changes: 1 addition & 2 deletions build_envs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: wrf_python_build
channels:
- conda-forge
dependencies:
- python>=3.9, <3.13
- python>=3.9, <3.14
- compilers
- basemap
- cartopy
Expand All @@ -12,7 +12,6 @@ dependencies:
- netcdf4
- numpy
- pycodestyle
- setuptools
- sphinx
- sphinx_rtd_theme
- sphinxcontrib-googleanalytics
Expand Down
2 changes: 1 addition & 1 deletion build_envs/platform-specific/macos_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: wrf_python_build
channels:
- conda-forge
dependencies:
- python<3.12
- python
- basemap
- cartopy
- clang_osx-arm64
Expand Down
2 changes: 1 addition & 1 deletion build_envs/platform-specific/macos_x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: wrf_python_build
channels:
- conda-forge
dependencies:
- python<3.12
- python
- basemap
- cartopy
- clang_osx-64
Expand Down
2 changes: 1 addition & 1 deletion build_envs/platform-specific/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ channels:
- conda-forge
- msys2
dependencies:
- python<3.12
- python
- basemap
- cartopy
- jupyter
Expand Down
6 changes: 3 additions & 3 deletions doc/source/_templates/subproducts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
+--------------------+----------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| mcin | cape_2d | 2D Max CIN | J kg-1 | **missing** (float): Fill value for output only |
+--------------------+----------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| lcl | cape_2d | 2D Lifted Condensation Level | J kg-1 | **missing** (float): Fill value for output only |
| lcl | cape_2d | 2D Lifted Condensation Level | m | **missing** (float): Fill value for output only |
+--------------------+----------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| lfc | cape_2d | 2D Level of Free Convection | J kg-1 | **missing** (float): Fill value for output only |
| lfc | cape_2d | 2D Level of Free Convection | m | **missing** (float): Fill value for output only |
+--------------------+----------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| cape3d_only | cape_3d | 3D CAPE | J kg-1 | **missing** (float): Fill value for output only |
+--------------------+----------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
Expand Down Expand Up @@ -116,4 +116,4 @@
| | | | kt | |
| | | | | |
| | | | ft s-1 | |
+--------------------+----------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
+--------------------+----------------------+---------------------------------------------------------------+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
9 changes: 9 additions & 0 deletions doc/source/new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ What's New
Releases
-------------

v1.4.1 (November 2025)
^^^^^^^^^^^^^^^^^^^^^^^^^

- Release 1.4.1
- Support for Python 3.13
- Fix to accommodate recent netCDF4 changes
- Remove pkg_resources
- Correct units for LCL and LFC in the subproduct diagnostics documentation

v1.4.0 (May 2025)
^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
8 changes: 4 additions & 4 deletions doc/source/plot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ should be aware of a few shortcomings when working with WRF data.
- The rotated pole projection requires the x and y limits to be set manually
using set_xlim and set_ylim.

- You can't place latitude and longitude labels on the axes when using
any projection other than Mercator or LatLon.


Plotting a Two-dimensional Field
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -89,7 +86,10 @@ Plotting a Two-dimensional Field
ax.set_ylim(cartopy_ylim(smooth_slp))

# Add the gridlines
ax.gridlines(color="black", linestyle="dotted")
gl = ax.gridlines(draw_labels=True, color="black", linestyle="dotted")
gl.right_labels = False
gl.x_inline = False
gl.top_labels = False

plt.title("Sea Level Pressure (hPa)")

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ maintainers = [
]
description = "Diagnostic and interpolation routines for WRF-ARW data."
readme = "README.md"
requires-python = ">=3.9, <3.13"
requires-python = ">=3.9, <3.14"
keywords = [
"python", "wrf-python", "wrf", "forecast", "model",
"weather research and forecasting", "interpolation",
Expand All @@ -30,6 +30,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Topic :: Software Development",
"Operating System :: POSIX",
Expand Down
21 changes: 2 additions & 19 deletions src/wrf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
from __future__ import (absolute_import, division, print_function)
import os
import pkg_resources

try:
from . import api
from .api import *
except ImportError:
# For gfortran+msvc combination, extra shared libraries may exist
# (stored by numpy.distutils)
if os.name == "nt":
req = pkg_resources.Requirement.parse("wrf-python")
extra_dll_dir = pkg_resources.resource_filename(req,
"wrf-python/.libs")
if os.path.isdir(extra_dll_dir):
os.environ["PATH"] += os.pathsep + extra_dll_dir

from . import api
from .api import *
else:
raise

from . import api
from .api import *

__all__ = []
__all__.extend(api.__all__)
6 changes: 5 additions & 1 deletion src/wrf/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ class ProjectionTypes(object):
np.dtype(np.uint32): 4294967295,
np.dtype(np.int64): Constants.DEFAULT_FILL_INT64,
np.dtype(np.uint64): 18446744073709551614,
np.dtype(np.float_): Constants.DEFAULT_FILL_DOUBLE,
np.dtype(np.float32): Constants.DEFAULT_FILL_FLOAT,
np.dtype(np.float64): Constants.DEFAULT_FILL_DOUBLE
}

try:
_DEFAULT_FILL_MAP[np.dtype(np.float_)] = Constants.DEFAULT_FILL_DOUBLE
except AttributeError:
pass

if version_info >= (3, ):
_DEFAULT_FILL_MAP[np.int_] = Constants.DEFAULT_FILL_INT64
else:
Expand Down
10 changes: 9 additions & 1 deletion src/wrf/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from types import GeneratorType
import datetime as dt
from inspect import getmodule
from netCDF4 import Dataset

try:
from inspect import signature
Expand Down Expand Up @@ -134,7 +135,14 @@ def is_multi_file(wrfin):
is a single NetCDF file object.

"""
return (isinstance(wrfin, Iterable) and not isstr(wrfin))
if isinstance(wrfin, Dataset):
is_iterable = False
elif isinstance(wrfin, Iterable):
is_iterable = True
else:
is_iterable = False

return (is_iterable and not isstr(wrfin))


def has_time_coord(wrfnc):
Expand Down
2 changes: 1 addition & 1 deletion src/wrf/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.4.0"
__version__ = "1.4.1"
2 changes: 1 addition & 1 deletion test/ci_tests/utests.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test(self):
# print (hts_850)
hts_850 = interplevel(hts, p, 850)

nt.assert_allclose(to_np(hts_850), ref_ht_850)
nt.assert_allclose(to_np(hts_850), ref_ht_850, rtol=1e-06)

elif (varname == "vertcross"):
ref_ht_cross = _get_refvals(referent, "vertcross", repeat, multi)
Expand Down
Loading