-
Notifications
You must be signed in to change notification settings - Fork 23
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
Custom states #165
Custom states #165
Conversation
Codecov Report
@@ Coverage Diff @@
## master #165 +/- ##
==========================================
+ Coverage 72.71% 72.80% +0.08%
==========================================
Files 24 24
Lines 1913 1945 +32
==========================================
+ Hits 1391 1416 +25
- Misses 522 529 +7
|
Hi @AntObi - I am just curious, where would one set the list of oxidation states to be used in a typical workflow? |
Currently to use the other built-in oxidation states list, we can modify that example as follows: Original oxidation states call: # For each set of species (in oxidation states) apply both SMACT tests
for ox_a, ox_b, ox_c in product(
els[0].oxidation_states,
els[1].oxidation_states,
els[2].oxidation_states,
): To use the built in icsd oxidation states: # For each set of species (in oxidation states) apply both SMACT tests
for ox_a, ox_b, ox_c in product(
els[0].oxidation_states_icsd,
els[1].oxidation_states_icsd,
els[2].oxidation_states_icsd,
): Using the pymatgen structure prediction oxidation states in this example: # For each set of species (in oxidation states) apply both SMACT tests
for ox_a, ox_b, ox_c in product(
els[0].oxidation_states_sp,
els[1].oxidation_states_sp,
els[2].oxidation_states_sp,
): I've originally made this pull request with the built-in If we want to have a similar API for making these calls, then I could make a new attribute for the |
Thanks @AntObi - that is very clear. I understand now. I was struggling to see how this would be accessed. But I think that implementing in the |
Hi @AntObi sorry I just realised I was commenting from the wrong account! Anyway, there appears to be one conflict to resolve then it can be merged. |
Hi @keeeto, I've made some more changes: The Example: import smact
Fe = smact.Element("Fe", oxi_states_custom_filepath = "/path/to/oxidation_states.txt")
print(Fe.oxidation_states_custom) I've also updated the So for the solar oxides example, you would apply the following changes: Instead of all_el = smact.element_dictionary() You would create the dictionary of all elements with a supplied oxidation states text file: all_el = smact.element_dictionary(oxi_states_custom_filepath = "/path/to/oxidation_states.txt") Then the oxidation states call in the smact_filter function defined in that particular example becomes: # For each set of species (in oxidation states) apply both SMACT tests
for ox_a, ox_b, ox_c in product(
els[0].oxidation_states.custom,
els[1].oxidation_states.custom,
els[2].oxidation_states.custom,
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good to me!
Custom oxidation states call
Description
smact_filter
to use a custom oxidation state listisort
andblack
Fixes #164
Type of change
How Has This Been Tested?
smact_filter
works by passing an oxidation states text file to theoxidation_states_set
argumentTest Configuration:
Reviewers
@keeeto I've added the feature you've requested. I want to check if you're happy with the implementation before I merge it into the master branch
Checklist: