continuous_timeseries.discrete_to_continuous.interpolation_option#
Definition of a our interpolation options (represented by InterpolationOption).
At the moment, only the piecewise constant options support the left-open/left-closed concept. In theory, this could also apply to the other interpolation options. However, this only matters if we want to support discontinuous values at the boundaries for these interpolation choices. So, while we could support this, we currently don't because the use case for discontinuous values in combination with linear or higher order interpolation isn't clear.
Classes:
| Name | Description |
|---|---|
InterpolationOption |
Interpolation options |
InterpolationOption #
Bases: IntEnum
Interpolation options
Attributes:
| Name | Type | Description |
|---|---|---|
Cubic |
Cubic interpolation |
|
Linear |
Linear interpolation |
|
PiecewiseConstantNextLeftClosed |
Piecewise constant 'next' interpolation, each interval is closed on the left |
|
PiecewiseConstantNextLeftOpen |
Piecewise constant 'next' interpolation, each interval is open on the left |
|
PiecewiseConstantPreviousLeftClosed |
Piecewise constant 'previous' interpolation, each interval is closed on the left |
|
PiecewiseConstantPreviousLeftOpen |
Piecewise constant 'previous' interpolation, each interval is open on the left |
|
Quadratic |
Quadratic interpolation |
|
Quartic |
Quartic interpolation |
Source code in src/continuous_timeseries/discrete_to_continuous/interpolation_option.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
PiecewiseConstantNextLeftClosed
class-attribute
instance-attribute
#
Piecewise constant 'next' interpolation, each interval is closed on the left
In other words, between t(i) and t(i + 1), the value is equal to y(i + 1). At t(i), the value is equal to y(i + 1).
If helpful, we have drawn a picture of how this works below. Symbols:
- time: y-value selected for this time-value
- i: closed (i.e. inclusive) boundary
- o: open (i.e. exclusive) boundary
PiecewiseConstantNextLeftOpen
class-attribute
instance-attribute
#
Piecewise constant 'next' interpolation, each interval is open on the left
In other words, between t(i) and t(i + 1), the value is equal to y(i + 1). At t(i), the value is equal to y(i).
If helpful, we have drawn a picture of how this works below. Symbols:
- time: y-value selected for this time-value
- i: closed (i.e. inclusive) boundary
- o: open (i.e. exclusive) boundary
PiecewiseConstantPreviousLeftClosed
class-attribute
instance-attribute
#
Piecewise constant 'previous' interpolation, each interval is closed on the left
In other words, between t(i) and t(i + 1), the value is equal to y(i). At t(i + 1), the value is equal to y(i + 1).
If helpful, we have drawn a picture of how this works below. Symbols:
- time: y-value selected for this time-value
- i: closed (i.e. inclusive) boundary
- o: open (i.e. exclusive) boundary
PiecewiseConstantPreviousLeftOpen
class-attribute
instance-attribute
#
Piecewise constant 'previous' interpolation, each interval is open on the left
In other words, between t(i) and t(i + 1), the value is equal to y(i). At t(i + 1), the value is equal to y(i).
If helpful, we have drawn a picture of how this works below. Symbols:
- time: y-value selected for this time-value
- i: closed (i.e. inclusive) boundary
- o: open (i.e. exclusive) boundary