removed "where" method from Table class

This commit is contained in:
Philip Eisenlohr 2020-12-11 19:31:19 -05:00
parent 4877334986
commit 36e4042f0b
2 changed files with 0 additions and 15 deletions

View File

@ -49,15 +49,6 @@ class Table:
"""Copy Table."""
return self.__copy__()
def where(self,expression):
"""
Return boolean array corresponding to interpolated expression being True.
Table columns are addressed as #column# and will have appropriate shapes.
"""
return eval(re.sub('#(.+?)#',r'self.get("\1")',expression))
def _label_discrete(self):
"""Label data individually, e.g. v v v ==> 1_v 2_v 3_v."""

View File

@ -44,12 +44,6 @@ class TestTable:
def test_getitem(self,N):
assert len(Table(np.random.rand(N,1),{'X':1})[:N//2]) == N//2
@pytest.mark.parametrize('N',[10,40])
@pytest.mark.parametrize('limit',[0.1,0.6])
def test_where(self,N,limit):
r = Table(np.random.rand(N,1),{'X':1})
assert np.all(r[r.where(f'#X# > {limit}')].get('X') > limit)
@pytest.mark.parametrize('mode',['str','path'])
def test_write_read(self,default,tmp_path,mode):
default.save(tmp_path/'default.txt')