@KFStep(name="PythonScriptExecutor",
category="Scripting",
toolTipText="CPython scripting step",
iconPath="weka/gui/knowledgeflow/icons/PythonScriptExecutor.gif")
public class PythonScriptExecutor
extends weka.knowledgeflow.steps.BaseStep
Constructor and Description |
---|
PythonScriptExecutor() |
Modifier and Type | Method and Description |
---|---|
boolean |
getContinueOnSysErr()
Get whether to try and continue after seeing output on the sys error
stream.
|
java.lang.String |
getCustomEditorForStep() |
boolean |
getDebug()
Get whether to output debugging info (both client and server side)
|
java.util.List<java.lang.String> |
getIncomingConnectionTypes()
Get the incoming connection types we can accept at the given time
|
java.util.List<java.lang.String> |
getOutgoingConnectionTypes()
Get the outgoing connection types we can produce at the given time
|
java.lang.String |
getPythonCommand() |
java.lang.String |
getPythonPathEntries()
Get additional entries needed in the PATH for the specified python
executable to work properly.
|
java.lang.String |
getPythonScript()
Get the python script to execute.
|
java.io.File |
getScriptFile()
Get the filename of the script to load at runtime
|
java.lang.String |
getServerID()
Get an optional server name by which to identify the python server to use.
|
java.lang.String |
getVariablesToGetFromPython()
Get the list of variables to retrieve from python.
|
void |
processIncoming(weka.knowledgeflow.Data data)
Process incoming instances
|
void |
setContinueOnSysErr(boolean c)
Set whether to try and continue after seeing output on the sys error
stream.
|
void |
setDebug(boolean debug)
Set whether to output debugging info (both client and server side)
|
void |
setPythonCommand(java.lang.String pyCommand)
Set the python command to use.
|
void |
setPythonPathEntries(java.lang.String pythonPathEntries)
Set additional entries needed in the PATH for the specified python
executable to work properly.
|
void |
setPythonScript(java.lang.String script)
Set the python script to execute.
|
void |
setScriptFile(java.io.File scriptFile)
Set the filename containing the script to be loaded at runtime
|
void |
setServerID(java.lang.String serverID)
Set an optional server name by which to identify the python server to use.
|
void |
setVariablesToGetFromPython(java.lang.String varsToGet)
Set the variables to retrieve from python
|
void |
start()
Executed if we are operating as a start point
|
void |
stepInit()
Initialize the step
|
environmentSubstitute, getDefaultSettings, getInteractiveViewers, getInteractiveViewersImpls, getName, getStepManager, globalInfo, isResourceIntensive, isStopRequested, outputStructureForConnectionType, outputStructureForConnectionType, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, stepMustRunSingleThreaded, stop
public void setContinueOnSysErr(boolean c)
c
- true if we should try to continue after seeing output on the sys
error stream@OptionMetadata(displayName="Try to continue after sys err output from script", description="Try to continue after sys err output from script.\nSome schemes report warnings to the system error stream.", displayOrder=5) public boolean getContinueOnSysErr()
@OptionMetadata(displayName="Output debugging info from python", description="Whether to output debugging info from python", displayOrder=10) public void setDebug(boolean debug)
debug
- true if debugging info is to be outputpublic boolean getDebug()
@OptionMetadata(displayName="Python command ", description="Path to python executable (empty string or \'default\' to use python in the PATH)", displayOrder=1) public void setPythonCommand(java.lang.String pyCommand)
pyCommand
- the path to the python executable (or empty
string/"default" to use python in the PATH)public java.lang.String getPythonCommand()
@OptionMetadata(displayName="Python path", description="(Optional) path entries needed for python to execute correctly; only required when not using default python", displayOrder=2) public void setPythonPathEntries(java.lang.String pythonPathEntries)
pythonPathEntries
- additional PATH entries needed for python to
execute correctlypublic java.lang.String getPythonPathEntries()
@OptionMetadata(displayName="Server name/ID", description="Optional name to identify this server - can be used to share a given server instance", displayOrder=3) public void setServerID(java.lang.String serverID)
serverID
- the name of the server to use (or leave blank for no
specific server name).public java.lang.String getServerID()
@ProgrammaticProperty public void setPythonScript(java.lang.String script)
script
- the script to executepublic java.lang.String getPythonScript()
@OptionMetadata(displayName="File to load script from", description="A file to load the python script from (if set takes precendenceover any script from the editor", displayOrder=4) @FilePropertyMetadata(fileChooserDialogType=0, directoriesOnly=false) public void setScriptFile(java.io.File scriptFile)
scriptFile
- the name of the script file to load at runtimepublic java.io.File getScriptFile()
@OptionMetadata(displayName="Variables to get from Python", description="A comma-separated list of variables to retrieve from Python", displayOrder=5) public void setVariablesToGetFromPython(java.lang.String varsToGet)
varsToGet
- a comma-separated list of variables to get from pythonpublic java.lang.String getVariablesToGetFromPython()
public void stepInit() throws weka.core.WekaException
weka.core.WekaException
- if a problem occurspublic void start() throws weka.core.WekaException
start
in interface weka.knowledgeflow.steps.BaseStepExtender
start
in interface weka.knowledgeflow.steps.Step
start
in class weka.knowledgeflow.steps.BaseStep
weka.core.WekaException
- if a problem occurspublic void processIncoming(weka.knowledgeflow.Data data) throws weka.core.WekaException
processIncoming
in interface weka.knowledgeflow.steps.BaseStepExtender
processIncoming
in interface weka.knowledgeflow.steps.Step
processIncoming
in class weka.knowledgeflow.steps.BaseStep
data
- data object - we process dataSet, trainingSet and testSet
connectionsweka.core.WekaException
- if a problem occurspublic java.util.List<java.lang.String> getIncomingConnectionTypes()
public java.util.List<java.lang.String> getOutgoingConnectionTypes()
public java.lang.String getCustomEditorForStep()
getCustomEditorForStep
in interface weka.knowledgeflow.steps.Step
getCustomEditorForStep
in class weka.knowledgeflow.steps.BaseStep