You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/bryan/miniconda3/bin/ck2cti", line 6, in <module>
sys.exit(cantera.ck2cti.script_entry_point())
File "/home/bryan/miniconda3/lib/python3.6/site-packages/cantera/ck2cti.py", line 2299, in script_entry_point
main(sys.argv[1:])
File "/home/bryan/miniconda3/lib/python3.6/site-packages/cantera/ck2cti.py", line 2272, in main
permissive=permissive)
File "/home/bryan/miniconda3/lib/python3.6/site-packages/cantera/ck2cti.py", line 2204, in convertMech
self.parseTransportData(lines, transportFile, 1)
File "/home/bryan/miniconda3/lib/python3.6/site-packages/cantera/ck2cti.py", line 1952, in parseTransportData
self.speciesDict[speciesName].transport = TransportData(*data, comment=comment)
File "/home/bryan/miniconda3/lib/python3.6/site-packages/cantera/ck2cti.py", line 850, in __init__
if int(geometry) not in (0,1,2):
ValueError: invalid literal for int() with base 10: '1.00'
The error is because some of the geometry flags are specified as 1.00. In Python, parsing a string to an integer with the int object requires the string to be a representation of an integer, it doesn't cast a floating point string representation to an integer, and instead raises that ValueError. It would be nice if we handled this more gracefully, either by doing the casting ourselves or by raising a helpful error message.
(Reported by Kyle Linevitch at UConn)
The text was updated successfully, but these errors were encountered:
If floating point geometry flags are specified rather than integers, intercept the
ValueError raised by Python and raise a more sensible exception.
FixesCantera#446
If geometry flags are specified rather that can't be cast to integers,
intercept the ValueError raised by Python and raise a more sensible
exception.
FixesCantera#446
Cantera version
2.3.0
Operating System
Linux (but should apply to any)
Python/MATLAB version
Any
Expected Behavior
Parse attached transport data
Actual Behavior
Steps to reproduce
ck2cti --input=chem.txt --thermo=therm.txt --transport=tran.txt
The error is because some of the geometry flags are specified as
1.00
. In Python, parsing a string to an integer with theint
object requires the string to be a representation of an integer, it doesn't cast a floating point string representation to an integer, and instead raises thatValueError
. It would be nice if we handled this more gracefully, either by doing the casting ourselves or by raising a helpful error message.(Reported by Kyle Linevitch at UConn)
The text was updated successfully, but these errors were encountered: