Peter
11/04/2022, 10:01 AMexec
method to run a cell.
for (cell in notebook.cells.filterIsInstance<CodeCell>()) {
val cellResult = exec(cell.source)
val result = if (cellResult is MimeTypedResult) cellResult.entries.first().value else cellResult.toString()
if (cell.outputs.isNotEmpty()) {
val firstOutput = cell.outputs.first()
if (firstOutput is ExecuteResult && firstOutput.data.isNotEmpty()) {
val output = firstOutput.data.entries.first()
assertEquals(output.value.removeUUID(), result.removeUUID())
}
}
}
But some cells take very long to run, so I would like to have the option to only compile the cell and get compilation errors, but not run (exec) the cell. Any hints how to achieve this?altavir
11/04/2022, 10:46 AMPeter
11/04/2022, 10:51 AMcell 1: val x = 12
cell 2: println(x)
Peter
11/04/2022, 10:55 AMval
statements for same variable.Ilya Muradyan
11/04/2022, 1:51 PMPeter
11/04/2022, 2:10 PM