ck2yaml: IndexError on an empty THERMO section in the input file
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Start by reading parse_nasa7_section in ck2yaml.py around line 952, where the traceback shows the failing access to the empty THERMO section. Reproduce with the provided chem.inp and therm.dat using the documented python -m cantera.ck2yaml command. Done when the empty section is ignored or produces a regular input error instead of an uncaught IndexError.
Written by the indexing model from the issue text.
Description
ck2yaml stops with an uncaught IndexError when the input file has an empty THERMO section (THERMO followed directly by END) and the thermo data is given in a separate --thermo file.
Steps to reproduce
chem.inp:
ELEMENTS
H
END
SPECIES
H H2
END
THERMO
END
REACTIONS
H + H + M = H2 + M 1.0E18 -1.0 0.0
END
therm.dat:
THERMO
300.000 1000.000 5000.000
H SYNTH H 1 G 300.000 5000.000 1000.00 1
2.50000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 2
2.50000000E+04 5.00000000E-01 2.50000000E+00 0.00000000E+00 0.00000000E+00 3
0.00000000E+00 0.00000000E+00 2.50000000E+04 5.00000000E-01 4
H2 SYNTH H 2 G 300.000 5000.000 1000.00 1
3.50000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 2
-1.00000000E+03-3.00000000E+00 3.50000000E+00 0.00000000E+00 0.00000000E+00 3
0.00000000E+00 0.00000000E+00-1.00000000E+03-3.00000000E+00 4
END
python -m cantera.ck2yaml --input=chem.inp --thermo=therm.dat --output=out.yaml
Behavior
File ".../ck2yaml.py", line 952, in parse_nasa7_section
TintDefault = float(lines[1, 2].split()[1])
IndexError: list index out of range
parse_nasa7_section reads the second line of the section as the temperature line, but the section has no second line. Expected: the empty section is ignored, or a regular input error is reported.
System information
- Cantera 3.2.0 (Python 3.13, Linux); also reproduced with
ck2yaml.pyofmainat 25c1ab1 (line 952).
- 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 1/5 Under an hour Newbie friendliness 88/100
-
FlameBase.set_initial_guess calls removed SolutionArray.read_hdf without HDF supportPossibly taken @MTewari13 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
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 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
useless statementOpen
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
grizzlypeak3d/DJV#962 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
cognizant-backlog
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
KhronosGroup/OpenCL-CTS#2882 · 1 comment ·
Maintainers usually reply within 1 day