Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 67ccb8a

Browse files
committed
Complete piecewise.py coverage
1 parent a7c8bb9 commit 67ccb8a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/sage/functions/piecewise.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ def _print_(self, parameters, variable):
168168
169169
EXAMPLES::
170170
171-
171+
sage: p = piecewise([((-2, 0), -x), ([0, 4], x)], var=x)
172+
sage: str(p) # indirect doctest
173+
'piecewise(x|-->-x on (-2, 0), x|-->x on [0, 4]; x)'
172174
"""
173175
s = 'piecewise('
174176
args = []
@@ -258,7 +260,7 @@ def is_piecewise(ex):
258260

259261

260262
@staticmethod
261-
def simplify():
263+
def simplify(ex):
262264
"""
263265
Combine piecewise operands into single piecewise function
264266
@@ -267,6 +269,13 @@ def simplify():
267269
A piecewise function whose operands are not piecewiese if
268270
possible, that is, as long as the piecewise variable is the same.
269271
272+
EXAMPLES::
273+
274+
sage: f = piecewise([([0,0], sin(x)), ((0,2), cos(x))])
275+
sage: piecewise.simplify(f)
276+
Traceback (most recent call last):
277+
...
278+
NotImplementedError
270279
"""
271280
raise NotImplementedError
272281

0 commit comments

Comments
 (0)