ReactionMechanismGenerator / RMG-Py

Python version of the amazing Reaction Mechanism Generator (RMG).
http://reactionmechanismgenerator.github.io/RMG-Py/
Other
396 stars 228 forks source link

typo prevents writing input files #2531

Open sevyharris opened 1 year ago

sevyharris commented 1 year ago

Bug Description

I'm trying to read, edit, and write RMG input files using the rmgpy.rmg.input module, but the writing portion gives me the following error:

Traceback (most recent call last):
  File "edit_input_file.py", line 14, in <module>
    rmgpy.rmg.input.save_input_file(new_input_file, rmg0)
  File "/home/moon/rmg/RMG-Py/rmgpy/rmg/input.py", line 1665, in save_input_file
    if rmg.surfaceSiteDenisty or rmg.binding_energies:
AttributeError: 'RMG' object has no attribute 'surfaceSiteDenisty'

There's obviously the misspelled word. I think the attribute is supposed to be surface_site_density. I'm running into some other issues with this module (can't write files with a temperature range, using this module is painfully slow because of the hidden and unnecessary Julia dependency), and will try adding a few unit tests to cover my tracks here.

How To Reproduce

This is my Python script for reproducing the error (input.py is the superminimal example):

import os
import rmgpy.rmg.input
import rmgpy.rmg.main

# reset with  cp ~/rmg/RMG-Py/examples/rmg/superminimal/input.py .
my_input_file = os.path.join('input.py')

rmg0 = rmgpy.rmg.main.RMG()
rmgpy.rmg.input.read_input_file(my_input_file, rmg0)

print('read RMG input file')

new_input_file = 'new_input.py'
rmgpy.rmg.input.save_input_file(new_input_file, rmg0)
print('wrote RMG input file')

Expected Behavior

It'd be really convenient to be able to use the RMG API to edit input files. I expected to be able to read and write the simplest input file without any errors.

Installation Information

Describe your installation method and system information.

github-actions[bot] commented 11 months ago

This issue is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant issue, otherwise it will automatically be closed in 30 days.

JacksonBurns commented 5 months ago

I'm running into some other issues with this module (can't write files with a temperature range, using this module is painfully slow because of the hidden and unnecessary Julia dependency), and will try adding a few unit tests to cover my tracks here.

We are getting close to merging #2631 which would resolve at least the slow part! Might want to rebase your ongoing PR after we merge that one to simplify development.

sevyharris commented 5 months ago

I'm running into some other issues with this module (can't write files with a temperature range, using this module is painfully slow because of the hidden and unnecessary Julia dependency), and will try adding a few unit tests to cover my tracks here.

We are getting close to merging #2631 which would resolve at least the slow part! Might want to rebase your ongoing PR after we merge that one to simplify development.

That's excellent news!

github-actions[bot] commented 2 months ago

This issue is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant issue, otherwise it will automatically be closed in 30 days.