{"action":"created","issue":{"url":"https://api.github.com/repos/ReactionMechanismGenerator/RMG-Py/issues/440","labels_url":"https://api.github.com/repos/ReactionMechanismGenerator/RMG-Py/issues/440/labels{/name}","comments_url":"https://api.github.com/repos/ReactionMechanismGenerator/RMG-Py/issues/440/comments","events_url":"https://api.github.com/repos/ReactionMechanismGenerator/RMG-Py/issues/440/events","html_url":"https://github.com/ReactionMechanismGenerator/RMG-Py/issues/440","id":102442082,"number":440,"title":"Redesigning Reaction classes","user":{"login":"nickvandewiele","id":242147,"avatar_url":"https://avatars.githubusercontent.com/u/242147?v=3","gravatar_id":"","url":"https://api.github.com/users/nickvandewiele","html_url":"https://github.com/nickvandewiele","followers_url":"https://api.github.com/users/nickvandewiele/followers","following_url":"https://api.github.com/users/nickvandewiele/following{/other_user}","gists_url":"https://api.github.com/users/nickvandewiele/gists{/gist_id}","starred_url":"https://api.github.com/users/nickvandewiele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickvandewiele/subscriptions","organizations_url":"https://api.github.com/users/nickvandewiele/orgs","repos_url":"https://api.github.com/users/nickvandewiele/repos","events_url":"https://api.github.com/users/nickvandewiele/events{/privacy}","received_events_url":"https://api.github.com/users/nickvandewiele/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-21T18:51:36Z","updated_at":"2015-08-22T22:22:06Z","closed_at":null,"body":"I am working on a PR that would drastically change the way we deal with Reaction objects. Right now, I find it very difficult to add new functionality to RMG ( e.g. parallelizing reaction generation) without breaking existing code. \r\n\r\nRMG uses many Reaction classes throughout its databases and ReactionModel's, and uses many different types of reactant/product classes (Molecule, Species, Group).\r\n\r\nMaybe one small step is to clearly define what each structure/reaction class should embody and how they should be used. \r\n\r\nHere's my trial. Comments are welcomed.\r\n\r\n# Molecular structures:\r\n\r\n- `rmgpy.molecule.molecule.Molecule` = a Graph with zero or more unspecified moieties (atoms, bonds, valencies), represents a single resonance isomer.\r\n- `rmgpy.species.Species` = a structure that can be represented by 1 or more resonance isomers (Molecule).\r\n- `rmgpy.molecule.group.Group` = a Graph with zero or more unspecified moieties (atoms, bonds, valencies), and one or more atoms labeled as reactive centers.\r\n\r\n# Reaction collections\r\n- `rmgpy.data.kinetics.library.Library` = a list of reactions put together as a collection based on the source (publication, mechanism, ...)\r\n\r\nFor example: Seed mechanisms can be used to create Library objects\r\n\r\n- `rmgpy.data.kinetics.depository.Depository` = a Library with all reactions belonging to one specific reaction family \r\nthat can be used to create additional rate rules. \r\n\r\nFor example: the NIST reactions for each reaction family is a depository\r\n\r\n\r\n## Reaction classes\r\n\r\n- `rmgpy.data.kinetics.library.LibraryReaction` = a reaction consisting of well-defined Species reactants and Species products, originating from a Library.\r\n- `rmgpy.data.kinetics.depository.DepositoryReaction` = a reaction consisting of well-defined Group reactants and Group products with zero unspecified moieties. Group reactants and products in a DepositoryReaction can be considered as Species objects with one or more atoms labeled as reactive centers. DepositoryReaction objects are collected in a Depository.\r\n- `rmgpy.data.kinetics.rules.RulesReaction` = a reaction consisting of one or more Group reactants, belonging to one specific reaction family. Products of a RulesReaction are not explicitly defined but computed based on the reaction family template and the reactive centers of the Group reactants. This class represents the (abstract) reaction associated with a rate rule.\r\n- `rmgpy.data.kinetics.family.TemplateReaction` = a reaction consisting of well-defined Species reactants and Species products, created based on the application of a reaction family. \r\n\r\n## Reaction classes that should only be alive as part of a Database object:\r\n- `rmgpy.data.kinetics.rules.RulesReaction`\r\n- `rmgpy.data.kinetics.depository.DepositoryReaction`\r\n\r\n## Reaction objects that should be part of a CoreEdgeReactionModel:\r\n- `rmgpy.data.kinetics.family.TemplateReaction`\r\n- `rmgpy.data.kinetics.library.LibraryReaction`\r\n\r\nIn this framework, the reactants or products of a reaction that is part of a growing reaction model should never be populated with Molecule objects, but always with Species objects. Likewise, reaction objects that live within a Database objects always use Group objects, never Molecule objects.\r\n\r\nMoreover, previously the template of a ReactionFamily would be stored as a reaction object. In the new design, this would be a new class, e.g. `rmgpy.data.kinetics.family.FamilyTemplate`\r\n\r\n\r\nThe biggest hiatus that remains is where `rmgpy.rmg.pdep.PDepReaction` exactly fits in. "},"comment":{"url":"https://api.github.com/repos/ReactionMechanismGenerator/RMG-Py/issues/comments/133759377","html_url":"https://github.com/ReactionMechanismGenerator/RMG-Py/issues/440#issuecomment-133759377","issue_url":"https://api.github.com/repos/ReactionMechanismGenerator/RMG-Py/issues/440","id":133759377,"user":{"login":"rwest","id":93807,"avatar_url":"https://avatars.githubusercontent.com/u/93807?v=3","gravatar_id":"","url":"https://api.github.com/users/rwest","html_url":"https://github.com/rwest","followers_url":"https://api.github.com/users/rwest/followers","following_url":"https://api.github.com/users/rwest/following{/other_user}","gists_url":"https://api.github.com/users/rwest/gists{/gist_id}","starred_url":"https://api.github.com/users/rwest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwest/subscriptions","organizations_url":"https://api.github.com/users/rwest/orgs","repos_url":"https://api.github.com/users/rwest/repos","events_url":"https://api.github.com/users/rwest/events{/privacy}","received_events_url":"https://api.github.com/users/rwest/received_events","type":"User","site_admin":false},"created_at":"2015-08-22T22:22:06Z","updated_at":"2015-08-22T22:22:06Z","body":"Thanks for this clarification post/discussion. It'll help people if we transfer this into \"developer documentation\" once finalized. Your original post says LibraryReaction should only be in a CoreEdgeReactionModel and not part of a Database object - but what about reaction libraries? What do they contain, if not LibraryReactions? They don't quite match your description of DepositoryReaction. "}}