Skip to content

Commit

Permalink
fix doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
boeddeker committed May 29, 2024
1 parent 23fc17c commit 4aabedc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions paderbox/array/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,12 +730,14 @@ def _repr_pretty_(self, p, cycle):
>>> a[:5] = 1
>>> a[7:] = 2
>>> pb.utils.pretty.pprint(a)
SparseArray(_SparseSegment(onset=0, array=array([1., 1., 1., 1., 1.], dtype=float32)),
SparseArray(_SparseSegment(onset=0,
array=array([1., 1., 1., 1., 1.], dtype=float32)),
_SparseSegment(onset=7, array=array([2., 2., 2.], dtype=float32)),
shape=(10,))
>>> a._pad_value = _get_pad_value(a.dtype, -1)
>>> pb.utils.pretty.pprint(a)
SparseArray(_SparseSegment(onset=0, array=array([1., 1., 1., 1., 1.], dtype=float32)),
SparseArray(_SparseSegment(onset=0,
array=array([1., 1., 1., 1., 1.], dtype=float32)),
_SparseSegment(onset=7, array=array([2., 2., 2.], dtype=float32)),
shape=(10,), pad_value=-1.0)
"""
Expand Down

0 comments on commit 4aabedc

Please sign in to comment.