Skip to content
Snippets Groups Projects
Commit d46c1cac authored by Hanna's avatar Hanna
Browse files

formatting

parent 167b7365
No related branches found
No related tags found
No related merge requests found
Pipeline #703879 passed
......@@ -144,7 +144,9 @@ class FakeSeriesSource(TSSource):
return np.random.randn(*buf.shape)
elif self.signal_type == "sin" or self.signal_type == "sine":
return np.sin(
2 * np.pi * self.fsin
2
* np.pi
* self.fsin
* np.tile(
buf.tarr,
self.sample_shape + (1,),
......
from dataclasses import dataclass
from sgnts.base import TSTransform, TSFrame, AdapterConfig, Offset
import numpy
from sgnts.base import AdapterConfig, Offset, TSFrame, TSTransform
@dataclass
class Median(TSTransform):
"""Computes a running median over the previous and afterward
......@@ -12,7 +15,9 @@ class Median(TSTransform):
def __post_init__(self):
# FIXME: When this option is available, fill the gap buffers with nan's (instead of 0's)
self.adapter_config = AdapterConfig(
overlap=self.overlap_offsets, pad_zeros_startup=False, stride=Offset.SAMPLE_STRIDE_AT_MAX_RATE
overlap=self.overlap_offsets,
pad_zeros_startup=False,
stride=Offset.SAMPLE_STRIDE_AT_MAX_RATE,
)
super().__post_init__()
# This element is written to assume one channel, one source pad and one sink pad
......
......@@ -4,7 +4,7 @@ from sgn.apps import Pipeline
from sgn.sinks import NullSink
from sgnts.sources import FakeSeriesSource
from sgnts.transforms import Median
from sgnts.transforms import Median
def test_median():
......@@ -40,7 +40,7 @@ def test_median():
name="trans1",
source_pad_names=("H1",),
sink_pad_names=("H1",),
overlap_offsets=(512,0),
overlap_offsets=(512, 0),
),
NullSink(
name="snk1",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment