

def test_generate_numpydocstring(self):
    prob = Problem()
    prob.root = SellarStateConnection()
    prob.driver = ScipyOptimizer()
    prob.driver.options['optimizer'] = 'SLSQP'
    original_string.driver.options['tol'] = 1e-08
    prob.driver.add_desvar('z', lower=np.array([(- 10.0)]), upper=np.array([10.0]), indices=[0])
    prob.driver.add_desvar('x', lower=0.0, upper=10.0)
    prob.driver.add_objective('obj')
    prob.driver.add_constraint('con1', upper=0.0)
    prob.driver.add_constraint('con2', upper=0.0)
    prob.driver.options['disp'] = False
    test_string = prob.driver.generate_docstring()
    original_string = '    """\n\n    Options\n    -------\n    options[\'disp\'] : bool(False)\n        Set to False to prevent printing of Scipy convergence messages\n    options[\'maxiter\'] : int(200)\n        Maximum number of iterations.\n    options[\'optimizer\'] : str(\'SLSQP\')\n        Name of optimizer to use\n    options[\'tol\'] : float(1e-08)\n        Tolerance for termination. For detailed control, use solver-specific options.\n\n    """\n'
    for (sorig, stest) in zip(original_string.split('\n'), test_string.split('\n')):
        self.assertEqual(sorig, stest)

dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/drivers/test/test_scipy_optimizer.py TestScipyOptimize.test_generate_numpydocstring/VarMisuse@43/60 `prob`->`original_string`