Skip to content
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

Ordering of species in reaction is nondeterministic #409

Closed
connie opened this issue Jul 8, 2015 · 2 comments
Closed

Ordering of species in reaction is nondeterministic #409

connie opened this issue Jul 8, 2015 · 2 comments

Comments

@connie
Copy link
Member

connie commented Jul 8, 2015

When a reaction string is printed in Chemkin in different jobs, the ordering in which they are listed gets jumbled. For instance in 2 jobs, I can get:

CH3(17)+CH3(17)=H(2)+C2H5(27)                       7.845e+12 0.100     10.600   

and

CH3(17)+CH3(17)=C2H5(27)+H(2)                       7.845e+12 0.100     10.600  

Which are identical except for the ordering. This is correct but makes it difficult for the user when one has to search multiple permutations of a single reaction to identify it. I think we should try to make str(reaction) print the species in order of index.

@rwest
Copy link
Member

rwest commented Jul 8, 2015

#388 may be relevant here

@mliu49
Copy link
Contributor

mliu49 commented Dec 4, 2019

Species sorting now uses comparison methods (implemented in 0c0c7ed), which use the new sorting_key property (implemented in c90c407). This will provide deterministic sorting, although the current implementation depends on the species label and index, which can change depending on thermo libraries and the order that species are generated.

In cases like this, where the indices are the same, this will guarantee deterministic results.

@mliu49 mliu49 closed this as completed Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants