ReactionMechanismGenerator / RMG-Py

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

Unable to determine respresentative structures (resonance) #1578

Closed mefuller closed 5 years ago

mefuller commented 5 years ago

Bug Description

During mechanism generation, my RMG run comes to a screeching halt with the following behavior:

ResonanceError: Could not determine representative localized structures for species [O-][N+](=O)C1C=CC=CC=1[N]C1=CC=CC=C1

Traceback (most recent call last):
  File "/home/fuller/Documents/CFG Lab/RMG/RMG-Py/rmg.py", line 173, in <module>
    main()
  File "/home/fuller/Documents/CFG Lab/RMG/RMG-Py/rmg.py", line 167, in main
    rmg.execute(**kwargs)
  File "/home/fuller/Dropbox/Documents/CFG Lab/RMG/RMG-Py/rmgpy/rmg/main.py", line 664, in execute
    trimolecularReact=self.trimolecularReact)
  File "/home/fuller/Dropbox/Documents/CFG Lab/RMG/RMG-Py/rmgpy/rmg/model.py", line 679, in enlarge
    unimolecularReact, bimolecularReact, trimolecularReact=trimolecularReact)
  File "/home/fuller/Dropbox/Documents/CFG Lab/RMG/RMG-Py/rmgpy/rmg/react.py", line 143, in reactAll
    rxns = list(react(*spcTuples))
  File "/home/fuller/Dropbox/Documents/CFG Lab/RMG/RMG-Py/rmgpy/rmg/react.py", line 59, in react
    spcTuples)
  File "/home/fuller/Dropbox/Documents/CFG Lab/RMG/RMG-Py/rmgpy/scoop_framework/util.py", line 154, in map_
    return map(WorkerWrapper(args[0]), *args[1:], **kwargs)
  File "/home/fuller/miniconda2/envs/rmg_env/lib/python2.7/site-packages/scoop-0.7.2.0-py2.7.egg/scoop/fallbacks.py", line 49, in wrapper
  File "/home/fuller/Dropbox/Documents/CFG Lab/RMG/RMG-Py/rmgpy/scoop_framework/util.py", line 112, in __call__
    return self.myfn(*args, **kwargs)
  File "/home/fuller/Dropbox/Documents/CFG Lab/RMG/RMG-Py/rmgpy/rmg/react.py", line 75, in reactSpecies
    reactions = getDB('kinetics').generate_reactions_from_families(speciesTuple)
  File "/home/fuller/Dropbox/Documents/CFG Lab/RMG/RMG-Py/rmgpy/data/kinetics/database.py", line 521, in generate_reactions_from_families
    reaction_list = find_degenerate_reactions(reaction_list, same_reactants, kinetics_database=self)
  File "/home/fuller/Dropbox/Documents/CFG Lab/RMG/RMG-Py/rmgpy/data/kinetics/common.py", line 279, in find_degenerate_reactions
    rxn0.ensure_species()
  File "rmgpy/reaction.py", line 1110, in rmgpy.reaction.Reaction.ensure_species
  File "rmgpy/reaction.py", line 1130, in rmgpy.reaction.Reaction.ensure_species
  File "/home/fuller/Dropbox/Documents/CFG Lab/RMG/RMG-Py/rmgpy/data/kinetics/common.py", line 171, in ensure_species
    new_item.generate_resonance_structures(keep_isomorphic=keep_isomorphic)
  File "rmgpy/species.py", line 168, in rmgpy.species.Species.generate_resonance_structures
  File "rmgpy/species.py", line 178, in rmgpy.species.Species.generate_resonance_structures
  File "rmgpy/molecule/molecule.py", line 1831, in rmgpy.molecule.molecule.Molecule.generate_resonance_structures
  File "rmgpy/molecule/molecule.py", line 1833, in rmgpy.molecule.molecule.Molecule.generate_resonance_structures
  File "rmgpy/molecule/resonance.py", line 151, in rmgpy.molecule.resonance.generate_resonance_structures
  File "rmgpy/molecule/resonance.py", line 240, in rmgpy.molecule.resonance.generate_resonance_structures
  File "/home/fuller/Dropbox/Documents/CFG Lab/RMG/RMG-Py/rmgpy/molecule/filtration.py", line 76, in filter_structures
    mol_list[0].toSMILES()))
