diff --git a/openmdao/components/exec_comp.py b/openmdao/components/exec_comp.py index 755e5f681f..b5c914b8a9 100644 --- a/openmdao/components/exec_comp.py +++ b/openmdao/components/exec_comp.py @@ -232,7 +232,7 @@ def compute(self, inputs, outputs): for expr in self._codes: exec(expr, _expr_dict, _IODict(outputs, inputs)) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Use complex step method to update the given Jacobian. @@ -241,9 +241,6 @@ def compute_partials(self, inputs, outputs, partials): inputs : `VecWrapper` `VecWrapper` containing parameters. (p) - outputs : `VecWrapper` - `VecWrapper` containing outputs and states. (u) - partials : `Jacobian` Contains sub-jacobians. """ @@ -273,7 +270,7 @@ def compute_partials(self, inputs, outputs, partials): else: pwrap[param][idx] += step - uwrap = _TmpDict(outputs, return_complex=True) + uwrap = _TmpDict(self._outputs, return_complex=True) # solve with complex param value self._residuals.set_const(0.0) diff --git a/openmdao/components/meta_model.py b/openmdao/components/meta_model.py index 2650be5c22..74764a7391 100644 --- a/openmdao/components/meta_model.py +++ b/openmdao/components/meta_model.py @@ -312,7 +312,7 @@ def _vec_to_array2d(self, vec): return arr - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Compute sub-jacobian parts. The model is assumed to be in an unscaled state. @@ -320,8 +320,6 @@ def compute_partials(self, inputs, outputs, partials): ---------- inputs : Vector unscaled, dimensional input variables read via inputs[key] - outputs : Vector - unscaled, dimensional output variables read via outputs[key] partials : Jacobian sub-jac components written to partials[output_name, input_name] """ diff --git a/openmdao/core/explicitcomponent.py b/openmdao/core/explicitcomponent.py index b11110ec13..03f5713b33 100644 --- a/openmdao/core/explicitcomponent.py +++ b/openmdao/core/explicitcomponent.py @@ -296,7 +296,7 @@ def _linearize(self, do_nl=False, do_ln=False): # negate constant subjacs (and others that will get overwritten) # back to normal self._negate_jac() - self.compute_partials(self._inputs, self._outputs, J) + self.compute_partials(self._inputs, J) # re-negate the jacobian self._negate_jac() @@ -322,7 +322,7 @@ def compute(self, inputs, outputs): """ pass - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Compute sub-jacobian parts. The model is assumed to be in an unscaled state. @@ -330,8 +330,6 @@ def compute_partials(self, inputs, outputs, partials): ---------- inputs : Vector unscaled, dimensional input variables read via inputs[key] - outputs : Vector - unscaled, dimensional output variables read via outputs[key] partials : Jacobian sub-jac components written to partials[output_name, input_name] """ diff --git a/openmdao/core/tests/test_approx_derivs.py b/openmdao/core/tests/test_approx_derivs.py index ed5c9cac41..f94f0f0030 100644 --- a/openmdao/core/tests/test_approx_derivs.py +++ b/openmdao/core/tests/test_approx_derivs.py @@ -153,7 +153,7 @@ def test_arrray_comp(self): class DoubleArrayFD(DoubleArrayComp): - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Override deriv calculation. """ @@ -493,7 +493,7 @@ def test_arrray_comp(self, vec_class): class DoubleArrayFD(DoubleArrayComp): - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Override deriv calculation. """ diff --git a/openmdao/core/tests/test_check_derivs.py b/openmdao/core/tests/test_check_derivs.py index 07d86e62d2..492f9234bc 100644 --- a/openmdao/core/tests/test_check_derivs.py +++ b/openmdao/core/tests/test_check_derivs.py @@ -27,7 +27,7 @@ def compute(self, inputs, outputs): """ Doesn't do much. """ outputs['y'] = 3.0*inputs['x1'] + 4.0*inputs['x2'] - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """Intentionally incorrect derivative.""" J = partials J['y', 'x1'] = np.array([4.0]) @@ -74,7 +74,7 @@ def compute(self, inputs, outputs): """ Doesn't do much. """ outputs['y'] = 3.0*inputs['x1'] + 4.0*inputs['x2'] - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """Intentionally incorrect derivative.""" J = partials J['y', 'x1'] = np.array([4.0]) @@ -117,7 +117,7 @@ def compute(self, inputs, outputs): """ Doesn't do much. """ outputs['y'] = 3.0*inputs['x1'] + 4.0*inputs['x2'] - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """Intentionally incorrect derivative.""" J = partials J['y', 'x1'] = np.array([4.0]) @@ -153,7 +153,7 @@ def compute(self, inputs, outputs): """ Doesn't do much. """ outputs['y'] = 3.0*inputs['x1'] + 4.0*inputs['x2'] - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """Intentionally incorrect derivative.""" J = partials J['y', 'x1'] = np.array([4.0]) @@ -193,7 +193,7 @@ def compute(self, inputs, outputs): """ Doesn't do much. """ outputs['y'] = 3.0*inputs['x1'] + 4.0*inputs['x2'] - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """Intentionally incorrect derivative.""" J = partials J['y', 'x1'] = np.array([4.0]) @@ -231,7 +231,7 @@ def compute(self, inputs, outputs): """ Doesn't do much. """ outputs['y'] = 3.0*inputs['x1'] + 4.0*inputs['x2'] - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """Intentionally left out derivative.""" J = partials J['y', 'x1'] = np.array([3.0]) @@ -317,7 +317,7 @@ def setup(self): self.run_count = 0 - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): partials['flow:T', 'T'] = 1. partials['flow:P', 'P'] = 1. diff --git a/openmdao/core/tests/test_expl_comp.py b/openmdao/core/tests/test_expl_comp.py index 61fab53f7b..f39d7cd6e0 100644 --- a/openmdao/core/tests/test_expl_comp.py +++ b/openmdao/core/tests/test_expl_comp.py @@ -27,7 +27,7 @@ def compute(self, inputs, outputs): class RectanglePartial(RectangleComp): - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): partials['area', 'length'] = inputs['width'] partials['area', 'width'] = inputs['length'] diff --git a/openmdao/core/tests/test_matmat.py b/openmdao/core/tests/test_matmat.py index e41e616a04..2763889f67 100644 --- a/openmdao/core/tests/test_matmat.py +++ b/openmdao/core/tests/test_matmat.py @@ -224,7 +224,7 @@ def compute(self, inputs, outputs): outputs['f_arclength'] = np.sqrt(1 + inputs['yp_lgl']**2) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): partials['f_arclength', 'yp_lgl'] = inputs['yp_lgl'] / np.sqrt(1 + inputs['yp_lgl']**2) diff --git a/openmdao/core/tests/test_parallel_groups.py b/openmdao/core/tests/test_parallel_groups.py index 640dca031a..b792bb1b45 100644 --- a/openmdao/core/tests/test_parallel_groups.py +++ b/openmdao/core/tests/test_parallel_groups.py @@ -211,7 +211,7 @@ def setup(self): def compute(self, inputs, outputs): outputs['y'] = inputs['x'] * self.mult - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): partials['y', 'x'] = numpy.array([self.mult]) prob = Problem() diff --git a/openmdao/core/tests/test_reconf.py b/openmdao/core/tests/test_reconf.py index 4f2d8e8bcb..62fbec6184 100644 --- a/openmdao/core/tests/test_reconf.py +++ b/openmdao/core/tests/test_reconf.py @@ -26,7 +26,7 @@ def setup(self): def compute(self, inputs, outputs): outputs['y'] = 2 * inputs['x'] - def compute_partials(self, inputs, outputs, jacobian): + def compute_partials(self, inputs, jacobian): jacobian['y', 'x'] = 2 * np.ones((self.size, 1)) @@ -39,7 +39,7 @@ def setup(self): def compute(self, inputs, outputs): outputs['z'] = 3 * inputs['x'] - def compute_partials(self, inputs, outputs, jacobian): + def compute_partials(self, inputs, jacobian): jacobian['z', 'x'] = 3.0 diff --git a/openmdao/core/tests/test_reconf_dynamic.py b/openmdao/core/tests/test_reconf_dynamic.py index caf0c31fcd..43ff168965 100644 --- a/openmdao/core/tests/test_reconf_dynamic.py +++ b/openmdao/core/tests/test_reconf_dynamic.py @@ -28,7 +28,7 @@ def setup(self): def compute(self, inputs, outputs): outputs['y'] = 2 * inputs['x'] - def compute_partials(self, inputs, outputs, jacobian): + def compute_partials(self, inputs, jacobian): jacobian['y', 'x'] = 2 * np.ones((self.size, 1)) @@ -47,7 +47,7 @@ def setup(self): def compute(self, inputs, outputs): outputs['z'] = 3 * inputs['x'] - def compute_partials(self, inputs, outputs, jacobian): + def compute_partials(self, inputs, jacobian): jacobian['z', 'x'] = 3.0 diff --git a/openmdao/core/tests/test_scaling.py b/openmdao/core/tests/test_scaling.py index aa33497dd1..86c65e3786 100644 --- a/openmdao/core/tests/test_scaling.py +++ b/openmdao/core/tests/test_scaling.py @@ -343,7 +343,7 @@ def setup(self): def compute(self, inputs, outputs): outputs['y'] = 2.0*(inputs['x'] + 1.0) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Jacobian for Sellar discipline 1. """ diff --git a/openmdao/docs/features/building_components/explicitcomp.rst b/openmdao/docs/features/building_components/explicitcomp.rst index 226e9fa368..0b1525b4c0 100644 --- a/openmdao/docs/features/building_components/explicitcomp.rst +++ b/openmdao/docs/features/building_components/explicitcomp.rst @@ -31,10 +31,9 @@ The implementation of each method will be illustrated using a simple explicit co .. embed-code:: openmdao.core.tests.test_expl_comp.RectangleComp.compute -- :code:`compute_partials(inputs, outputs, partials)` : +- :code:`compute_partials(inputs, partials)` : [Optional] Compute the :code:`partials` (partial derivatives) given the :code:`inputs`. - The :code:`outputs` are also provided for convenience. .. embed-code:: openmdao.core.tests.test_expl_comp.RectanglePartial.compute_partials diff --git a/openmdao/docs/style_guide/sphinx_decorators.rst b/openmdao/docs/style_guide/sphinx_decorators.rst index a64b56544e..1c7886368d 100644 --- a/openmdao/docs/style_guide/sphinx_decorators.rst +++ b/openmdao/docs/style_guide/sphinx_decorators.rst @@ -29,7 +29,7 @@ and a method that looks like this and has the decorator applied to it: :: @mydecorator - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Compute sub-jacobian parts / factorization. @@ -37,8 +37,6 @@ and a method that looks like this and has the decorator applied to it: ---------- inputs : Vector unscaled, dimensional input variables read via inputs[key] - outputs : Vector - unscaled, dimensional output variables read via outputs[key] partials : Jacobian sub-jac components written to partials[output_name, input_name] """ @@ -57,7 +55,7 @@ But if we add the call signature of the method to the docstring as the first lin :: @mydecorator - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Compute sub-jacobian parts / factorization. @@ -65,8 +63,6 @@ But if we add the call signature of the method to the docstring as the first lin ---------- inputs : Vector unscaled, dimensional input variables read via inputs[key] - outputs : Vector - unscaled, dimensional output variables read via outputs[key] partials : Jacobian sub-jac components written to partials[output_name, input_name] """ diff --git a/openmdao/drivers/tests/test_pyoptsparse_driver.py b/openmdao/drivers/tests/test_pyoptsparse_driver.py index e136faf1b6..75cf4ce558 100644 --- a/openmdao/drivers/tests/test_pyoptsparse_driver.py +++ b/openmdao/drivers/tests/test_pyoptsparse_driver.py @@ -59,7 +59,7 @@ def compute(self, inputs, outputs): outputs['f_xy'] = (x-3.0)**2 + x*y + (y+4.0)**2 - 3.0 self.eval_iter_count += 1 - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Jacobian for our paraboloid.""" if self.grad_iter_count == self.grad_fail_at: diff --git a/openmdao/jacobians/tests/test_jacobian.py b/openmdao/jacobians/tests/test_jacobian.py index e54788ef22..e55d07ca70 100644 --- a/openmdao/jacobians/tests/test_jacobian.py +++ b/openmdao/jacobians/tests/test_jacobian.py @@ -43,7 +43,7 @@ def compute(self, inputs, outputs): y[0]*17. - y[0]*y[1] + 2.*y[1] outputs['f'][1] = outputs['f'][0]*3.0 - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): x = inputs['x'] y = inputs['y'] jac1 = self._jac_type(np.array([ @@ -94,7 +94,7 @@ def compute(self, inputs, outputs): z = inputs['z'] outputs['f'] = (w[0]-5.0)**2 + (w[1]+1.0)**2 + w[2]*6. + z*7. - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): w = inputs['w'] z = inputs['z'] jac = self._jac_type(np.array([[ @@ -137,7 +137,7 @@ def setup(self): self.add_input('in', val=in_val*scale) self.add_output('out', val=out_val*scale) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): partials['out', 'in'] = self._constructor(self._value) diff --git a/openmdao/jacobians/tests/test_jacobian_features.py b/openmdao/jacobians/tests/test_jacobian_features.py index 664e407609..7c43a6716b 100644 --- a/openmdao/jacobians/tests/test_jacobian_features.py +++ b/openmdao/jacobians/tests/test_jacobian_features.py @@ -31,7 +31,7 @@ def compute(self, inputs, outputs): + np.outer(np.ones(2), inputs['y2']) + inputs['x']*np.eye(2)) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): partials['f', 'x'] = 1. partials['f', 'z'] = np.ones((1, 4)) @@ -102,7 +102,7 @@ def compute(self, inputs, outputs): outputs['f'] = np.sum(inputs['z']) + inputs['x'] outputs['g'] = np.outer(inputs['y1'] + inputs['y3'], inputs['y2']) + inputs['x'] * np.eye(2) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): pass @@ -119,7 +119,7 @@ def setup(self): self.approx_partials('*', '*', **self.kwargs) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): pass @@ -137,7 +137,7 @@ def setup(self): self.approx_partials('g', 'x', **self.kwargs) self.approx_partials('g', 'y2', **self.kwargs) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): partials['f', 'x'] = 1. partials['f', 'z'] = np.ones((1, 4)) @@ -157,7 +157,7 @@ def setup(self): self.declare_partials(**self.partial_kwargs) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): pass @@ -403,7 +403,7 @@ def setup(self): self.add_output('z', shape=(3,)) self.add_input('x', shape=(3,), units='degF') - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): partials['y', 'x'] = self.A partials['z', 'x'] = self.A @@ -464,7 +464,7 @@ def setup(self): self.declare_partials(of='f', wrt='x', rows=[0,1,1,1], cols=[0,1,2,3]) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): pd = partials['f', 'x'] # Corresponds to the (0, 0) entry @@ -503,7 +503,7 @@ def setup(self): self.declare_partials(of='f', wrt='x', rows=[0, 1, 1, 1], cols=[0, 1, 2, 3]) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): # Corresponds to the [(0,0), (1,1), (1,2), (1,3)] entries. partials['f', 'x'] = [1., 2., 3., 4.] @@ -534,7 +534,7 @@ def setup(self): val=[1. , 2., 3., 4.]) self.declare_partials(of='f', wrt='y', val=sp.sparse.eye(2, format='csc')) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): pass model = Group() diff --git a/openmdao/solvers/linesearch/tests/test_backtracking.py b/openmdao/solvers/linesearch/tests/test_backtracking.py index 11129d6461..e9a5dc1a17 100644 --- a/openmdao/solvers/linesearch/tests/test_backtracking.py +++ b/openmdao/solvers/linesearch/tests/test_backtracking.py @@ -152,7 +152,7 @@ def compute(self, inputs, outputs): outputs['f_xy'] = (x-3.0)**2 + x*y + (y+4.0)**2 - 3.0 - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Jacobian for our paraboloid.""" x = inputs['x'] y = inputs['y'] diff --git a/openmdao/test_suite/components/cycle_comps.py b/openmdao/test_suite/components/cycle_comps.py index d5cc78f2ae..faa82140c2 100644 --- a/openmdao/test_suite/components/cycle_comps.py +++ b/openmdao/test_suite/components/cycle_comps.py @@ -273,7 +273,7 @@ def _array2kwargs(self, arr, pd_type): else: return {'val': jac} - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): if self.metadata['jacobian_type'] != 'matvec' and not self.metadata['finite_difference']: angle_param = self._cycle_names[self.angle_param] angle = inputs[angle_param] @@ -361,7 +361,7 @@ def compute(self, inputs, outputs): # theta_out has 1/2 the error as theta does to the correct angle. outputs[self._cycle_names['theta_out']] = theta / 2 + (self._n * 2 * np.pi - psi) / (2 * k - 2) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): if self.metadata['jacobian_type'] != 'matvec' and not self.metadata['finite_difference']: pd_type = self.metadata['partial_type'] for i in range(self.metadata['num_var']): diff --git a/openmdao/test_suite/components/expl_comp_array.py b/openmdao/test_suite/components/expl_comp_array.py index 7044de697f..1b63fcfccc 100644 --- a/openmdao/test_suite/components/expl_comp_array.py +++ b/openmdao/test_suite/components/expl_comp_array.py @@ -27,7 +27,7 @@ def compute(self, inputs, outputs): class TestExplCompArrayDense(TestExplCompArray): - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): thk = self.metadata['thickness'] partials['areas', 'lengths'] = np.diag(inputs['widths'].flatten()) @@ -38,7 +38,7 @@ def compute_partials(self, inputs, outputs, partials): class TestExplCompArraySpmtx(TestExplCompArray): - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): thk = self.metadata['thickness'] inds = np.arange(4) @@ -54,7 +54,7 @@ def compute_partials(self, inputs, outputs, partials): class TestExplCompArraySparse(TestExplCompArray): - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): thk = self.metadata['thickness'] inds = np.arange(4) diff --git a/openmdao/test_suite/components/expl_comp_simple.py b/openmdao/test_suite/components/expl_comp_simple.py index 0f10b243d7..ec553e1f72 100644 --- a/openmdao/test_suite/components/expl_comp_simple.py +++ b/openmdao/test_suite/components/expl_comp_simple.py @@ -19,14 +19,14 @@ def compute(self, inputs, outputs): class TestExplCompSimpleDense(TestExplCompSimple): - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): partials['area', 'length'] = inputs['width'] partials['area', 'width'] = inputs['length'] class TestExplCompSimpleSpmtx(TestExplCompSimple): - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): partials['area', 'length'] = scipy.sparse.csr_matrix( (inputs['width'], (0, 0))) partials['area', 'width'] = scipy.sparse.csr_matrix( @@ -35,7 +35,7 @@ def compute_partials(self, inputs, outputs, partials): class TestExplCompSimpleSparse(TestExplCompSimple): - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): partials['area', 'length'] = (inputs['width'], 0, 0) partials['area', 'width'] = (inputs['length'], 0, 0) diff --git a/openmdao/test_suite/components/paraboloid.py b/openmdao/test_suite/components/paraboloid.py index 87a61a3334..b0207c064b 100644 --- a/openmdao/test_suite/components/paraboloid.py +++ b/openmdao/test_suite/components/paraboloid.py @@ -27,7 +27,7 @@ def compute(self, inputs, outputs): outputs['f_xy'] = (x-3.0)**2 + x*y + (y+4.0)**2 - 3.0 - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Jacobian for our paraboloid. """ diff --git a/openmdao/test_suite/components/paraboloid_mat_vec.py b/openmdao/test_suite/components/paraboloid_mat_vec.py index d046749e75..253bb7dddb 100644 --- a/openmdao/test_suite/components/paraboloid_mat_vec.py +++ b/openmdao/test_suite/components/paraboloid_mat_vec.py @@ -4,7 +4,7 @@ class ParaboloidMatVec(Paraboloid): """ Use matrix-vector product.""" - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """Analytical derivatives.""" pass diff --git a/openmdao/test_suite/components/sellar.py b/openmdao/test_suite/components/sellar.py index 0d547ac2c4..9b2cca6858 100644 --- a/openmdao/test_suite/components/sellar.py +++ b/openmdao/test_suite/components/sellar.py @@ -86,7 +86,7 @@ def _turn_on_fd(self): # Finite difference nothing pass - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Jacobian for Sellar discipline 1. """ @@ -162,7 +162,7 @@ def _turn_on_fd(self): # Finite difference nothing pass - def compute_partials(self, inputs, outputs, J): + def compute_partials(self, inputs, J): """ Jacobian for Sellar discipline 2. """ diff --git a/openmdao/test_suite/components/simple_comps.py b/openmdao/test_suite/components/simple_comps.py index 8208d9d2a2..53acab8b84 100644 --- a/openmdao/test_suite/components/simple_comps.py +++ b/openmdao/test_suite/components/simple_comps.py @@ -36,7 +36,7 @@ def compute(self, inputs, outputs): outputs['y2'] = self.JJ[2:4, 0:2].dot(inputs['x1']) + \ self.JJ[2:4, 2:4].dot(inputs['x2']) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Analytical derivatives. """ @@ -77,7 +77,7 @@ def compute(self, inputs, outputs): outputs['y2'] = self.JJ[3:4, 0:2].dot(inputs['x1']) + \ self.JJ[3:4, 2:4].dot(inputs['x2']) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Analytical derivatives. """ diff --git a/openmdao/test_suite/components/unit_conv.py b/openmdao/test_suite/components/unit_conv.py index 3da74134c1..07714e614a 100644 --- a/openmdao/test_suite/components/unit_conv.py +++ b/openmdao/test_suite/components/unit_conv.py @@ -16,7 +16,7 @@ def compute(self, inputs, outputs): """ Pass through.""" outputs['x2'] = inputs['x1'] - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Derivative is 1.0""" partials['x2', 'x1'] = 1.0 @@ -28,7 +28,7 @@ def setup(self): super(SrcCompFD, self).setup() self.approx_partials('*', '*') - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Override""" pass @@ -44,7 +44,7 @@ def compute(self, inputs, outputs): """ Pass through.""" outputs['x3'] = inputs['x2'] - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Derivative is 1.0""" partials['x3', 'x2'] = 1.0 @@ -56,7 +56,7 @@ def setup(self): super(TgtCompFFD, self).setup() self.approx_partials('*', '*') - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Override""" pass @@ -72,7 +72,7 @@ def compute(self, inputs, outputs): """ Pass through.""" outputs['x3'] = inputs['x2'] - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Derivative is 1.0""" partials['x3', 'x2'] = 1.0 @@ -84,7 +84,7 @@ def setup(self): super(TgtCompCFD, self).setup() self.approx_partials('*', '*') - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Override""" pass @@ -100,7 +100,7 @@ def compute(self, inputs, outputs): """ Pass through.""" outputs['x3'] = inputs['x2'] - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Derivative is 1.0""" partials['x3', 'x2'] = 1.0 @@ -112,7 +112,7 @@ def setup(self): super(TgtCompKFD, self).setup() self.approx_partials('*', '*') - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): """ Override""" pass @@ -132,7 +132,7 @@ def compute(self, inputs, outputs): """ Pass through.""" outputs['x3'] = inputs['x2'] - def compute_partials(self, inputs, outputs, J): + def compute_partials(self, inputs, J): """ Derivative is 1.0""" J['_x3', 'x2'] = np.array([1.0]) J['_x3', '_x2'] = 0.0 diff --git a/openmdao/test_suite/groups/sin_fitter.py b/openmdao/test_suite/groups/sin_fitter.py index d166812397..11b3dc41d0 100644 --- a/openmdao/test_suite/groups/sin_fitter.py +++ b/openmdao/test_suite/groups/sin_fitter.py @@ -224,7 +224,7 @@ def compute(self, inputs, outputs): outputs['f_arclength'] = np.sqrt(1 + inputs['yp_lgl']**2) - def compute_partials(self, inputs, outputs, partials): + def compute_partials(self, inputs, partials): partials['f_arclength', 'yp_lgl'] = inputs['yp_lgl'] / np.sqrt(1 + inputs['yp_lgl']**2)