RMG-Py icon indicating copy to clipboard operation
RMG-Py copied to clipboard

Stop using (and maybe remove) the old Mopac from RMG's conda channel

Open rwest opened this issue 2 years ago • 2 comments

Via email from @godotalgorithm (thank you for reporting it, Jonathan!)

I'm maintaining MOPAC, which became an open-source project last year https://github.com/openmopac/mopac. I'm also maintaining MOPAC's availability on conda-forge https://anaconda.org/conda-forge/mopac. I noticed that you are distributing an older version of MOPAC that requires a license key on your conda channel (rmg), and I'm wondering if your software is tied in some way specifically to that version of MOPAC. If not, could you consider updating the version of MOPAC that you are distributing? There have been several reports now of people who have accidentally downloaded your version of MOPAC on conda and been confused by the need for a license key (which was removed from the open-source version). I'm trying to minimize such sources of confusion when possible.

Suggestion

  • [ ] change our environment file to use the conda-forge mopac
  • [ ] update RMG as needed to make this version work
  • [ ] update the github actions recipes on RMG-Py, RMG-database, and RMG-tests
  • [ ] change our conda recipe to use the conda-forge mopac
  • [ ] rebuild binaries
  • [ ] do something to warn/help people who inadvertently put the rmg channel as higher priority than the conda-forge channel and accidentally install the wrong one? options are remove our old one (but that makes it impossible for people to install old versions of RMG, which can be helpful for debugging); add a new one (but then this will gradually become out of date); replace with a dummy package that just prints something like "this is not the package you're looking for. use a different channel" and quits; other ideas?

Related issues

#2322 #2251

rwest avatar Aug 11 '22 13:08 rwest

I could attempt to migrate the development version of RMG-Py to the open-source version of MOPAC and switch the environment to point to the conda-forge version. I don't think too many adjustments are needed, mainly there is some logic looking for a MOPAC license key that is no longer relevant. Other projects under the ReactionMechanismGenerator org refer to MOPAC as well, but the changes outside of RMG-Py look even more minor.

If older versions of RMG depend on your MOPAC version on Conda, then by all means you shouldn't remove it. Part of the confusion is probably that your version of MOPAC presently has more total downloads since it has been available for about 7 years, and the open-source version has been available for less than 2 months. In time, the open-source version should accrue more total downloads and then people making hasty decisions based on number of downloads will pick the right version.

By the numbers, this isn't a big problem: the open-source version has almost 1k downloads already on the conda-forge channel, and I've only received support questions from 2 people so far who had accidentally downloaded it from the RMG channel.

godotalgorithm avatar Aug 12 '22 17:08 godotalgorithm

I could attempt...

If you have bandwidth to try this, pull requests are welcome! Else we'll probably get around to it eventually, now that this issue is open. I agree it doesn't sound like a big task.

rwest avatar Aug 12 '22 17:08 rwest

@rwest @godotalgorithm what would be the most appropriate way forward for me to use the open-source version of MOPAC in the meantime? I tried to replace the RMG-PY version of MOPAC with the open-source version. It runs. but crashes after many iterations. Is there a more effective way forward if we don't have the license for the one on the RMG channel?

Thank you in advance!

dylanrubini avatar Oct 21 '22 07:10 dylanrubini

If it runs, as you say, then I think you have solved the how to run it question?

What remains is why something crashes after many iterations. And for that we'd need more information to help. What type of crash? What error message? When? What situation?

rwest avatar Oct 21 '22 11:10 rwest

@rwest Thank you for your response! sorry for not providing the necessary information!

  • To get it to run with open source MOPAC I replaced all the files for the closed source MOPAC with the open source version
  • I ran the example 1-3,hexadiene pyrolysis file in the RMG-PY documentation. It was run as is (i.e., no changes to the file)
  • It does quantum calcs for 30 or so molecules before raising the exception shown below:
.....