rmgpy.exceptions.ResonanceError: Could not determine representative localized structures for species [O-][N+](=O)C1C=CC=CC=1[N]C1=CC=CC=C1

How To Reproduce

I ma attaching my input script and my two additional libraries ResonanceErrorFiles.zip

Expected Behavior

These libraries have been used in the past (two years ago) to generate a similar mechanism, so I have no idea why this new error is occurring.

Installation Information

Describe your installation method and system information.

Additional Context

Add any other context about the problem here.

AH9316 commented 5 years ago

Hi, I think I meet a similar problem with you. Did you solve this issue?

mjohnson541 commented 5 years ago

@alongd @mliu49 can you guys take a look at this and #1598?

alongd commented 5 years ago

The website generates resonance structures for this case as well: [O-][N+](=O)C1C=CC=CC=1[N]C1=CC=CC=C1 image

alongd commented 5 years ago

@mefuller, PR #1600 should address this issue. Try updating RMG and let us know whether this is resolved.

mefuller commented 5 years ago

@alongd @mliu49 I pulled down the updates and rebuilt RMG per the documentation (https://reactionmechanismgenerator.github.io/RMG-Py/users/rmg/installation/updatingSourceCode.html , https://reactionmechanismgenerator.github.io/RMG-Py/users/rmg/installation/anacondaDeveloper.html)

After rebuild ('make') I am getting a segmentation fault on running 'make test'):

(rmg_env) [fuller@Zoe RMG-Py]$ make test mkdir -p testing/coverage rm -rf testing/coverage/ nosetests --nocapture --nologcapture --all-modules -A 'not functional' --verbose --with-coverage --cover-inclusive --cover-package=rmgpy --cover-erase --cover-html --cover-html-dir=testing/coverage --exe rmgpy arkane /home/fuller/Dropbox/Documents/CFG Lab/RMG/RMG-Py/rmgpy/molecule/init.py:33: RuntimeWarning: rmgpy.molecule.group.GroupAtom size changed, may indicate binary incompatibility. Expected 128 from C header, got 136 from PyObject from .molecule import Using Theano backend. /home/fuller/miniconda2/envs/rmg_env/lib/python2.7/site-packages/nose/importer.py:94: RuntimeWarning: rmgpy.molecule.group.GroupAtom size changed, may indicate binary incompatibility. Expected 128 from C header, got 136 from PyObject mod = load_module(part_fqname, fh, filename, desc) WARNING:root: Your MOPAC executable, Version: 17.240L, has expired. Please go to web-site: http://openmopac.net/Download_MOPAC_Executable_Step2.html to get a new version of MOPAC. Do NOT request a new license key. Academic license keys do not include time limits - the limit is in the program.

