feat: add a new ternary contour plot operator#4193
feat: add a new ternary contour plot operator#4193ELin2025 wants to merge 5 commits intoapache:mainfrom
Conversation
|
@ELin2025 For this PR, I’m seeing several changes that don’t seem related to the ternary contour plot work. Could we either remove those from this PR or move them into a separate branch/PR so they can be reviewed and explained more clearly? |
1894729 to
6d5252b
Compare
6d5252b to
1767b49
Compare
|
@Ma77Ball Just fixed the commits, should just be my files now |
Ma77Ball
left a comment
There was a problem hiding this comment.
Overall looks good. I left a few comments for discussion and resolution.
| val outputSchema = Schema() | ||
| .add("html-content", AttributeType.STRING) | ||
| Map(operatorInfo.outputPorts.head.id -> outputSchema) | ||
| Map(operatorInfo.outputPorts.head.id -> outputSchema) |
There was a problem hiding this comment.
@ELin2025 removed duplicate line: "Map(operatorInfo.outputPorts.head.id -> outputSchema)"
| pyb""" | ||
| |from pytexera import * | ||
| | | ||
| |import plotly.express as px |
There was a problem hiding this comment.
This line can be removed as it is not used.
There was a problem hiding this comment.
@ELin2025 removed "|import plotly.express as px" as it is not used in the operator
| def createPlotlyFigure(): PythonTemplateBuilder = { | ||
| pyb""" | ||
| | A = table[$firstVariable].to_numpy() | ||
| | B = table[$secondVariable].to_numpy() | ||
| | C = table[$thirdVariable].to_numpy() | ||
| | Z = table[$fourthVariable].to_numpy() | ||
| | fig = ff.create_ternary_contour(np.array([A,B,C]), Z, pole_labels=[$firstVariable, $secondVariable, $thirdVariable], interp_mode='cartesian') |
There was a problem hiding this comment.
The plotly ternary_contour requires scikit-image. This should be added to the operator-requirements.txt.
| operatorDescription = | ||
| "A ternary contour plot shows how a measured value changes across all mixtures of three components that always sum to a constant (usually 100%).", |
There was a problem hiding this comment.
There is also an info button that can be added to operators. I recommend using it for long descriptions.
0e551bd to
20aae0b
Compare
|
@Ma77Ball I have made the changes |
20aae0b to
ac7fd23
Compare
|
In the future, please respond to the comments and mention a little of what you did to address the issue after you can hit resolve comment at the bottom of each. This action helps with the review process. |
|
LGTM! @aicam, please review and approve the workflows and merge. |
|
@aicam Please review it. |
ac7fd23 to
fa4be85
Compare
de6e995 to
c15434d
Compare
c15434d to
689d988
Compare
What changes were proposed in this PR?
This change relates to the addition of a ternary contour plot operator, which visualizes how a scalar value varies as a function of three normalized components that sum to a constant (typically 1 or 100%).
In a ternary contour plot:
This visualization is useful for identifying regions where the output is optimized or insensitive to changes in the component proportions, as well as for understanding trade-offs between the three variables.
The operator takes in 4 inputs. The first three variables are the components, and the fourth variable is the output that corresponds to the proportion of the the three components.
Any related issues, documentation, discussions?
Needs python library scikit-image
Can be installed using: pip install scikit-image
How was this PR tested?
Tested with existing test cases
Was this PR authored or co-authored using generative AI tooling?
No