AtChem / AtChem2

Atmospheric chemistry box-model for the MCM
MIT License
59 stars 22 forks source link

using mech_converter with the mechanism_skel.fac #512

Closed mixtli-c closed 6 months ago

mixtli-c commented 7 months ago

Maybe there is something wrong with my installation (had to manually change python to python3 in the build .sh file and stuff like that) but the mech_converter.py was giving me an error for the very first element in the dictionary of the tokenise function (would throw a KeyError for 'k'). I used a mcm .fac that I already had for another AtChem2 install and the problem was gone.

Thought I would mention it here FYI.

All the best,

mixtli-c commented 7 months ago

Tried again with another installation (both were using WSL, one with opensuse and one with ubuntu) same error and same solution.

spco commented 7 months ago

Hi @mixtli-c . I would split this into 2 parts. The issue with python vs python3 is an issue in your environment - if you type python --version in your terminal you'll probably see it starts with a 2. You might be able to fix it by doing alias python=python3, but that's up to you and might affect other use-cases. Python2 has been out of support for nearly 4 years, so we don't support it explicitly.

Regarding the parsing error, are you able to share the .fac file you were trying to use, please? And did you open the .fac file in any Windows editors, before trying to use it? Windows can add extra line-endings that confuse things.

rs028 commented 7 months ago

Regarding python it is a bit odd because in theory the script is agnostic to the version. Perhaps we should cut to the chase and just drop v2 altogether (#415) to avoid any confusion.

Regarding the mechanism, please note that mechanism_skel.fac is just meant to illustrate the basic structure of a .fac file. It probably won't be processed properly by itself.

mixtli-c commented 7 months ago

Oh I see, I thought the mechanism_skel.fac was a skeleton mechanism to build atchem and run "out of the box". Nevermind then.

Re: python, some linux distros really separate python and python3 (like Arch it seems), some (like Ubuntu) alias it by default (again, it seems).

rs028 commented 7 months ago

What you are looking for is model/mechanism.fac but keep in mind it includes only inorganic chemistry plus methane.