Conversation
Bump the runtime to Python 3.14, mirroring ARC: - environment.yml: python =3.14, cython >=3.1, rdkit >=2026.03 - pyproject.toml: requires-python >=3.14, ruff target-version py314 Add the danagroup channel for openbabel and py-rdl, which have no py314 builds on conda-forge (the same builds ARC uses). cantera stays a loose >=3.2.0 core dep (conda-forge has a py314 build). CI: drop the now-redundant install_pyrdl.sh step (py-rdl is provided by environment.yml) and check out RMG-Py main for rmg_env (the xTB feature is merged upstream). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cantera's Solution.__getitem__ with a list of species names sets selected_species, which calls ndarray.resize(); numpy 2.x rejects this with "cannot resize an array that may be referenced by another object", breaking every cantera simulation (batch + PFR) on the Python 3.14 stack. Index the full mole-fraction array via species_index instead, which is equivalent (species_names_list is the full model species set) and avoids the resize path. Applied to the batch base adapter and both PFR adapters. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
List/Dict/Tuple -> list/dict/tuple, Optional[X] -> X | None, Union[X, Y] -> X | Y, and drop the now-unused typing imports (ruff UP006/UP007/UP035/UP045 + F401). ~500 annotation rewrites. `ruff check .` passes under target-version py314. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Update the Python badge and the Prerequisites line from 3.12+ to 3.14+. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Upgrades T3’s supported runtime to Python 3.14, modernizes type annotations to PEP 585/604, and includes a Cantera/Numpy 2.x compatibility fix in the simulation adapters, along with corresponding environment/CI/docs updates.
Changes:
- Bump declared Python support to 3.14 (packaging + conda env + docs + ruff target version).
- Update many type hints to built-in generics and
X | Noneunions. - Fix Cantera adapter species mole-fraction collection to avoid Numpy 2.x
resize()refcheck failures.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_utils/test_libraries.py | Update typing annotations to built-in generics. |
| tests/test_logger.py | Replace Optional[...] hints with `X |
| tests/common.py | Modernize optional type hints. |
| t3/utils/rmg_shim.py | Remove legacy typing imports; modernize hints across shim dataclasses/APIs. |
| t3/utils/rmg_sa_parser.py | Modernize return/variable annotations to built-in generics. |
| t3/utils/libraries.py | Modernize typing and dict/list annotations; lock/util signatures updated. |
| t3/utils/flux.py | Update function signatures and typing to built-in generics/PEP 604. |
| t3/utils/fix_cantera.py | Modernize typing for traceback/duplicate-reaction helpers. |
| t3/utils/cantera_parser.py | Modernize typing for YAML parsing helpers. |
| t3/simulate/rmg_constant_tp.py | Update adapter typing annotations (observables, SA return types). |
| t3/simulate/factory.py | Update adapter registration/factory typing (type[...], `X |
| t3/simulate/cantera_pfr.py | Change species mole-fraction indexing to avoid Cantera __getitem__ path. |
| t3/simulate/cantera_pfr_t_profile.py | Same Cantera mole-fraction indexing adjustment as other adapters. |
| t3/simulate/cantera_base.py | Apply the Cantera/Numpy 2.x-safe mole-fraction indexing in base simulate loop. |
| t3/schema.py | Modernize Pydantic model field type annotations to PEP 604/built-in generics. |
| t3/runners/rmg_runner.py | Modernize runner function annotations and return types. |
| t3/runners/rmg_incore_sa.py | Update return typing to built-in generics. |
| t3/main.py | Modernize optional and collection type hints. |
| t3/logger.py | Update typed container annotations for log helpers. |
| t3/common.py | Modernize typing; update helper signatures/return types. |
| t3/chem.py | Modernize typing in core Species/Reaction wrappers. |
| README.md | Update Python version badge and prerequisites to 3.14+. |
| pyproject.toml | Set requires-python >=3.14 and ruff target-version = py314. |
| environment.yml | Pin python to 3.14, bump deps, add danagroup channel and packages. |
| .github/workflows/ci.yml | Point RMG-Py checkout to main and remove redundant PyRDL install step. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
|
|
||
| def check_race_condition(race_path: str, logger: Optional["Logger"] = None) -> bool: | ||
| def check_race_condition(race_path: str, logger: "Logger" | None = None) -> bool: |
| def load_rmg_species_dictionary_file( | ||
| dict_path: str, | ||
| logger: Optional["Logger"] = None, | ||
| logger: "Logger" | None = None, | ||
| *, |
| def get_species_by_label(label: str, | ||
| species_list: list['T3Species'], | ||
| ) -> Optional['T3Species']: | ||
| ) -> 'T3Species' | None: | ||
| """ |
| def run_arkane_job(input_file: str, | ||
| output_directory: str, | ||
| plot: bool = False, | ||
| logger: Optional['Logger'] = None, | ||
| logger: 'Logger' | None = None, | ||
| ) -> bool: |
The ruff UP045 sweep turned Optional["Logger"] into the partially-quoted
union "Logger" | None, which evaluates str.__or__(None) -> TypeError if
the annotation is ever introspected (get_type_hints / pydantic / inspect).
Python 3.14 defers annotation evaluation so import doesn't crash, but the
form is still invalid. Quote the entire union ("Logger | None",
'T3Species | None') so it resolves correctly for TYPE_CHECKING forward refs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
RMG main now writes the chemkin-translated model to RMG/cantera_from_ck/chem_annotated.yaml instead of RMG/cantera/. Point set_paths at the new location and migrate the committed test fixtures to match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #171 +/- ##
==========================================
- Coverage 72.37% 72.08% -0.29%
==========================================
Files 35 35
Lines 4727 4678 -49
Branches 998 998
==========================================
- Hits 3421 3372 -49
Misses 968 968
Partials 338 338
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Rebased idt onto main (post py314 merge, PR #171). Integration fixes: - rmg_runner.fix_cantera_model_files: read RMG cantera output from 'cantera_from_ck/' instead of 'cantera/' (main moved it in 9aa5fb0) - migrate IDT test fixtures iteration_{0..4}/RMG/cantera -> cantera_from_ck to match the new layout - modernize idt type hints to PEP 585/604 (main removed the typing imports the idt code relied on, surfacing F821) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bumps T3 to Python 3.14.
Changes
builds on conda-forge.
Switched to indexing the full mole-fraction array (batch + both PFR adapters).