Skip to content

new rxn name ordering => more robust pes/subpes/channel assignment #295

@lpratalimaffei

Description

@lpratalimaffei

Every time we read a mechanism, we assign (from mechdriver by default, or when sorting for e.g., generating prompt reactions) a pes.subpes.chnl sorting. if the comments are written in the form "# pes.subpes.channel", then no resorting is made.
In any case,
the pes are ordered by formula

def count_atoms(fml_list):

while the reactions within a pes and a subpes (i.e., the ubpes and channels) are only reordered by "reaction name"
peslist = peslist.sort_values(by=['rxn_names'])

this means that the value of the subpes and channels will depend on how the reaction is written (A+B=C, B+A=C will be ordered differently).

So what I would like to do is to try and make the subpes/channel sorting independent on how the reaction is written in the mechanism and order reactants and products according to this function, already used in the sorter for other purposes:

rct_names_lst_ordered = order_rct_bystoich(

def order_rct_bystoich(rct_names_lst, spc_dct=None):

where names of bimol reactions are arranged according to the formulas, and only then according to e.g., alphabetical order. so I would rewrite reaction strings and keys according to this classification. And I should also edit the criterion used within this function to make it consistent with the count_atoms used for the pes instead of the total atom counting that is currently done (
atoms_rct = list(map(atom_count, fml_rct))
)

Hopefully this would reduce the number of entries in the dataframe of the sorter, make it a bit simpler, and increase consistency/robustness. However, this would imply that the reaction lines might be re-written differently from what the user has in the input of mechanism.dat, which is instead debatable. One could probably use the "# pes.subpes.channel" also to avoid the resorting of reaction names. Or alternatively, I could implement consistent re-ordering for subpes/channel assignment but without changes to the reaction names so that they are consistent with the input by the user.

what do you think about this?

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions