Pourbaix: default to filter_solids=True #2177
Merged
+57
−27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Default
PourbaixDiagram
to usefilter_solids=True
for consistency with the MP website and discussion in #2173.In addition:
MaterialsProjectAqueousCompatibility
introduced by e8028b0PourbaixDiagram
and make a few type hinting fixes toEntry
classes (necessary to make mypy happy onPourbaixDiagram
).include_unprocessed_entries
kwarg toPourbaixDiagram.as_dict
. This was necessary in order to make serialization work properly after switching tofilter_solids=True
by default. To me, it appears this kwarg was a sort of workaround to allow a user to effectively decide whether to filter solids at the serialization / deserialization stage. In my mind, it makes more sense for the user to make that decision via thefilter_solids
kwarg when the diagram is constructed, then serialize thefilter_solids
kwarg along with all unprocessed entries always. I feel this is more consistent with the way I "expect" serialization to work. @montoyjh please comment if you have any concerns or had a specific reason for keeping this is a kwarg toas_dict
Closes #2173