Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor issues in ck2yaml and test suite #1669

Merged
merged 2 commits into from
Feb 24, 2024
Merged

Conversation

ischoegl
Copy link
Member

@ischoegl ischoegl commented Feb 20, 2024

Fix glitch in test suite / improve exception handling

If applicable, fill in the issue number this pull request is fixing

Closes #1666, closes #1656

Illustration

Using the minimal example from #1656 (issue reporting unhelpful exception handling), the output is now

% python -m cantera.ck2yaml --thermo=test/data/surface2-thermo.dat --surface=test/data/surface2.inp

ERROR: Cannot specify a surface mechanism without a gas phase

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/homebrew/Caskroom/miniforge/base/envs/cantera-dev/lib/python3.11/site-packages/cantera/ck2yaml.py", line 2316, in <module>
    main()
  File "/opt/homebrew/Caskroom/miniforge/base/envs/cantera-dev/lib/python3.11/site-packages/cantera/ck2yaml.py", line 2199, in main
    parser, surfaces = Parser.convert_mech(input_file, thermo_file,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/miniforge/base/envs/cantera-dev/lib/python3.11/site-packages/cantera/ck2yaml.py", line 2051, in convert_mech
    raise InputError(msg)
InputError: Cannot specify a surface mechanism without a gas phase
Please check https://cantera.org/stable/userguide/ck2yaml-tutorial.html#debugging-common-errors-in-ck-files
for the correct Chemkin syntax.

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

@ischoegl ischoegl changed the title [unittest] Write output in work directory Fix minor issues in ck2yaml and test suite Feb 20, 2024
@ischoegl ischoegl added the Input Input parsing and conversion (for example, ck2yaml) label Feb 20, 2024
@ischoegl ischoegl requested a review from speth February 20, 2024 15:43
@ischoegl ischoegl marked this pull request as ready for review February 20, 2024 15:44
@ischoegl ischoegl requested review from a team and bryanwweber and removed request for speth February 21, 2024 03:06
@ischoegl ischoegl merged commit 80b308b into Cantera:main Feb 24, 2024
42 of 47 checks passed
@ischoegl ischoegl deleted the fix-1666 branch February 24, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Input Input parsing and conversion (for example, ck2yaml) Python
Projects
None yet
2 participants