-
Notifications
You must be signed in to change notification settings - Fork 26
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
Function smact_validity slow #378
Comments
Thanks for raising this @PhilippHoellmer. That makes sense to me and is an easy win to make things faster. While the full composition list is useful in some contexts, I don't think it's necessary for this convenience function, especially as it's not even returned. Do you agree @AntObi? |
Yep, that all sounds good! Thanks for pointing that out @PhilippHoellmer! I should have some capacity to get this implemented this week! |
Thanks for the updates, @aronwalsh and @AntObi! |
@AntObi let me know if I can help on this, I can quickly draft a fix on Thursday since I'm working with the smact_validity function at the moment in my latest smact project! |
The
smact_validity
function insmact.screening
ends with a loop over the combinations of all possible oxidation states. Naturally, depending on the given composition, this loop can take a long time.From looking at the code, it seems like the loop will always run to the end:
I am wondering why this loop isn't broken directly when the first combination of oxidation states is found that passes both the charge-balance test and the electronegativity test? Why is the list
compositions
even constructed when, in the end, it only matters if a single element is found?I think the following end of the function should work as well and it has at least the possibility to cut the loop short:
The text was updated successfully, but these errors were encountered: