Skip to content

Commit

Permalink
0.2.15: superintend with n_samples=0 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ebonnal committed Aug 7, 2023
1 parent 827d220 commit fb89617
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kioss/pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def iterate():
return timeit.timeit(iterate, number=1)

def superintend(
self, n_samples: int = float("inf"), n_error_samples: int = 8
self, n_samples: int = 0, n_error_samples: int = 8
) -> List[T]:
"""
Superintend the Pipe: iterate over the pipe until it is exhausted and raise a RuntimeError if any exceptions occur during iteration.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='kioss',
version='0.2.14',
version='0.2.15',
packages=['kioss'],
url='http://github.com/bonnal-enzo/kioss',
license='Apache 2.',
Expand Down
3 changes: 1 addition & 2 deletions test/test_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,11 @@ def test_catch(self, n_workers: Optional[int], worker_type: str):
)

def test_superintend(self):
Pipe("123").map(int).log("custom named elements").superintend()
self.assertRaises(
ValueError,
lambda: Pipe("12-3").map(int).superintend(),
)
self.assertListEqual(Pipe("123").map(int).superintend(), [1, 2, 3])
self.assertListEqual(Pipe("123").map(int).superintend(n_samples=3), [1, 2, 3])

def test_log(self):
self.assertListEqual(
Expand Down

0 comments on commit fb89617

Please sign in to comment.