@@ -131,7 +131,8 @@ def __new__(cls, expr, *dims, **kwargs):
131131 )
132132 if any ([not is_integer (d ) or d < 0 for d in deriv_order ]):
133133 raise TypeError (
134- 'Invalid type in `deriv_order`, all elements must be non-negative Python `int`s'
134+ 'Invalid type in `deriv_order`, all elements must be non-negative'
135+ 'Python `int`s'
135136 )
136137
137138 # Count the number of derivatives for each dimension
@@ -140,7 +141,8 @@ def __new__(cls, expr, *dims, **kwargs):
140141 if isinstance (d , Iterable ):
141142 if not is_integer (d [1 ]) or d [1 ] < 0 :
142143 raise TypeError (
143- 'Invalid type for derivative order, it must be non-negative Python `int`'
144+ 'Invalid type for derivative order, it must be'
145+ 'non-negative Python `int`'
144146 )
145147 else :
146148 dcounter [d [0 ]] += d [1 ]
@@ -506,8 +508,10 @@ def _eval_fd(self, expr, **kwargs):
506508
507509 def _eval_expand_nest (self , ** hints ):
508510 ''' Expands nested derivatives
509- `Derivative(Derivative(f(x), (x, b)), (x, a)) --> Derivative(f(x), (x, a+b))`
510- `Derivative(Derivative(f(x), (y, b)), (x, a)) --> Derivative(f(x), (x, a), (y, b))`
511+ `Derivative(Derivative(f(x), (x, b)), (x, a))
512+ --> Derivative(f(x), (x, a+b))`
513+ `Derivative(Derivative(f(x), (y, b)), (x, a))
514+ --> Derivative(f(x), (x, a), (y, b))`
511515 Note that this is not always a valid expansion depending on the kwargs
512516 used to construct the derivative.
513517 '''
@@ -531,7 +535,8 @@ def _eval_expand_nest(self, **hints):
531535
532536 def _eval_expand_mul (self , ** hints ):
533537 ''' Expands products, moving independent terms outside the derivative
534- `Derivative(C·f(x)·g(c, y), x) --> C·g(y)·Derivative(f(x), x)`
538+ `Derivative(C·f(x)·g(c, y), x)
539+ --> C·g(y)·Derivative(f(x), x)`
535540 '''
536541 expr = self .args [0 ]
537542 if isinstance (expr , sympy .Mul ):
@@ -542,7 +547,8 @@ def _eval_expand_mul(self, **hints):
542547
543548 def _eval_expand_add (self , ** hints ):
544549 ''' Expands sums, using linearity of derivative
545- `Derivative(f(x) + g(x), x) --> Derivative(f(x), x) + Derivative(g(x), x)`
550+ `Derivative(f(x) + g(x), x)
551+ --> Derivative(f(x), x) + Derivative(g(x), x)`
546552 '''
547553 expr = self .args [0 ]
548554 if isinstance (expr , sympy .Add ):
0 commit comments