Successful MopacMolPM3 quantum result in /datapart1/RDR/Aerodynamic-Chemistry-Coupling/0-D-Pure-Chemistry/Hexadiene/QMscratch/pm3/QMFJIJFIHIDENY-UHFFFAOYSA-N.out
Attempt 1 of 10 on species InChI=1S/C7H10/c1-7-5-3-2-4-6-7/h2-3,5H,4,6H2,1H3 succeeded.
Symmetry input file written to /datapart1/RDR/Aerodynamic-Chemistry-Coupling/0-D-Pure-Chemistry/Hexadiene/QMscratch/pm3/QMFJIJFIHIDENY-UHFFFAOYSA-N.symm
Point group: C1
Trying MopacMolPM3 attempt 1 of 10 on molecule CC1=CCC=CC1.
Successful MopacMolPM3 quantum result in /datapart1/RDR/Aerodynamic-Chemistry-Coupling/0-D-Pure-Chemistry/Hexadiene/QMscratch/pm3/QDXQAOGNBCOEQX-UHFFFAOYSA-N.out
Attempt 1 of 10 on species InChI=1S/C7H10/c1-7-5-3-2-4-6-7/h2-3,6H,4-5H2,1H3 succeeded.
Symmetry input file written to /datapart1/RDR/Aerodynamic-Chemistry-Coupling/0-D-Pure-Chemistry/Hexadiene/QMscratch/pm3/QDXQAOGNBCOEQX-UHFFFAOYSA-N.symm
Point group: Cs
Reading existing thermo file /datapart1/RDR/Aerodynamic-Chemistry-Coupling/0-D-Pure-Chemistry/Hexadiene/QMfiles/pm3/ZNKKYYNWFKHNHZ-UHFFFAOYSA-N.thermo
1 radicals on C7H9-39 exceeds limit of 0. Using HBI method.
Reading existing thermo file /datapart1/RDR/Aerodynamic-Chemistry-Coupling/0-D-Pure-Chemistry/Hexadiene/QMfiles/pm3/JFNLZVQOOSMTJK-UHFFFAOYSA-N.thermo
Traceback (most recent call last):
  File "/home/orie3565/anaconda3/envs/rmg_env4/bin/rmg.py", line 118, in <module>
    main()
  File "/home/orie3565/anaconda3/envs/rmg_env4/bin/rmg.py", line 112, in main
    rmg.execute(**kwargs)
  File "/home/orie3565/anaconda3/envs/rmg_env4/lib/python3.7/site-packages/rmgpy/rmg/main.py", line 673, in execute
    self.initialize(**kwargs)
  File "/home/orie3565/anaconda3/envs/rmg_env4/lib/python3.7/site-packages/rmgpy/rmg/main.py", line 496, in initialize
    self.load_database()
  File "/home/orie3565/anaconda3/envs/rmg_env4/lib/python3.7/site-packages/rmgpy/rmg/main.py", line 420, in load_database
    family.add_rules_from_training(thermo_database=self.database.thermo)
  File "/home/orie3565/anaconda3/envs/rmg_env4/lib/python3.7/site-packages/rmgpy/data/kinetics/family.py", line 1269, in add_rules_from_training
    reactant.thermo = thermo_database.get_thermo_data(reactant, training_set=True, metal_to_scale_to=metal)
  File "/home/orie3565/anaconda3/envs/rmg_env4/lib/python3.7/site-packages/rmgpy/data/thermo.py", line 1319, in get_thermo_data
    tdata = self.estimate_radical_thermo_via_hbi(molecule, quantum_mechanics.get_thermo_data)
  File "/home/orie3565/anaconda3/envs/rmg_env4/lib/python3.7/site-packages/rmgpy/data/thermo.py", line 2019, in estimate_radical_thermo_via_hbi
    thermo_data_sat = stable_thermo_estimator(saturated_struct)
  File "/home/orie3565/anaconda3/envs/rmg_env4/lib/python3.7/site-packages/rmgpy/qm/main.py", line 216, in get_thermo_data
    thermo0 = qm_molecule_calculator.generate_thermo_data()
  File "/home/orie3565/anaconda3/envs/rmg_env4/lib/python3.7/site-packages/rmgpy/qm/molecule.py", line 363, in generate_thermo_data
    self.qm_data = self.generate_qm_data()
  File "/home/orie3565/anaconda3/envs/rmg_env4/lib/python3.7/site-packages/rmgpy/qm/mopac.py", line 302, in generate_qm_data
    self.create_geometry()
  File "/home/orie3565/anaconda3/envs/rmg_env4/lib/python3.7/site-packages/rmgpy/qm/molecule.py", line 325, in create_geometry
    self.geometry.generate_rdkit_geometries()
  File "/home/orie3565/anaconda3/envs/rmg_env4/lib/python3.7/site-packages/rmgpy/qm/molecule.py", line 135, in generate_rdkit_geometries
    self.save_coordinates_from_rdmol(rdmol, min_e_id, rdatom_idx)
  File "/home/orie3565/anaconda3/envs/rmg_env4/lib/python3.7/site-packages/rmgpy/qm/molecule.py", line 173, in save_coordinates_from_rdmol
    point = rdmol.GetConformer(min_e_id).GetAtomPosition(atom.sorting_label)
ValueError: Bad Conformer Id

Let me know if I can provide you with any more information?

dylanrubini avatar Oct 21 '22 15:10 dylanrubini

As a further note:

  • I am using Linux and I am using the latest MOPAC version installed using conda forge:
mopac --version
# MOPAC version 22.0.4 commit 496df2cc92aa0c42dd391afe373cfd572d0c5e20

dylanrubini avatar Oct 21 '22 15:10 dylanrubini

I support this issue and the suggestions from @rwest.

I can confirm the error reported by @dylanrubini. The MOPAC features run fine for me when symlinked to the open source binary. The error occurs when rmgpy/qm/molecule.py attempts to read a successfully generated *.thermo file.

The modification required to fix this would fit into the second suggested bullet point in the original post.

acjoven avatar Nov 26 '22 05:11 acjoven

Thank @dylanrubini and @acjoven for testing!

According to my experience, the issue encountered by @dylanrubini doesn't seem to be MOPAC related. It is more of an RDKit Problem, and I tried to fix this in PR #2272. When looking at the error traceback, I found that you might not be using the latest branches (e.g., on main, save_coordinates_from_rdmol is at line 210 instead of line 173). Can you try to update your branch or cherry-pick the commits in PR #2272 to see if you still run into the same error?

xiaoruiDong avatar Dec 02 '22 18:12 xiaoruiDong