Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
59407c6
Bump version to 3.2.1b1
speth Feb 21, 2026
073aaa5
[Python] Fix handling of derived Jacobian types (#2069)
speth Dec 17, 2025
de6a2eb
Fix slowdowns in sandboxed environments (#2086)
speth Feb 10, 2026
7d06fbe
[SCons] Add workaround for running sysctl in sandboxed environments (…
speth Feb 10, 2026
14699ea
[Thermo] Ensure PlasmaPhase EEDF array is initialized (#2068)
speth Jan 21, 2026
992c9a0
[Kinetics] Fix swapped items in getDerivativeSettings (#2069)
speth Dec 12, 2025
79f0034
Correct basis parameter description for mole fraction basis (#2079)
Jan 26, 2026
c037db5
[Python] Fix stubtest allow list (#2070)
speth Dec 24, 2025
e0a9fc4
[SCons] Add workaround for Cython coverage reporting with Python 3.12…
speth Dec 24, 2025
87a571a
[Python] Fix species slicing error with Numpy 2.4.0 dev version (#2063)
speth Dec 1, 2025
8ab6166
[Doc] Fix continuity equation (#2058)
g3bk47 Nov 25, 2025
d3fd18a
[SCons] Handle wheel renaming from specific setuptools versions (#2055)
speth Nov 22, 2025
bab22d3
[Python] Add workaround for older versions of typing_etensions (#2056)
speth Nov 22, 2025
b62b99d
[Python] Fix garbage collection error with Mixture objects (#2091)
speth Feb 20, 2026
3c80c3d
[Examples] Fix reservoir synchronization in surf_pfr_chain.py (#2069)
speth Feb 20, 2026
2e38b2f
[Reactor] Fix MoleReactor handling of multi-site surface species (#2093)
speth Feb 20, 2026
9666a77
[Reactor] Fix net surface mass flux calc in FlowReactor (#2069)
speth Feb 20, 2026
6f02be8
Update for mypy support of TypeForm (#2064)
TimothyEDawson Dec 4, 2025
bca597f
[CI] Ignore warnings from dependencies while running Python examples
speth Feb 20, 2026
634b584
[Doc] Add draft release notes for Cantera 3.2.1
speth Feb 21, 2026
bcc4bb2
[Python] Fix segfault calling get_state on network with FlowReactor (…
speth Mar 5, 2026
c0dbe50
[ck2yaml] Handle unusual spacing in surface species site occupancy (#…
speth Feb 19, 2026
a07eca1
[ck2yaml] Handle floats in extended elemental composition format (#2089)
speth Feb 19, 2026
881cd7f
[ck2yaml] Tolerate end-of-line whitespace in thermo entries (#2089)
speth Feb 19, 2026
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
1 change: 1 addition & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
echo "test/data/*.inp -diff" >> .gitattributes
echo "test/data/*.xml -diff" >> .gitattributes
echo "test/data/*.cti -diff" >> .gitattributes
echo "test/data/*.dat -diff" >> .gitattributes
echo "test_problems/**/*blessed* -diff" >> .gitattributes

git config --global core.autocrlf false
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ jobs:
name: >
${{ matrix.os }} with Python ${{ matrix.python-version }},
Numpy ${{ matrix.numpy || 'latest' }}, Cython ${{ matrix.cython || 'latest' }},
SCons ${{ matrix.scons || 'latest' }}
SCons ${{ matrix.scons || 'latest' }},
setuptools ${{ matrix.setuptools || 'latest' }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
Expand All @@ -41,6 +42,7 @@ jobs:
numpy: ['']
cython: ['!=3.1.2'] # Specifier can be dropped after 3.1.3 or 3.2.0 is released
scons: ['']
setuptools: ['']
include:
# Keep some test cases with NumPy 1.x until we drop support
- python-version: '3.12'
Expand All @@ -53,6 +55,7 @@ jobs:
os: 'ubuntu-22.04'
cython: "==0.29.31" # minimum supported version
scons: '==4.0.1' # minimum supported version
setuptools: "==75.7.0" # latest version that leaves package name uppercase
- python-version: '3.11'
os: 'ubuntu-22.04'
cython: "==3.0.8" # System version for Ubuntu 24.04
Expand Down Expand Up @@ -697,7 +700,7 @@ jobs:
# See https://unix.stackexchange.com/a/392973 for an explanation of the -exec part.
# Skip 1D_packed_bed.py due to difficulty installing scikits.odes.
# Increase figure limit to handle flame_speed_convergence_analysis.py.
# Skip examples for Python releases where pandas/pyarrow or CoolProp are not available
# Skip examples for Python releases where pandas/pyarrow or CoolProp are not available.
run: |
echo "Running on `cat /proc/cpuinfo | grep 'model name' | head -n 1 | cut -d ':' -f 2`"
ln -s libcantera_shared.so build/lib/libcantera_shared.so.3
Expand All @@ -722,9 +725,10 @@ jobs:
find samples/python -type f -iname "*.py" \
-exec sh -c 'for n; do echo "$n" | tee -a results.txt && python3 "$n" >> results.txt || exit 1; done' sh {} +
env:
# The pyparsing ignore setting is due to a new warning introduced in Matplotlib==3.6.0
# Ignore NasaPoly2 warnings from n-hexane-NUIG-2015.yaml
PYTHONWARNINGS: "error,ignore:warn_name_set_on_empty_Forward::pyparsing,ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning:,ignore:NasaPoly2:UserWarning:"
# Fail on warnings attributed to direct example usage while ignoring
# transitive dependency warnings.
# Ignore known Cantera NasaPoly2 warnings from n-hexane-NUIG-2015.yaml.
PYTHONWARNINGS: "ignore,error:::__main__,ignore:NasaPoly2:UserWarning:"
MPLBACKEND: Agg
- name: Save the results file for inspection
uses: actions/upload-artifact@v5
Expand Down Expand Up @@ -1256,8 +1260,8 @@ jobs:
# MATLAB requires a specific library name: libcantera_shared.so.X
# Recreating all symlinks to replicate status after build process
run: |
ln -s libcantera_shared.so libcantera_shared.so.3.2.0
ln -s libcantera_shared.so.3.2.0 libcantera_shared.so.3
ln -s libcantera_shared.so libcantera_shared.so.3.2.1
ln -s libcantera_shared.so.3.2.1 libcantera_shared.so.3
if: runner.os == 'Linux'
- name: Download the Cantera shared library (macOS)
uses: actions/download-artifact@v5
Expand All @@ -1270,8 +1274,8 @@ jobs:
# MATLAB requires a specific library name: libcantera_shared.X.Y.Z.dylib
# Recreating all symlinks to replicate status after build process
run: |
ln -s libcantera_shared.dylib libcantera_shared.3.2.0.dylib
ln -s libcantera_shared.3.2.0.dylib libcantera_shared.3.dylib
ln -s libcantera_shared.dylib libcantera_shared.3.2.1.dylib
ln -s libcantera_shared.3.2.1.dylib libcantera_shared.3.dylib
if: runner.os == 'macOS'
- name: Download the Cantera shared library (Windows)
uses: actions/download-artifact@v5
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ possible.
Development Site
================

The current development version is 3.3.0a1. The current stable version is
The current development version is 4.0.0a1. The current stable version is
3.2.0. The `latest Cantera source code <https://github.com/Cantera/cantera>`_,
the `issue tracker <https://github.com/Cantera/cantera/issues>`_ for bugs and
enhancement requests, `downloads of Cantera releases and binary installers
Expand Down
7 changes: 5 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ logger.info(
f"SCons {SCons.__version__} is using the following Python interpreter:\n"
f" {sys.executable} (Python {python_version})", print_level=False)

cantera_version = "3.2.0"
cantera_version = "3.2.1b1"
# For use where pre-release tags are not permitted (MSI, sonames)
cantera_pure_version = re.match(r'(\d+\.\d+\.\d+)', cantera_version).group(0)
cantera_short_version = re.match(r'(\d+\.\d+)', cantera_version).group(0)
Expand Down Expand Up @@ -1000,7 +1000,10 @@ def get_processor_name():
elif platform.system() == "Darwin":
os.environ['PATH'] = os.environ['PATH'] + os.pathsep + '/usr/sbin'
command ="sysctl -n machdep.cpu.brand_string"
return subprocess.check_output(command, shell=True).decode().strip()
try:
return subprocess.check_output(command, shell=True).decode().strip()
except subprocess.CalledProcessError:
return "<unknown processor>"
elif platform.system() == "Linux":
command = "lscpu || cat /proc/cpuinfo"
all_info = subprocess.check_output(command, shell=True).decode().strip()
Expand Down
2 changes: 1 addition & 1 deletion doc/doxygen/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = Cantera
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 3.2.0
PROJECT_NUMBER = 3.2.1b1

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
4 changes: 2 additions & 2 deletions doc/doxygen/versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
| Version | Status | Release Date |
|---------|--------|--------------|
| [dev/latest](https://cantera.org/dev/cxx/index.html) | unstable | -- |
| [v3.2.0](https://cantera.org/stable/cxx/index.html) | stable |*November 2025* |
| [v3.1.0](https://cantera.org/3.1/cxx/index.html) | stable |*December 2024* |
| [v3.2.0](https://cantera.org/3.2/cxx/index.html) | stable |*November 2025* |
| [v3.1.0](https://cantera.org/3.1/cxx/index.html) | legacy |*December 2024* |
| [v3.0.0](https://cantera.org/3.0/doxygen/html/index.html) | legacy | *August 2023* |
| [v2.6.0](https://cantera.org/2.6/doxygen/html/modules.html) | archived | *May 2022* |
| [v2.5.1](https://cantera.org/2.5/doxygen/html/modules.html) | archived | *February 2021* |
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/reference/onedim/governing-equations.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ in Section 7.2 of {cite:t}`kee2017` and are implemented by class {ct}`Flow1D`.

*Continuity*:

$$ \pxpy{u}{z} + 2 \rho V = 0 $$
$$ \pxpy{(\rho u)}{z} + 2 \rho V = 0 $$

*Radial momentum*:

Expand Down
27 changes: 27 additions & 0 deletions doc/sphinx/reference/releasenotes/v3.2.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# Cantera 3.2.1

*Unreleased*

This is a maintenance release which fixes issues identified since the release
of Cantera 3.2.0.

- Resolve some issues with Python type hinting related to `TypeForm` [#2064](https://github.com/Cantera/cantera/pull/2064)
- Fix net surface mass flux calculation in `FlowReactor` [#2069](https://github.com/Cantera/cantera/pull/2069)
- Fix handling of multi-site surface species in `MoleReactor` surfaces [#2093](https://github.com/Cantera/cantera/pull/2093)
- Fix reservoir synchronization in `surf_pfr_chain.py` [#2069](https://github.com/Cantera/cantera/pull/2069)
- Fix garbage collection error with `Mixture` objects [#2091](https://github.com/Cantera/cantera/pull/2091)
- Add workaround for older versions of `typing_extensions` [#2056](https://github.com/Cantera/cantera/pull/2056)
- Handle wheel renaming from specific setuptools versions [#2055](https://github.com/Cantera/cantera/pull/2055)
- Fix documentation for 1D flame continuity equation [#2058](https://github.com/Cantera/cantera/pull/2058)
- Fix species slicing error with Numpy 2.4.0 development version [#2063](https://github.com/Cantera/cantera/pull/2063)
- Add workaround for Cython coverage reporting with Python 3.12+ [#2070](https://github.com/Cantera/cantera/pull/2070)
- Fix stubtest allow list for Python type hinting [#2070]
https://github.com/Cantera/cantera/pull/2070- Correct the "basis" parameter description for mole fraction basis [#2079](https://github.com/Cantera/cantera/pull/2079)
- Fix swapped items returned by `Kinetics::getDerivativeSettings` [#2069](https://github.com/Cantera/cantera/pull/2069)
- Ensure `PlasmaPhase` EEDF array is initialized [#2068](https://github.com/Cantera/cantera/pull/2068)
- Add workaround for running macOS `sysctl` command via SCons in sandboxed environments [#2086](https://github.com/Cantera/cantera/pull/2086)
- Fix slowdowns in sandboxed environments due to repeated `locale` calls [#2086](https://github.com/Cantera/cantera/pull/2086)
- Fix errors related to handling of derived Jacobian types in Python [#2069](https://github.com/Cantera/cantera/pull/2069)
- Fix segfault when calling `ReactorNet.get_state` on networks containing `FlowReactor [#2098](https://github.com/Cantera/cantera/pull/2098)
- Handle some non-standard formatting in CK-format input files related to surface species site occupancy, extended elemental composition, and whitespace in thermo entries [#2089](https://github.com/Cantera/cantera/pull/2089)

# Cantera 3.2.0

Published on November 17, 2025 | [Full release on GitHub](https://github.com/Cantera/cantera/releases/tag/v3.2.0)
Expand Down
2 changes: 1 addition & 1 deletion interfaces/cython/.mypyignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cantera._types.*
# cantera\.((_|\w)+\.)+__(?!init__$)[a-zA-Z0-9_]*__

# Exclude specific dunder methods
cantera\.((_|\w)+\.)+__(.*cython|test|pyx_capi|mutable_keys|readonly_keys)__
cantera\.((_|\w)+\.)+__(.*cython|test|pyx_capi|mutable_keys|readonly_keys|conditional_annotations)__

# Current output of stubtest --generate-allowlist
cantera.Arrhenius.__init__
Expand Down
16 changes: 12 additions & 4 deletions interfaces/cython/SConscript
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""Cython-based Python Module"""
import re
from pathlib import Path
from packaging.specifiers import SpecifierSet
from packaging.version import parse as parse_version

from buildutils import (get_command_output, which, multi_glob,
from buildutils import (get_command_output, which, multi_glob, logger,
get_pip_install_location, setup_python_env)

Import('env', 'build', 'install')
Expand All @@ -26,6 +27,7 @@ if localenv["example_data"]:
install(localenv.RecursiveInstall, "$inst_sampledir/python", "#samples/python")

setup_python_env(localenv)
logger.info(f"Using setuptools version {localenv['setuptools_version']}")
# Python module shouldn't explicitly link to Python library (added in other cases to
# support Python-based extensions), except when using MinGW
if localenv["toolchain"] != "mingw":
Expand All @@ -40,7 +42,11 @@ localenv.Depends(license, localenv["license_target"])
directives = {"binding": True}
if env["coverage"]:
directives["linetrace"] = True
localenv.Append(CPPDEFINES={"CYTHON_TRACE": 1})
localenv.Append(CPPDEFINES={
"CYTHON_TRACE": 1,
# TODO: Remove after https://github.com/coveragepy/coveragepy/issues/1790 is resolved.
"CYTHON_USE_SYS_MONITORING": 0}
)

# Build the Python module
cython_obj = []
Expand Down Expand Up @@ -86,8 +92,10 @@ build_cmd = ("$python_cmd_esc -m pip wheel -v --no-build-isolation --no-deps "
if parse_version(localenv["py_version_short"]) >= env["python_max_version"]:
build_cmd += " --ignore-requires-python"

# Setuptools 75.3.1 and later always lowercase the package name
if localenv["setuptools_version"] >= parse_version("75.3.1"):
# Newer setuptools versions always lowercase the package name
spec1 = SpecifierSet(">=75.8.1")
spec2 = SpecifierSet("~=75.3.1") # change backported to this branch
if localenv["setuptools_version"] in spec1 or localenv["setuptools_version"] in spec2:
pkg_name = "cantera"
else:
pkg_name = "Cantera"
Expand Down
2 changes: 1 addition & 1 deletion interfaces/cython/cantera/_onedim.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ cdef class Sim1D:
:param compression:
Compression level (0-9); optional (default=0; HDF only)
:param basis:
Output mass (``Y``/``mass``) or mole (``Y``/``mass``) fractions;
Output mass (``Y``/``mass``) or mole (``X``/``mole``) fractions;
if not specified (`None`), the native basis of the underlying `ThermoPhase`
manager is used.

Expand Down
11 changes: 9 additions & 2 deletions interfaces/cython/cantera/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Any,
Concatenate,
Literal,
ParamSpec,
TypeAlias,
TypedDict,
TypeGuard,
Expand All @@ -18,7 +19,13 @@
import numpy as np
from numpy.typing import ArrayLike as ArrayLike
from numpy.typing import NDArray
from typing_extensions import ParamSpec, TypeForm
try:
# Requires typing_extensions >= 4.13, or possibly Python >= 3.15
from typing_extensions import TypeForm as TypeForm
except ImportError:
# Wrong, but better than crashing with an ImportError at runtime
from typing_extensions import Type as TypeForm


Array: TypeAlias = NDArray[np.float64]
Index: TypeAlias = EllipsisType | int | slice | tuple[EllipsisType | int | slice, ...]
Expand Down Expand Up @@ -194,7 +201,7 @@ def __init__(self, d: int, e: int, /, *args: Any, **kwargs: Any) -> None:
return lambda f: f


def literal_type_guard(tag: str, literal: TypeForm[_T0]) -> TypeGuard[_T0]: # type: ignore[valid-type]
def literal_type_guard(tag: str, literal: TypeForm[_T0]) -> TypeGuard[_T0]:
"""Utility function for narrowing strings to specified literals.

Typically used to check a string against the permissible keys of a
Expand Down
Loading
Loading