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

ck2yaml may pick incorrect file for validation tests #788

Closed
ischoegl opened this issue Jan 9, 2020 · 0 comments · Fixed by #792
Closed

ck2yaml may pick incorrect file for validation tests #788

ischoegl opened this issue Jan 9, 2020 · 0 comments · Fixed by #792

Comments

@ischoegl
Copy link
Member

ischoegl commented Jan 9, 2020

System information

  • Cantera version: 2.5.0a3 (easily reproducible after merge of [WIP] Commit yaml files #768)
  • OS: Ubuntu 18.04 (all?)
  • Python/MATLAB version: 3.6.8

Expected behavior

ck2yaml validates the file that is the output of the conversion.

Actual behavior

If there is a file with the same name on the data path, the latter is validated instead.

To Reproduce

Steps to reproduce the behavior:

  1. Copy argon.inp, gri30_thermo.dat, gri30_tran.dat into the working directory
  2. Run
ck2yaml --input=argon.inp --output=argon.yaml \
--thermo=gri30_thermo.dat --transport=gri30_tran.dat --name=argon
  1. See a deprecation warning raised, which stems from a hand-edited version of a file with the same name (on the data path).
DeprecationWarning: /usr/local/lib/python3.6/dist-packages/cantera/data/argon.yaml: The file 'argon.yaml' is deprecated and will be removed after Cantera 2.5. A nearly equivalent phase can be obtained from 'air.yaml'.

Additional context

Bug affects newly introduced example in #777 (and any user-generated YAML input file that happens to have the same name as one that already exists)

Loosely related comments

There are two undocumented options of ck2yaml: --quiet and --no-validate.

PS: on further inspection, this points to a bigger issue where the data search path for ct.Solution uses files in the data folder before considering local files.

speth added a commit to speth/cantera that referenced this issue Jan 11, 2020
Automatically adding the 'data' directory in the Cantera Python module to the
search path is helpful, but ends up putting that first on the search path,
instead of the current working directory, which should come first. Re-adding
'.' to the path makes that first again.

Fixes Cantera#788
speth added a commit to speth/cantera that referenced this issue Feb 5, 2020
Automatically adding the 'data' directory in the Cantera Python module to the
search path is helpful, but ends up putting that first on the search path,
instead of the current working directory, which should come first. Re-adding
'.' to the path makes that first again.

Fixes Cantera#788
speth added a commit that referenced this issue Mar 27, 2020
Automatically adding the 'data' directory in the Cantera Python module to the
search path is helpful, but ends up putting that first on the search path,
instead of the current working directory, which should come first. Re-adding
'.' to the path makes that first again.

Fixes #788
12Chao pushed a commit to 12Chao/cantera that referenced this issue Jun 2, 2020
Automatically adding the 'data' directory in the Cantera Python module to the
search path is helpful, but ends up putting that first on the search path,
instead of the current working directory, which should come first. Re-adding
'.' to the path makes that first again.

Fixes Cantera#788
srikanthallu pushed a commit to srikanthallu/cantera that referenced this issue Sep 17, 2020
Automatically adding the 'data' directory in the Cantera Python module to the
search path is helpful, but ends up putting that first on the search path,
instead of the current working directory, which should come first. Re-adding
'.' to the path makes that first again.

Fixes Cantera#788
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant