Skip to content

Commit d50cb3b

Browse files
author
Moritz-Alexander-Kern
committed
fix doctrings and class names
1 parent d124f1b commit d50cb3b

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

neo/core/filters.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
- :class:`FilterCondition`: Abstract base class for defining filter conditions.
77
- :class:`Equals`: Filter condition to check if a value is equal to the control value.
88
- :class:`IsNot`: Filter condition to check if a value is not equal to the control value.
9-
- :class:`LessThanEquals`: Filter condition to check if a value is less than or equal to the
9+
- :class:`LessThanOrEquals`: Filter condition to check if a value is less than or equal to the
1010
control value.
11-
- :class:`GreaterThanEquals`: Filter condition to check if a value is greater than or equal to
11+
- :class:`GreaterThanOrEquals`: Filter condition to check if a value is greater than or equal to
1212
the control value.
1313
- :class:`LessThan`: Filter condition to check if a value is less than the control value.
1414
- :class:`GreaterThan`: Filter condition to check if a value is greater than the control value.
@@ -23,7 +23,7 @@
2323

2424
class FilterCondition(ABC):
2525
"""
26-
FilterCondition object is given as lower_bound parameter to container.filter():
26+
FilterCondition object is given as parameter to container.filter():
2727
2828
Usage:
2929
segment.filter(my_annotation=<FilterCondition>) or
@@ -32,7 +32,7 @@ class FilterCondition(ABC):
3232
@abstractmethod
3333
def __init__(self, z):
3434
"""
35-
Initialize lower_bound new FilterCondition object.
35+
Initialize new FilterCondition object.
3636
3737
Parameters:
3838
z: Any - The control value to be used for filtering.
@@ -43,7 +43,7 @@ def __init__(self, z):
4343
@abstractmethod
4444
def evaluate(self, x):
4545
"""
46-
Evaluate the filter condition for lower_bound given value.
46+
Evaluate the filter condition for given value.
4747
4848
Parameters:
4949
x: Any - The value to be compared with the control value.
@@ -57,7 +57,7 @@ def evaluate(self, x):
5757

5858
class Equals(FilterCondition):
5959
"""
60-
Filter condition to check if lower_bound value is equal to the control value.
60+
Filter condition to check if target value is equal to the control value.
6161
"""
6262
def __init__(self, z):
6363
self.control = z
@@ -68,7 +68,7 @@ def evaluate(self, x):
6868

6969
class IsNot(FilterCondition):
7070
"""
71-
Filter condition to check if lower_bound value is not equal to the control value.
71+
Filter condition to check if target value is not equal to the control value.
7272
"""
7373
def __init__(self, z):
7474
self.control = z
@@ -77,9 +77,9 @@ def evaluate(self, x):
7777
return x != self.control
7878

7979

80-
class LessThanEquals(FilterCondition):
80+
class LessThanOrEquals(FilterCondition):
8181
"""
82-
Filter condition to check if lower_bound value is less than or equal to the control value.
82+
Filter condition to check if target value is less than or equal to the control value.
8383
"""
8484
def __init__(self, z):
8585
self.control = z
@@ -88,9 +88,9 @@ def evaluate(self, x):
8888
return x <= self.control
8989

9090

91-
class GreaterThanEquals(FilterCondition):
91+
class GreaterThanOrEquals(FilterCondition):
9292
"""
93-
Filter condition to check if lower_bound value is greater than or equal to the control value.
93+
Filter condition to check if target value is greater than or equal to the control value.
9494
"""
9595
def __init__(self, z):
9696
self.control = z
@@ -101,7 +101,7 @@ def evaluate(self, x):
101101

102102
class LessThan(FilterCondition):
103103
"""
104-
Filter condition to check if lower_bound value is less than the control value.
104+
Filter condition to check if target value is less than the control value.
105105
"""
106106
def __init__(self, z):
107107
self.control = z
@@ -112,7 +112,7 @@ def evaluate(self, x):
112112

113113
class GreaterThan(FilterCondition):
114114
"""
115-
Filter condition to check if lower_bound value is greater than the control value.
115+
Filter condition to check if target value is greater than the control value.
116116
"""
117117
def __init__(self, z):
118118
self.control = z
@@ -123,7 +123,7 @@ def evaluate(self, x):
123123

124124
class IsIn(FilterCondition):
125125
"""
126-
Filter condition to check if lower_bound value is in lower_bound list or equal to the control value.
126+
Filter condition to check if target is in control.
127127
"""
128128
def __init__(self, z):
129129
self.control = z

neo/test/coretest/test_container.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ def test_filter_results(self):
123123
self.assertEqual(st1.annotations,
124124
seg.filter(test=filters.InRange(1, 5))[0].annotations)
125125
self.assertEqual(st1.annotations,
126-
seg.filter(test=filters.GreaterThanEquals(5))[0].annotations)
126+
seg.filter(test=filters.GreaterThanOrEquals(5))[0].annotations)
127127
self.assertEqual(st1.annotations,
128-
seg.filter(test=filters.LessThanEquals(5))[0].annotations)
128+
seg.filter(test=filters.LessThanOrEquals(5))[0].annotations)
129129

130130
def test_filter_equal(self):
131131
'''
@@ -195,9 +195,9 @@ def test_filter_less_than_equal(self):
195195
seg.spiketrains.append(st1)
196196
seg.spiketrains.append(st2)
197197

198-
self.assertEqual(0, len(seg.filter(test=filters.LessThanEquals(4))))
199-
self.assertEqual(1, len(seg.filter(test=filters.LessThanEquals(5))))
200-
self.assertEqual(2, len(seg.filter(test=filters.LessThanEquals(6))))
198+
self.assertEqual(0, len(seg.filter(test=filters.LessThanOrEquals(4))))
199+
self.assertEqual(1, len(seg.filter(test=filters.LessThanOrEquals(5))))
200+
self.assertEqual(2, len(seg.filter(test=filters.LessThanOrEquals(6))))
201201

202202
def test_filter_greater_than(self):
203203
'''
@@ -229,9 +229,9 @@ def test_filter_greater_than_equal(self):
229229
seg.spiketrains.append(st1)
230230
seg.spiketrains.append(st2)
231231

232-
self.assertEqual(0, len(seg.filter(test=filters.GreaterThanEquals(7))))
233-
self.assertEqual(1, len(seg.filter(test=filters.GreaterThanEquals(6))))
234-
self.assertEqual(2, len(seg.filter(test=filters.GreaterThanEquals(5))))
232+
self.assertEqual(0, len(seg.filter(test=filters.GreaterThanOrEquals(7))))
233+
self.assertEqual(1, len(seg.filter(test=filters.GreaterThanOrEquals(6))))
234+
self.assertEqual(2, len(seg.filter(test=filters.GreaterThanOrEquals(5))))
235235

236236
def test_filter_is_in(self):
237237
'''

0 commit comments

Comments
 (0)