Could not import MUQ. Please check that it is installed correctly before using the global uncertainty modules. Test that after loading chemkin files, species such as N2, which is in the default ... ok This example tests if family and templates info can be correctly ... ok This example is mainly to ensure comments like ... ok Test that a Chemkin reaction with a specific species as a third body collider can be properly read ... ok Test that we can write to chemkin and recreate the same transport object ... ok Test that the official chemkin names are used as labels for the created Species objects. ... ok Test that we can properly mark duplicate reactions for Chemkin. ... WARNING:root:Marked reaction CC <=> [CH3] + [CH3] as duplicate of CC <=> [CH3] + [CH3] for saving to Chemkin file. WARNING:root:Marked reaction CC => C[CH2] + [H] as duplicate of CC => C[CH2] + [H] for saving to Chemkin file. WARNING:root:Marked reaction CC + [OH] <=> C[CH2] + O as not duplicate because of mixed pressure dependence for saving to Chemkin file. WARNING:root:Marked reaction O => [OH] + [H] as not duplicate because they are irreversible in opposite directions for saving to Chemkin file. ok Test that duplicate reactions are handled correctly when ... ok Test that invalid element count logs the appropriate warning. ... ok Test that missing temperature range can be handled for thermo entry. ... ok Test that non-float parameters log the appropriate warning. ... ok Test that non gas phase data logs the appropriate warning. ... ok Test that the degeneracy is picked up from reading reaction comments. ... ok Test that the family is picked up from reading reaction comments. ... ok Test that the template is picked up from reading reaction comments. ... ok tests that _removeLineBreaks functions properly ... ok Test the value of the atomic mass unit. ... ok Test the value of the Avogadro constant. ... ok Test the value of the Bohr radius. ... ok Test the value of the Boltzmann constant. ... ok Test the value of the electron rest mass. ... ok Test the value of the elementary charge constant. ... ok Test the value of the gas law constant. ... ok Test the value of the Hartree energy. ... ok Test the value of the neutron rest mass. ... ok Test the value of pi. ... ok Test the value of the Planck constant. ... ok Test the value of the proton rest mass. ... ok Test the value of the reduced Planck constant. ... ok Test the value of the speed of light in a vacuum. ... ok Test that we can constrain the max number of singlet carbenes. ... ok Test that we can constrain the max number of radical electrons with a carbene. ... ok Test that we can constrain the max number of carbon atoms. ... ok Test what happens when constraints are not loaded. ... ok Test that we can explicitly allow molecules in species constraints. ... ok Test that we can constrain the max number of heavy atoms. ... ok Test that we can constrain the max number of nitrogen atoms. ... ok Test that we can constrain the max number of oxygen atoms. ... ok Test that we can constrain the max number of radical electrons. ... ok Test that we can constrain the max number of silicon atoms. ... ok Test that failsSpeciesConstraints can handle a Species object. ... ok Test that we can constrain the max number of sulfur atoms. ... ok Test that nodes can match other nodes. ... ok Test that the MatchNodeToStructure family works properly. ... ok Test that we can load and check a forbidden group. ... ok Test that we can load and check a forbidden molecule. ... ok Test that we can load and check a forbidden species. ... ok Test the getBackboneRoots() function ... ok Test the getEndRoots() function ... ok Test the getTopLevelGroups() function ... ok Test that hydrogen addition to benzene (w/ benzene bonds) returns kekulized product. ... make: *** [Makefile:97: test] Segmentation fault (core dumped)

This is being run on a Fedora Linux system(Fedora 29) Should I cross-post this to PR #1600 since I'm not even to get back to a working installation?

alongd commented 5 years ago

Did you try make clean before rebuilding?

mefuller commented 5 years ago

I did not previously run 'make clean', but I now have prior to rerunning 'make' and that has allowed me to progress farther (perhaps some modification to the documentation to include notes about rebuilding could be made). I do still have some tests that are skipped and one that fails on 'make test':

====================================================================== FAIL: Test that getAllThermoData doesn't break when GAV fails.

Traceback (most recent call last): File "/home/fuller/Dropbox/Documents/CFG Lab/RMG/RMG-Py/rmgpy/data/thermoTest.py", line 439, in test_getAllThermoData_fails_quietly self.assertEqual(len(thermo), 1) AssertionError: 2 != 1

I am also unable to run 'make test-database' following 'make test', perhaps as a result of the failed 'make test'

mliu49 commented 5 years ago

Do you have a custom thermo library which contains an entry for [Ne]? If so, that would explain the test failure.

I'm not sure what you mean by unable to run make test-database. Does it not run at all, or is it failing?

mefuller commented 5 years ago

1) Yes,I do have a custom library with neon

2) 'make test-database' is failing on one of my custom libraries; without it, I pass the tests

3) I will try to fix my errors and will report back as to whether I encounter the same problem

mliu49 commented 5 years ago

Fixed by #1600