FlameBase.set_initial_guess calls removed SolutionArray.read_hdf without HDF support
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start in interfaces/cython/cantera/onedim.py at FlameBase.set_initial_guess, in the else branch after the if "native" in hdf_support() check, where SolutionArray.read_hdf is still called. Read how neighbouring code in the same file raises CanteraError for unsupported features so the wording matches. Done means the data="file.h5" path raises a CanteraError about needing HDF support instead of AttributeError; exercise it with the reproduction snippet and the onedim tests under test/python/.
Written by the indexing model from the issue text.
Description
Problem description
In a build without native HDF support, FlameBase.set_initial_guess(data="file.h5") calls SolutionArray.read_hdf (onedim.py, the else branch after if "native" in hdf_support()). That method no longer exists, so the call fails with AttributeError instead of a message that HDF support is required.
Steps to reproduce
Simulated with a native-HDF build:
import cantera as ct
import cantera.onedim
cantera.onedim.hdf_support = lambda: set() # as in a build without HDF support
gas = ct.Solution("h2o2.yaml")
f = ct.FreeFlame(gas, width=0.03)
f.set_initial_guess(data="restart.h5", group="restart")
Behavior
AttributeError: 'SolutionArray' object has no attribute 'read_hdf'. Expected: a CanteraError saying that HDF input requires Cantera compiled with HDF support.
System information
- Cantera version: 4.0.0a2,
mainat 25c1ab1 (built from source); also seen in 3.2.0 - OS: Linux x86_64 (glibc 2.43)
- Python 3.13.16, NumPy 2.5.4, Cython 3.3.1, SUNDIALS 7.2.0
Additional context
Found while writing tests for our own use of Cantera; the example was reduced and run by an AI coding agent (Claude Code), and checked against existing issues.
- Dominant language
- C++
- Stars
- 885
- Forks
- 438
- Avg merge
- 3h 41m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Cantera/cantera
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Names for cantera library in LibCantera.jl don't match built library names, preventing Julia cantera interface from loadingPossibly taken @redwing509 claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Incorrect reference state in some of the YAML files.Possibly taken @hazalkoom claimed this 61 days ago. OpenInput
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
Similar issues
-
std::fdim drops partial derivative w.r.t second argument in forward and reverse modePossibly taken @ADITYASINGH1206 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
vgvassilev/clad#2534 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
HAP.cpp fixOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100