-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-cat changes to master from cat branch, 1 #1538
Conversation
79caf96
to
08f6001
Compare
Codecov Report
@@ Coverage Diff @@
## master #1538 +/- ##
==========================================
- Coverage 42.01% 41.99% -0.03%
==========================================
Files 165 165
Lines 27873 27896 +23
Branches 5680 5680
==========================================
+ Hits 11711 11715 +4
- Misses 15377 15395 +18
- Partials 785 786 +1
Continue to review full report at Codecov.
|
Running locally I can reproduce the I.e. I think e074e0b, which attempted to follow the instructions at https://github.com/ReactionMechanismGenerator/RMG-Py/wiki/Simultaneous-Update-of-RMG-Py-and-RMG-database, does not work for the continuous-integration/rmg-tests (although it does work for the continuous-integration/travis-ci/pr and continuous-integration/travis-ci/push tests) Perhaps once ReactionMechanismGenerator/RMG-database#311 is merged to RMG-database, these tests can be re-run, and this PR reviewed and merged. |
The units fix has been merged to the master branch of RMG-database, so I've removed the commit that changed database branch, and am hoping this PR now passes the tests... |
rmgpy/data/kinetics/database.py
Outdated
reaction_list.extend(family.generateReactions(molecules, products=products, prod_resonance=prod_resonance)) | ||
except: | ||
print("Problem family: {}".format(label)) | ||
print("Problem reactants: {}".format(molecules)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to logging.error?
rmgpy/molecule/molecule.py
Outdated
@@ -1001,6 +1001,18 @@ def getNumAtoms(self, element = None): | |||
numAtoms += 1 | |||
return numAtoms | |||
|
|||
def getNumberOfRadicalElectrons(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate of getRadicalCount
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you removed it from master in 60bbcfd but that got lost in a rebase, and it ended up being added again here (just by virtue of not being removed). Will remove again.
rmgpy/molecule/draw.py
Outdated
self.coordinates[1, :] = [0.5, 0.0] | ||
return self.coordinates | ||
|
||
# Decide whether we can use RDKit or have to generate coordinates ourselves | ||
for atom in self.molecule.atoms: | ||
if atom.charge != 0: | ||
flag_charge = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be removed as well, since it is no longer used?
rmgpy/solver/simple.pyx
Outdated
@@ -154,6 +154,7 @@ cdef class SimpleReactor(ReactionSystem): | |||
initialMoleFractions[speciesDict[label]] = moleFrac | |||
self.initialMoleFractions = initialMoleFractions | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line break.
66a901a
to
b307642
Compare
I've made the changes suggested by @mliu49 and rebased. |
@rwest, do you think you could also add the unit checking database test to the kinetics depositories tests? I found a unit mistake which was picked up by RMG-tests, and I expect there might be others as well.
|
Good idea. Happy for you to add that if you have time before I do. |
Ok, I can do that this afternoon. |
I've added the unit test for kinetics depositories, which should cause Travis to fail until ReactionMechanismGenerator/RMG-database#312 is merged. |
@rwest, could you rebase this branch? I think it's ready to merge. I can also do it if you're busy, but I don't want to mess up the other cat branches. |
… graphs This is what's currently causing us a problem in RMG-Cat for van-der-Waals bonds, but this is a minimal test case to reproduce the problem in the vf2 algorithm. Unsure at this stage if it's reasonable to fix the vf2 algorithm or if we'll have to work around it at a higher level.
If you have two graphs [1-2-3 4] and [1-2-3 4] then you can show they're isomorphic OK, but if you search for all the subgraph isomorphisms, it crashed. Now if there are no terminal atoms to choose from in, it chooses pairs only from non-matched vertices, instead of all vertices. I also added some commentary from the original paper.
…ilies. Replace print() statements with logging.error() when loading bad reaction families.
Unless I misunderstood, I think this is clearer. (And if I did misunderstand, then it needs to be clearer!)
The idea is that if the object has units of 'm^3/mol/s' then but you want to get it in chemkin format you need the value in 'cm^3/mol/s'. This gives the factor required. Add a warning in docstring about potential bug.
This will allow us to do surface reactions with correct units. (Which will be implemented in a later commit) For gas-phase reactions, I put in a bunch of assert statements to check that the new implementation has the same effect as the old. If this is speed-critical code, they could be deprecated/removed.
Replaced the method getConversionFactorFromSItoCM which used to leave things like Molecules in their original form, with a new method getConversionFactorFromSItoCmMolS which converts everything into S (apart from length becomes cm). This means that all chemkin files are now written in CM/MOL/S combinations even if the original rate was in m3/molecules/minute. A few reaction libraries and training rules are stored in molecules instead of moles, but the chemkin file must be consistent.
When rotating by matrix algebra, we need to keep self.coondinates and coordinates pointing to the same numpy array, otherwise other things that reference or update one will not see or change the other. This commit just does the non-cat instance, so can be applied to master branch.
numSurfaceSpecies and numSurfaceReactions
These don't seem to be catalyst-specific. (Though will be helpful for ones that are)
Reduces the chances of passing the wrong thing by using positional arguments.
So far this does: - Arrhenius - Third Body - Falloff (Lindemann, Troe) - PDepArrhenius (PLOG) - MultiArrhenius - MultiPDepArrhenius in reaction libraries. This could also be done for other instances of kinetics (training depositories, etc.)
Make checkLibraryRateUnits more generic Add test definition for kinetics depositories
Motivation or Problem
This is a collection of commits that prepares the groundwork for merging the cat branch (heterogeneous catalysis). I think they don't have anything to do with heterogenous catalysis.
My hope of collecting them in a separate pull request is that it will make code review easier.
We could split this PR further if desired.
I am hoping that these will not be too controversial or at least will not break anything.
Description of Changes
So far...
Testing
This now passes all the automated tests.
I believe the codecov report is not getting all the cythonized stuff.