Re: [PR] feat: add a new ternary contour plot operator [texera]
Ma77Ball commented on PR #4193: URL: https://github.com/apache/texera/pull/4193#issuecomment-3953731481 LGTM @aicam please review -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] feat: add a new ternary contour plot operator [texera]
ELin2025 commented on PR #4193: URL: https://github.com/apache/texera/pull/4193#issuecomment-3942220472 @Ma77Ball @aicam I've downgraded the scikit-image library to be compatible with Python 3.10. All build tests have passed on my local branch. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] feat: add a new ternary contour plot operator [texera]
chenlica commented on PR #4193: URL: https://github.com/apache/texera/pull/4193#issuecomment-3924693903 @aicam Please review it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] feat: add a new ternary contour plot operator [texera]
Ma77Ball commented on PR #4193: URL: https://github.com/apache/texera/pull/4193#issuecomment-3924195973 LGTM! @aicam, please review and approve the workflows and merge. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] feat: add a new ternary contour plot operator [texera]
Ma77Ball commented on code in PR #4193:
URL: https://github.com/apache/texera/pull/4193#discussion_r2825236514
##
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/ternaryContour/TernaryContourOpDesc.scala:
##
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.texera.amber.operator.visualization.ternaryContour
+
+import com.fasterxml.jackson.annotation.{JsonProperty, JsonPropertyDescription}
+import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaTitle
+import org.apache.texera.amber.core.tuple.{AttributeType, Schema}
+import org.apache.texera.amber.core.workflow.OutputPort.OutputMode
+import
org.apache.texera.amber.pybuilder.PythonTemplateBuilder.PythonTemplateBuilderStringContext
+import org.apache.texera.amber.pybuilder.PyStringTypes.EncodableString
+import org.apache.texera.amber.core.workflow.{InputPort, OutputPort,
PortIdentity}
+import org.apache.texera.amber.operator.PythonOperatorDescriptor
+import
org.apache.texera.amber.operator.metadata.annotations.AutofillAttributeName
+import org.apache.texera.amber.operator.metadata.{OperatorGroupConstants,
OperatorInfo}
+import org.apache.texera.amber.pybuilder.PythonTemplateBuilder
+
+/**
+ * Visualization Operator for Ternary Plots.
+ *
+ * This operator uses three data fields to construct a ternary plot.
+ * The points can optionally be color coded using a data field.
+ */
+
+class TernaryContourOpDesc extends PythonOperatorDescriptor {
+
+ // Add annotations for the first variable
+ @JsonProperty(value = "firstVariable", required = true)
+ @JsonSchemaTitle("Variable 1")
+ @JsonPropertyDescription("First variable data field")
+ @AutofillAttributeName var firstVariable: EncodableString = ""
+
+ // Add annotations for the second variable
+ @JsonProperty(value = "secondVariable", required = true)
+ @JsonSchemaTitle("Variable 2")
+ @JsonPropertyDescription("Second variable data field")
+ @AutofillAttributeName var secondVariable: EncodableString = ""
+
+ // Add annotations for the third variable
+ @JsonProperty(value = "thirdVariable", required = true)
+ @JsonSchemaTitle("Variable 3")
+ @JsonPropertyDescription("Third variable data field")
+ @AutofillAttributeName var thirdVariable: EncodableString = ""
+
+ // Add annotations for the fourth variable
+ @JsonProperty(value = "fourthVariable", required = true)
+ @JsonSchemaTitle("Measured Value")
+ @JsonPropertyDescription("Measured value data field")
+ @AutofillAttributeName var fourthVariable: EncodableString = ""
+
+ // OperatorInfo instance describing ternary plot
+ override def operatorInfo: OperatorInfo =
+OperatorInfo(
+ userFriendlyName = "Ternary Contour",
+ 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%).",
Review Comment:
@ELin2025 made the description shorter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] feat: add a new ternary contour plot operator [texera]
Ma77Ball commented on code in PR #4193:
URL: https://github.com/apache/texera/pull/4193#discussion_r2825234483
##
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/ternaryContour/TernaryContourOpDesc.scala:
##
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.texera.amber.operator.visualization.ternaryContour
+
+import com.fasterxml.jackson.annotation.{JsonProperty, JsonPropertyDescription}
+import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaTitle
+import org.apache.texera.amber.core.tuple.{AttributeType, Schema}
+import org.apache.texera.amber.core.workflow.OutputPort.OutputMode
+import
org.apache.texera.amber.pybuilder.PythonTemplateBuilder.PythonTemplateBuilderStringContext
+import org.apache.texera.amber.pybuilder.PyStringTypes.EncodableString
+import org.apache.texera.amber.core.workflow.{InputPort, OutputPort,
PortIdentity}
+import org.apache.texera.amber.operator.PythonOperatorDescriptor
+import
org.apache.texera.amber.operator.metadata.annotations.AutofillAttributeName
+import org.apache.texera.amber.operator.metadata.{OperatorGroupConstants,
OperatorInfo}
+import org.apache.texera.amber.pybuilder.PythonTemplateBuilder
+
+/**
+ * Visualization Operator for Ternary Plots.
+ *
+ * This operator uses three data fields to construct a ternary plot.
+ * The points can optionally be color coded using a data field.
+ */
+
+class TernaryContourOpDesc extends PythonOperatorDescriptor {
+
+ // Add annotations for the first variable
+ @JsonProperty(value = "firstVariable", required = true)
+ @JsonSchemaTitle("Variable 1")
+ @JsonPropertyDescription("First variable data field")
+ @AutofillAttributeName var firstVariable: EncodableString = ""
+
+ // Add annotations for the second variable
+ @JsonProperty(value = "secondVariable", required = true)
+ @JsonSchemaTitle("Variable 2")
+ @JsonPropertyDescription("Second variable data field")
+ @AutofillAttributeName var secondVariable: EncodableString = ""
+
+ // Add annotations for the third variable
+ @JsonProperty(value = "thirdVariable", required = true)
+ @JsonSchemaTitle("Variable 3")
+ @JsonPropertyDescription("Third variable data field")
+ @AutofillAttributeName var thirdVariable: EncodableString = ""
+
+ // Add annotations for the fourth variable
+ @JsonProperty(value = "fourthVariable", required = true)
+ @JsonSchemaTitle("Measured Value")
+ @JsonPropertyDescription("Measured value data field")
+ @AutofillAttributeName var fourthVariable: EncodableString = ""
+
+ // OperatorInfo instance describing ternary plot
+ override def operatorInfo: OperatorInfo =
+OperatorInfo(
+ userFriendlyName = "Ternary Contour",
+ 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%).",
+ operatorGroupName =
OperatorGroupConstants.VISUALIZATION_SCIENTIFIC_GROUP,
+ inputPorts = List(InputPort()),
+ outputPorts = List(OutputPort(mode = OutputMode.SINGLE_SNAPSHOT))
+)
+
+ override def getOutputSchemas(
+ inputSchemas: Map[PortIdentity, Schema]
+ ): Map[PortIdentity, Schema] = {
+val outputSchema = Schema()
+ .add("html-content", AttributeType.STRING)
+Map(operatorInfo.outputPorts.head.id -> outputSchema)
+Map(operatorInfo.outputPorts.head.id -> outputSchema)
Review Comment:
@ELin2025 removed duplicate line: "Map(operatorInfo.outputPorts.head.id ->
outputSchema)"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] feat: add a new ternary contour plot operator [texera]
Ma77Ball commented on code in PR #4193:
URL: https://github.com/apache/texera/pull/4193#discussion_r2825235537
##
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/ternaryContour/TernaryContourOpDesc.scala:
##
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.texera.amber.operator.visualization.ternaryContour
+
+import com.fasterxml.jackson.annotation.{JsonProperty, JsonPropertyDescription}
+import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaTitle
+import org.apache.texera.amber.core.tuple.{AttributeType, Schema}
+import org.apache.texera.amber.core.workflow.OutputPort.OutputMode
+import
org.apache.texera.amber.pybuilder.PythonTemplateBuilder.PythonTemplateBuilderStringContext
+import org.apache.texera.amber.pybuilder.PyStringTypes.EncodableString
+import org.apache.texera.amber.core.workflow.{InputPort, OutputPort,
PortIdentity}
+import org.apache.texera.amber.operator.PythonOperatorDescriptor
+import
org.apache.texera.amber.operator.metadata.annotations.AutofillAttributeName
+import org.apache.texera.amber.operator.metadata.{OperatorGroupConstants,
OperatorInfo}
+import org.apache.texera.amber.pybuilder.PythonTemplateBuilder
+
+/**
+ * Visualization Operator for Ternary Plots.
+ *
+ * This operator uses three data fields to construct a ternary plot.
+ * The points can optionally be color coded using a data field.
+ */
+
+class TernaryContourOpDesc extends PythonOperatorDescriptor {
+
+ // Add annotations for the first variable
+ @JsonProperty(value = "firstVariable", required = true)
+ @JsonSchemaTitle("Variable 1")
+ @JsonPropertyDescription("First variable data field")
+ @AutofillAttributeName var firstVariable: EncodableString = ""
+
+ // Add annotations for the second variable
+ @JsonProperty(value = "secondVariable", required = true)
+ @JsonSchemaTitle("Variable 2")
+ @JsonPropertyDescription("Second variable data field")
+ @AutofillAttributeName var secondVariable: EncodableString = ""
+
+ // Add annotations for the third variable
+ @JsonProperty(value = "thirdVariable", required = true)
+ @JsonSchemaTitle("Variable 3")
+ @JsonPropertyDescription("Third variable data field")
+ @AutofillAttributeName var thirdVariable: EncodableString = ""
+
+ // Add annotations for the fourth variable
+ @JsonProperty(value = "fourthVariable", required = true)
+ @JsonSchemaTitle("Measured Value")
+ @JsonPropertyDescription("Measured value data field")
+ @AutofillAttributeName var fourthVariable: EncodableString = ""
+
+ // OperatorInfo instance describing ternary plot
+ override def operatorInfo: OperatorInfo =
+OperatorInfo(
+ userFriendlyName = "Ternary Contour",
+ 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%).",
+ operatorGroupName =
OperatorGroupConstants.VISUALIZATION_SCIENTIFIC_GROUP,
+ inputPorts = List(InputPort()),
+ outputPorts = List(OutputPort(mode = OutputMode.SINGLE_SNAPSHOT))
+)
+
+ override def getOutputSchemas(
+ inputSchemas: Map[PortIdentity, Schema]
+ ): Map[PortIdentity, Schema] = {
+val outputSchema = Schema()
+ .add("html-content", AttributeType.STRING)
+Map(operatorInfo.outputPorts.head.id -> outputSchema)
+Map(operatorInfo.outputPorts.head.id -> outputSchema)
+ }
+
+ /** Returns a Python string that drops any tuples with missing values */
+ def manipulateTable(): PythonTemplateBuilder = {
+// Check for any empty data field names
+assert(
+ firstVariable.nonEmpty && secondVariable.nonEmpty &&
thirdVariable.nonEmpty && fourthVariable.nonEmpty
+)
+pyb"""
+ |# Remove any tuples that contain missing values
+ |table.dropna(subset=[$firstVariable, $secondVariable,
$thirdVariable, $fourthVariable], inplace = True)
+ |
+ |#Remove rows where any of the first three variables are
negative
+ |table = table[(table[[$firstVariable, $secondVariable,
$thirdVariable]] >= 0).all(axis=1)]
+ |
+ |#Remove zero-sum rows
+
Re: [PR] feat: add a new ternary contour plot operator [texera]
Ma77Ball commented on code in PR #4193:
URL: https://github.com/apache/texera/pull/4193#discussion_r2825230698
##
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/ternaryContour/TernaryContourOpDesc.scala:
##
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.texera.amber.operator.visualization.ternaryContour
+
+import com.fasterxml.jackson.annotation.{JsonProperty, JsonPropertyDescription}
+import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaTitle
+import org.apache.texera.amber.core.tuple.{AttributeType, Schema}
+import org.apache.texera.amber.core.workflow.OutputPort.OutputMode
+import
org.apache.texera.amber.pybuilder.PythonTemplateBuilder.PythonTemplateBuilderStringContext
+import org.apache.texera.amber.pybuilder.PyStringTypes.EncodableString
+import org.apache.texera.amber.core.workflow.{InputPort, OutputPort,
PortIdentity}
+import org.apache.texera.amber.operator.PythonOperatorDescriptor
+import
org.apache.texera.amber.operator.metadata.annotations.AutofillAttributeName
+import org.apache.texera.amber.operator.metadata.{OperatorGroupConstants,
OperatorInfo}
+import org.apache.texera.amber.pybuilder.PythonTemplateBuilder
+
+/**
+ * Visualization Operator for Ternary Plots.
+ *
+ * This operator uses three data fields to construct a ternary plot.
+ * The points can optionally be color coded using a data field.
+ */
+
+class TernaryContourOpDesc extends PythonOperatorDescriptor {
+
+ // Add annotations for the first variable
+ @JsonProperty(value = "firstVariable", required = true)
+ @JsonSchemaTitle("Variable 1")
+ @JsonPropertyDescription("First variable data field")
+ @AutofillAttributeName var firstVariable: EncodableString = ""
+
+ // Add annotations for the second variable
+ @JsonProperty(value = "secondVariable", required = true)
+ @JsonSchemaTitle("Variable 2")
+ @JsonPropertyDescription("Second variable data field")
+ @AutofillAttributeName var secondVariable: EncodableString = ""
+
+ // Add annotations for the third variable
+ @JsonProperty(value = "thirdVariable", required = true)
+ @JsonSchemaTitle("Variable 3")
+ @JsonPropertyDescription("Third variable data field")
+ @AutofillAttributeName var thirdVariable: EncodableString = ""
+
+ // Add annotations for the fourth variable
+ @JsonProperty(value = "fourthVariable", required = true)
+ @JsonSchemaTitle("Measured Value")
+ @JsonPropertyDescription("Measured value data field")
+ @AutofillAttributeName var fourthVariable: EncodableString = ""
+
+ // OperatorInfo instance describing ternary plot
+ override def operatorInfo: OperatorInfo =
+OperatorInfo(
+ userFriendlyName = "Ternary Contour",
+ 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%).",
+ operatorGroupName =
OperatorGroupConstants.VISUALIZATION_SCIENTIFIC_GROUP,
+ inputPorts = List(InputPort()),
+ outputPorts = List(OutputPort(mode = OutputMode.SINGLE_SNAPSHOT))
+)
+
+ override def getOutputSchemas(
+ inputSchemas: Map[PortIdentity, Schema]
+ ): Map[PortIdentity, Schema] = {
+val outputSchema = Schema()
+ .add("html-content", AttributeType.STRING)
+Map(operatorInfo.outputPorts.head.id -> outputSchema)
+Map(operatorInfo.outputPorts.head.id -> outputSchema)
+ }
+
+ /** Returns a Python string that drops any tuples with missing values */
+ def manipulateTable(): PythonTemplateBuilder = {
+// Check for any empty data field names
+assert(
+ firstVariable.nonEmpty && secondVariable.nonEmpty &&
thirdVariable.nonEmpty && fourthVariable.nonEmpty
+)
+pyb"""
+ |# Remove any tuples that contain missing values
+ |table.dropna(subset=[$firstVariable, $secondVariable,
$thirdVariable, $fourthVariable], inplace = True)
+ |
+ |#Remove rows where any of the first three variables are
negative
+ |table = table[(table[[$firstVariable, $secondVariable,
$thirdVariable]] >= 0).all(axis=1)]
+ |
+ |#Remove zero-sum rows
+
Re: [PR] feat: add a new ternary contour plot operator [texera]
Ma77Ball commented on PR #4193: URL: https://github.com/apache/texera/pull/4193#issuecomment-3924166398 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. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] feat: add a new ternary contour plot operator [texera]
ELin2025 commented on PR #4193: URL: https://github.com/apache/texera/pull/4193#issuecomment-3911247457 @Ma77Ball I have made the changes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] feat: add a new ternary contour plot operator [texera]
Ma77Ball commented on code in PR #4193:
URL: https://github.com/apache/texera/pull/4193#discussion_r2812103308
##
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/ternaryContour/TernaryContourOpDesc.scala:
##
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.texera.amber.operator.visualization.ternaryContour
+
+import com.fasterxml.jackson.annotation.{JsonProperty, JsonPropertyDescription}
+import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaTitle
+import org.apache.texera.amber.core.tuple.{AttributeType, Schema}
+import org.apache.texera.amber.core.workflow.OutputPort.OutputMode
+import
org.apache.texera.amber.pybuilder.PythonTemplateBuilder.PythonTemplateBuilderStringContext
+import org.apache.texera.amber.pybuilder.PyStringTypes.EncodableString
+import org.apache.texera.amber.core.workflow.{InputPort, OutputPort,
PortIdentity}
+import org.apache.texera.amber.operator.PythonOperatorDescriptor
+import
org.apache.texera.amber.operator.metadata.annotations.AutofillAttributeName
+import org.apache.texera.amber.operator.metadata.{OperatorGroupConstants,
OperatorInfo}
+import org.apache.texera.amber.pybuilder.PythonTemplateBuilder
+
+/**
+ * Visualization Operator for Ternary Plots.
+ *
+ * This operator uses three data fields to construct a ternary plot.
+ * The points can optionally be color coded using a data field.
+ */
+
+class TernaryContourOpDesc extends PythonOperatorDescriptor {
+
+ // Add annotations for the first variable
+ @JsonProperty(value = "firstVariable", required = true)
+ @JsonSchemaTitle("Variable 1")
+ @JsonPropertyDescription("First variable data field")
+ @AutofillAttributeName var firstVariable: EncodableString = ""
+
+ // Add annotations for the second variable
+ @JsonProperty(value = "secondVariable", required = true)
+ @JsonSchemaTitle("Variable 2")
+ @JsonPropertyDescription("Second variable data field")
+ @AutofillAttributeName var secondVariable: EncodableString = ""
+
+ // Add annotations for the third variable
+ @JsonProperty(value = "thirdVariable", required = true)
+ @JsonSchemaTitle("Variable 3")
+ @JsonPropertyDescription("Third variable data field")
+ @AutofillAttributeName var thirdVariable: EncodableString = ""
+
+ // Add annotations for the fourth variable
+ @JsonProperty(value = "fourthVariable", required = true)
+ @JsonSchemaTitle("Measured Value")
+ @JsonPropertyDescription("Measured value data field")
+ @AutofillAttributeName var fourthVariable: EncodableString = ""
+
+ // OperatorInfo instance describing ternary plot
+ override def operatorInfo: OperatorInfo =
+OperatorInfo(
+ userFriendlyName = "Ternary Contour",
+ 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%).",
+ operatorGroupName =
OperatorGroupConstants.VISUALIZATION_SCIENTIFIC_GROUP,
+ inputPorts = List(InputPort()),
+ outputPorts = List(OutputPort(mode = OutputMode.SINGLE_SNAPSHOT))
+)
+
+ override def getOutputSchemas(
+ inputSchemas: Map[PortIdentity, Schema]
+ ): Map[PortIdentity, Schema] = {
+val outputSchema = Schema()
+ .add("html-content", AttributeType.STRING)
+Map(operatorInfo.outputPorts.head.id -> outputSchema)
+Map(operatorInfo.outputPorts.head.id -> outputSchema)
+ }
+
+ /** Returns a Python string that drops any tuples with missing values */
+ def manipulateTable(): PythonTemplateBuilder = {
+// Check for any empty data field names
+assert(
+ firstVariable.nonEmpty && secondVariable.nonEmpty &&
thirdVariable.nonEmpty && fourthVariable.nonEmpty
+)
+pyb"""
+ |# Remove any tuples that contain missing values
+ |table.dropna(subset=[$firstVariable, $secondVariable,
$thirdVariable, $fourthVariable], inplace = True)
+ |
+ |#Remove rows where any of the first three variables are
negative
+ |table = table[(table[[$firstVariable, $secondVariable,
$thirdVariable]] >= 0).all(axis=1)]
+ |
+ |#Remove zero-sum rows
+
Re: [PR] feat: add a new ternary contour plot operator [texera]
chenlica commented on PR #4193: URL: https://github.com/apache/texera/pull/4193#issuecomment-3894850423 @Ma77Ball After you review and approve it, you can let @aicam do the review, approval, and merge. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] feat: add a new ternary contour plot operator [texera]
ELin2025 commented on PR #4193: URL: https://github.com/apache/texera/pull/4193#issuecomment-3894041436 @Ma77Ball Just fixed the commits, should just be my files now -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] feat: add a new ternary contour plot operator [texera]
Ma77Ball commented on PR #4193: URL: https://github.com/apache/texera/pull/4193#issuecomment-3893873556 @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? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] feat: add a new ternary contour plot operator [texera]
ELin2025 commented on PR #4192: URL: https://github.com/apache/texera/pull/4192#issuecomment-3862633012 Did not run the lint tests first -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] feat: add a new ternary contour plot operator [texera]
ELin2025 closed pull request #4192: feat: add a new ternary contour plot operator URL: https://github.com/apache/texera/pull/4192 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
