scalation / scalation_kernel

ScalaTion kernel for Jupyter
MIT License
3 stars 5 forks source link

ScalaTion Kernel commands break with trailing comments #6

Closed mepcotterell closed 6 years ago

mepcotterell commented 6 years ago

At the moment, trailing comments for ScalaTion Kernel commands (those starting with two colons ::) will cause an internal parse error that is not communicated to the user, resulting in a hanging cell.

Example 1

import scalation.linalgebra.VectorD
import math.{Pi, sin}
val vec = VectorD((-2.0 * Pi to 2.0 * Pi by 0.1).toSeq).map(sin(_))
::plotv vec // comment breaks stuff

Example 2

import scalation.linalgebra.VectorD
import math.{Pi, sin}
val vec = VectorD((-2.0 * Pi to 2.0 * Pi by 0.1).toSeq).map(sin(_))
::plotv vec /* comment breaks stuff */

Example 3

import scalation.linalgebra.VectorD
import math.{Pi, sin}
val vec = VectorD((-2.0 * Pi to 2.0 * Pi by 0.1).toSeq).map(sin(_))
::plotv vec /* comment breaks
stuff */

Fix

Examples 1-2 can be handled by stripping out the comment from the line before passing it to argparse. Handling Example 3 will be trickier. While this could be fixed individually for each command, a more general solution will be derived and implemented.

mepcotterell commented 6 years ago

Fixed in #13