ReactionMechanismGenerator / RMG-website

A Django-powered website for Reaction Mechanism Generator (RMG)
Other
21 stars 29 forks source link

RMG Server Error for Convert Chemkin File #282

Closed SONO641 closed 3 months ago

SONO641 commented 3 months ago

I want to generate outputHTML page from Chemkin input file and Dictionary file but I got this error message: ImportError: cannot import name 'save_html_file' from 'rmgpy.chemkin' (/var/www/RMG-Py/rmgpy/chemkin.cpython-37m-x86_64-linux-gnu.so)

I also tried generateChemkinHTML.py, it works for example input file (ethane combustion) but not the file I have (which is from about 8 years ago), the error message is below. maybe format has been changed since then?

thanks!!

WARNING:root:Discarding comments from Chemkin file because not sure which reaction they apply to Traceback (most recent call last): File "/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/pseudo_python_cli.py", line 308, in main python(**vars(ns)) File "/opt/anaconda3/envs/rmg_env/lib/python3.7/site-packages/julia/pseudo_python_cli.py", line 59, in python scope = runpy.run_path(script, run_name="main") File "/opt/anaconda3/envs/rmg_env/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/opt/anaconda3/envs/rmg_env/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/opt/anaconda3/envs/rmg_env/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "generateChemkinHTML.py", line 82, in main(chemkin, dictionary, output, foreign) File "generateChemkinHTML.py", line 56, in main check_duplicates=foreign) File "rmgpy/chemkin.pyx", line 1027, in rmgpy.chemkin.load_chemkin_file File "rmgpy/chemkin.pyx", line 992, in rmgpy.chemkin.load_chemkin_file.parse_file File "rmgpy/chemkin.pyx", line 1019, in rmgpy.chemkin.load_chemkin_file.parse_file File "rmgpy/chemkin.pyx", line 1480, in rmgpy.chemkin.read_reactions_block File "rmgpy/chemkin.pyx", line 199, in rmgpy.chemkin.read_kinetics_entry File "rmgpy/chemkin.pyx", line 446, in genexpr File "rmgpy/chemkin.pyx", line 446, in genexpr IndexError: list index out of range

jonwzheng commented 3 months ago

Hello, I apologize for the issue. We are working on a PR to address some of these issues in #281. In the meantime, the Python script in RMG-Py, generateChemkinHTML.py, should be used as a work-around, as you identified.

Have you tried running generateChemkinHTML.py with the --f flag? If that doesn't fix it, could you please share your file with me, either on here or through emailing rmg_dev@mit.edu`?

SONO641 commented 3 months ago

thanks! I will send the files by email.

jonwzheng commented 3 months ago

Hi, thanks for sharing. I took a look at the files and identified the source of error:

SPC(2498) to SPC(2244) do not have adjacency lists in their RMG dictionary. These are necessary to provide information about the molecular structure to the labels you have provided. To do this, you can use the RMG website capabilities (https://rmg.mit.edu/molecule_search) or from RMG-Py to do this in batch if you have the SMILES strings.

I tried regenerating the HTML file by deleting any species without a dictionary entry, and then removing their related kinetics/thermo, and I was able to successfully use the generateChemkinHTML script. So this confirms that the only issue is with those entries.

I will mark this as resolved, but please feel free to leave any more comments if you have further questions.