dmyersturnbull / pippin

Common Scala libraries.
Apache License 2.0
0 stars 0 forks source link

In time-series grammar, return seq with warnings about out-of-bounds #31

Closed dmyersturnbull closed 7 years ago

dmyersturnbull commented 7 years ago

Update: I fixed this with sorcery. The value substituted for potential out-of-bounds access in TimeSeriesGrammar is just NaN, so the NaNs will show up if the out-of-bounds access is ever used.


I forgot; this is not possible currently because the time-series grammar doesn't know whether the if-else grammar condition will be true. Ex:

if $t=0: 0 else: $t[$t-1]

Here, the time-series tries to fill in $t[$t-1] for $t=0 but can't. The best it can do is assume that some condition will prevent that value from being accessed and fill it in with something.

This can't be fixed without rewriting the time-series grammar, so for now let's just build in the idea that out-of-bounds is always default (probably 0). It's a feature, not a bug.