File tree 1 file changed +18
-7
lines changed
1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change 14
14
pm = pd .core .SimpleProcessManager ()
15
15
16
16
# this causes problems, due to Python ref counting
17
- # comment it out to find out
17
+ # don't do this until issue #6 is fixed
18
18
#pm.append(pd.core.SavitzkyGolaySmoother(3))
19
19
20
- # this also causes issues
21
- #sg = pd.core.SavitzkyGolaySmoother(3)
22
- #pm.append(sg)
23
- #del sg
24
-
25
- # this is OK, since it is fro C++
20
+ # this is OK, since it is from C++
26
21
pm .append (pd .core .MovingAverageSmoother (1 ))
27
22
pm .append (pd .core .MovingAverageSmoother (3 ))
28
23
31
26
sg = pd .core .SavitzkyGolaySmoother (3 )
32
27
pm .append (sg )
33
28
29
+ # custom process
30
+ class ThresholdCut (pd .core .IProcess ):
31
+ def __init__ (self , threshold ):
32
+ pd .core .IProcess .__init__ (self )
33
+ self .threshold = threshold
34
+
35
+ def go (self , data ):
36
+ """
37
+ Chop off anything less than the threshold
38
+ """
39
+ return data .ramp (self .threshold )
40
+
41
+ # keep anything above threshold
42
+ tc = ThresholdCut (1e3 )
43
+ pm .append (tc )
44
+
34
45
# process the data
35
46
processeddata = pm .run (data ).to_list ()
36
47
You can’t perform that action at this time.
0 commit comments