Reverse pourbaix component#530
Draft
zccalka wants to merge 15 commits intomaterialsproject:mainfrom
Draft
Conversation
…app about filter_solids
for more information, see https://pre-commit.ci
…toolkit into reverse_pourbaix
minhsueh
requested changes
May 5, 2026
| return float(value) | ||
|
|
||
|
|
||
| def _snap_to_grid(ph: float, v: float) -> tuple[int, float]: |
Collaborator
There was a problem hiding this comment.
It seems like _resolve_cutoff and _snap_to_grid are closely related to ReversePourbaixDiagramComponent. Is there a reason not to put them in the ReversePourbaixDiagramComponent as static methods like _format_cutoff_key?
| CUTOFF_STEP = 0.1 | ||
|
|
||
|
|
||
| def _resolve_cutoff(value) -> float: |
Collaborator
There was a problem hiding this comment.
It would be better to have a specific input type, either float or List[float]. I would prefer float, since if the input is a list, we only take the first element; we should handle this logic in the calling place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Adds a reverse Pourbaix component and example app for demoing the new feature.
Context
This is a demo branch for the reverse pourbaix app. This is che component used for the web implimentation.
Changes
ReversePourbaixcomponent (crystal_toolkit/components/reverse_pourbaix.py)crystal_toolkit/apps/examples/reverse_pourbaix_example.py)reverse_pourbaix_heatmap.json)components/__init__.pyPrecomputed heatmap data is included in commit. Will be updated with up-to-date data later.
Status
Demo/draft. I will make a PR on web for the web implementation that makes this component.
How to view
Full example should be accessed form web.
@minhsueh please take look when you have a chance.