RMG-Py
RMG-Py copied to clipboard
Potential bug with pruning and pdep
Bug Description
I encountered an error message during pdep network exploration in an RMG job:
Traceback (most recent call last):
File "/home/mjliu/Code1/RMG-Py/rmg.py", line 173, in <module>
main()
File "/home/mjliu/Code1/RMG-Py/rmg.py", line 167, in main
rmg.execute(**kwargs)
File "/home/mjliu/Code1/RMG-Py/rmgpy/rmg/main.py", line 792, in execute
self.reactionModel.enlarge(objectToEnlarge)
File "/home/mjliu/Code1/RMG-Py/rmgpy/rmg/model.py", line 564, in enlarge
newReactions.extend(pdepNetwork.exploreIsomer(newSpecies))
File "/home/mjliu/Code1/RMG-Py/rmgpy/rmg/pdep.py", line 285, in exploreIsomer
raise Exception('Attempted to explore isomer {0}, but that species not found in product channels.'.format(isomer))
Exception: Attempted to explore isomer C1=CC2=C(C1)C2(7220), but that species not found in product channels.
The RMG log shows that this particular species was previously removed from the edge by thermodynamic pruning. This seems to suggest that the species was not properly removed from pdep networks, but as far as I can tell, thermo filtering calls removeSpeciesFromEdge
, which should be removing the species from all pdep networks. As such, it seems that something more subtle is going wrong.
How To Reproduce
This is the input file for the job I was running. The error occurred about 4.5 days into the simulation, so it is not super easy to debug with.
Expected Behavior
The species should be properly removed from all pdep networks.
Installation Information
Describe your installation method and system information.
- OS (include version if known): Ubuntu 18
- Installation method: from source
- RMG version information:
- RMG-Py: aromaticsTest branch
- RMG-database: aromaticsTest branch
After further investigation, I'm fairly certain that this is due to thermodynamic pruning not properly handling pdep networks.
For standard flux pruning, any species which have been explored as part of a pdep network are ineligible for pruning (see here.
However, thermodynamic pruning does not perform this check. As a result, species which have been explored can be removed. Removal is done by removeSpeciesFromEdge
, which does remove species from pdep networks and removes any path reactions containing the species. However, it does not modify net reactions, which are updated automatically by PDepNetwork.update
.
I think there are two potential solutions which result in different behavior.
- One option is to update thermodynamic pruning to perform the same check as flux pruning and not prune species which have been explored in pdep networks. This would retain consistent behavior between the two methods. Also, the decision to not prune these species was very intentional (150f0af88a6ede5ad9f2006377745ff744b7326c).
- The other option is to update pruning to also update net reactions once a species has been removed from the network. This would clearly have more significant effects on model generation, although it might be a valid approach if the assumption that the prune species will never be important is correct.
For now, I would recommend not using thermodynamic pruning together with pdep.
I think the first option makes the most sense here.
I am also getting this error for cO4
which is a globally forbidden and was removed during model gen:
Adding species cO4(812) to model core
Species cO4(812) was Forbidden and not added to Core...Removing from Edge.
Updating 0 modified unimolecular reaction networks (out of 1000)...
However, RMG later crashes with this error:
Traceback (most recent call last):
File "/scratch/westgroup/David/testing/RMG-Py/rmg.py", line 118, in <module>
main()
File "/scratch/westgroup/David/testing/RMG-Py/rmg.py", line 112, in main
rmg.execute(**kwargs)
File "/scratch/westgroup/David/testing/RMG-Py/rmgpy/rmg/main.py", line 914, in execute
self.reaction_model.enlarge(objectToEnlarge)
File "/scratch/westgroup/David/testing/RMG-Py/rmgpy/rmg/model.py", line 582, in enlarge
new_reactions.extend(pdep_network.explore_isomer(new_species))
File "/scratch/westgroup/David/testing/RMG-Py/rmgpy/rmg/pdep.py", line 283, in explore_isomer
raise Exception('Attempted to explore isomer {0}, but that species not found in product channels.'.format(isomer))
Exception: Attempted to explore isomer cO4(812), but that species not found in product channels.
Yay! I think I finally figured this out. I will open PR with fix
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.
This issue persist, I am getting:
Traceback (most recent call last):
File "/home/kfir/mambaforge/envs/rmg_env/lib/python3.7/site-packages/julia/pseudo_python_cli.py", line 308, in main
python(**vars(ns))
File "/home/kfir/mambaforge/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 "/home/kfir/mambaforge/envs/rmg_env/lib/python3.7/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/home/kfir/mambaforge/envs/rmg_env/lib/python3.7/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/home/kfir/mambaforge/envs/rmg_env/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/kfir/Code/RMG-Py//rmg.py", line 118, in <module>
main()
File "/home/kfir/Code/RMG-Py//rmg.py", line 112, in main
rmg.execute(**kwargs)
File "/home/kfir/Code/RMG-Py/rmgpy/rmg/main.py", line 995, in execute
self.reaction_model.enlarge(objectToEnlarge)
File "/home/kfir/Code/RMG-Py/rmgpy/rmg/model.py", line 642, in enlarge
new_reactions.extend(pdep_network.explore_isomer(new_species))
File "/home/kfir/Code/RMG-Py/rmgpy/rmg/pdep.py", line 285, in explore_isomer
raise Exception('Attempted to explore isomer {0}, but that species not found in product channels.'.format(isomer))
Exception: Attempted to explore isomer C1SN=C1(1019), but that species not found in product channels.
I do not perform pruning, so it can't be the same issue
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.