use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class PlainCode method executeFrame.
@Override
public void executeFrame(Code code, KernelFunctionality kernel, Message message, int executionCount) {
SimpleEvaluationObject seo = createSimpleEvaluationObject(this.plainCode, kernel, message, executionCount);
seo.noResult();
TryResult either = kernel.executeCode(this.plainCode, seo);
handleResult(seo, either);
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class OutputWidgetTest method submitCodeToExecution.
private Message submitCodeToExecution() {
SimpleEvaluationObject value = new SimpleEvaluationObject("output");
Message jupyterMessage = new Message();
value.setJupyterMessage(jupyterMessage);
InternalVariable.setValue(value);
return jupyterMessage;
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class GroovyEvaluatorStackTraceTest method unableToResolveClass.
@Test
public void unableToResolveClass() throws Exception {
String code = "new IntSlider()";
SimpleEvaluationObject seo = new SimpleEvaluationObject(code);
// when
TryResult evaluate = groovyEvaluator.evaluate(seo, code);
// then
assertThat(evaluate.isError()).isTrue();
System.out.println(evaluate.error());
assertThat(evaluate.error()).contains("unable to resolve class IntSlider");
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class GroovyOutputContainerTest method shouldAddPlotToOutputContainerTest.
@Test
public void shouldAddPlotToOutputContainerTest() throws Exception {
// given
String code = "import com.twosigma.beakerx.groovy.evaluator.ResourceLoaderTest;\n" + "import com.twosigma.beakerx.jvm.object.OutputContainer;\n" + "import com.twosigma.beakerx.chart.xychart.SimpleTimePlot;\n" + "List<Map<?, ?>> rates = ResourceLoaderTest.readAsList(\"tableRowsTest.csv\");\n" + "plot2 = new SimpleTimePlot(rates, [\"m3\", \"y1\"], showLegend:false, initWidth: 300, initHeight: 400)\n" + "new OutputContainer() << plot2";
// when
SimpleEvaluationObject evaluationObject = PlainCode.createSimpleEvaluationObject(code, groovyKernel, HEADER_MESSAGE, 1);
TryResult seo = groovyEvaluatorManager.executeCode(code, evaluationObject);
// then
assertThat(seo.result()).isNotNull();
verifyPlot(groovyKernel.getPublishedMessages());
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class NamespaceClient method showProgressUpdate.
public synchronized void showProgressUpdate(String message, int progress) {
SimpleEvaluationObject seo = InternalVariable.getSimpleEvaluationObject();
seo.structuredUpdate(message, progress);
}
Aggregations