Git Product home page Git Product logo

openmdao's Introduction

GitHub Actions Test Badge Coveralls Badge PyPI version PyPI Monthly Downloads

OpenMDAO is an open-source high-performance computing platform for systems analysis and multidisciplinary optimization, written in Python. It enables you to decompose your models, making them easier to build and maintain, while still solving them in a tightly coupled manner with efficient parallel numerical methods.

The OpenMDAO project is primarily focused on supporting gradient-based optimization with analytic derivatives to allow you to explore large design spaces with hundreds or thousands of design variables, but the framework also has a number of parallel computing features that can work with gradient-free optimization, mixed-integer nonlinear programming, and traditional design space exploration.

If you are using OpenMDAO, please cite us!

Documentation

Documentation for the latest version can be found here.

Documentation archives for prior versions can be found here.

Important Notice

While the API is relatively stable, OpenMDAO remains in active development. There will be periodic changes to the API. User's are encouraged to pin their version of OpenMDAO to a recent release and update periodically.

Install OpenMDAO

You have two options for installing OpenMDAO, (1) from the Python Package Index (PyPI), and (2) from the GitHub repository.

OpenMDAO includes several optional sets of dependencies including: test for installing the developer tools (e.g., testing, coverage), docs for building the documentation and visualization for some extra visualization tools. Specifying all will include all of the optional dependencies.

Install from PyPI

This is the easiest way to install OpenMDAO. To install only the runtime dependencies:

pip install openmdao

To install all the optional dependencies:

pip install openmdao[all]

Install from a Cloned Repository

This allows you to install OpenMDAO from a local copy of the source code.

git clone http://github.com/OpenMDAO/OpenMDAO
cd OpenMDAO
pip install .

If you would like to make changes to OpenMDAO it is recommended you install it in editable mode (i.e., development mode) by adding the -e flag when calling pip, this way any changes you make to the source code will be included when you import OpenMDAO in Python. You will also want to install the packages necessary for running OpenMDAO's tests and documentation generator. You can install everything needed for development by running:

pip install -e OpenMDAO[all]

OpenMDAO Versions

OpenMDAO 3.x.y represents the current, supported version. It requires Python 3.8 or later and is maintained here. To upgrade to the latest release, run:

pip install --upgrade openmdao

OpenMDAO 2.10.x was the last version to support Python 2.x and is no longer supported. To install this older release, run:

pip install "openmdao<3"

OpenMDAO 1.7.4 was an earlier version of OpenMDAO and is also no longer supported. The code repository is now named OpenMDAO1, and has moved here. To install it, run:

pip install "openmdao<2"

The legacy OpenMDAO v0.x (versions 0.13.0 and older) of the OpenMDAO-Framework are here.

Test OpenMDAO

Users are encouraged to run the unit tests to ensure OpenMDAO is performing correctly. In order to do so, you must install the testing dependencies.

  1. Install OpenMDAO and its testing dependencies:

    pip install openmdao[test]

    Alternatively, you can clone the repository, as explained here, and install the development dependencies as described here.

  2. Run tests:

    testflo openmdao -n 1

  3. If everything works correctly, you should see a message stating that there were zero failures. If the tests produce failures, you are encouraged to report them as an issue. If so, please make sure you include your system spec, and include the error message.

    If tests fail, please include your system information, you can obtain that by running the following commands in python and copying the results produced by the last line.

     import platform, sys
    
     info = platform.uname()
     (info.system, info.version), (info.machine, info.processor), sys.version
    

    Which should produce a result similar to:

     (('Windows', '10.0.17134'),
      ('AMD64', 'Intel64 Family 6 Model 94 Stepping 3, GenuineIntel'),
      '3.6.6 | packaged by conda-forge | (default, Jul 26 2018, 11:48:23) ...')
    

Build the Documentation for OpenMDAO

Documentation for the latest version can always be found here, but if you would like to build a local copy you can find instructions to do so here.

openmdao's People

Contributors

a-cgray avatar andrewellis55 avatar bbrelje avatar bernardopacini avatar crecine avatar dakror avatar dkilkenny avatar dwmunster avatar eytanadler avatar fzahle avatar garobed1 avatar gbarter avatar hschilling avatar hwangjt avatar johnjasa avatar justinsgray avatar kenneth-t-moore avatar naylor-b avatar nsteffen avatar relf avatar robfalck avatar ryanfarr01 avatar sahinbatu avatar shamsheersc19 avatar subraiz avatar swryan avatar tadkollar avatar thearn avatar tuckerbabcock avatar wright avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openmdao's Issues

BalanceComponent default "normalize" option randomly causes DirectSolver singular errors

I was porting all my OpenConcept test cases over to my new solver ODE-based formulation and for some reason my Caravan test case just would not converge. I was getting

RuntimeError: Identical rows or columns found in jacobian in ''. Problem is underdetermined.

errors but only for certain combinations of wing area and MTOW which was odd to me. I followed the advice here but found no NaN / div 0 problems in the partial derivatives or output values.

It turns out that the problem was due to the normalize=True default of the BalanceComp I was using to set throttle. Problem immediately resolved and Newton converged normally when I turned that option to False. Because of the particular RHS value at the starting point, the sensitivity of the balance comp to the LHS was almost zero after normalization.

The nonspecific error message (i.e. not identifying the component with the issue by name and component) exacerbated the debugging process.

Proposed resolution is one of the following:

  • mention "near-zero partial derivatives in implicit components" as a possible cause of singular Jacobian convergence failures
  • make normalize=False the default for BalanceComponent to avoid non-intuitive behavior

Suggestion:

  • identify singular entries by name in the OpenMDAO namespace for all types of assembled jacobians. csc provides no info and Dense provides little info on where to isolate the problem in your model

View N2 even with connection exceptions

Summary of Issue

Allow the N2 to be viewed from the command line interface even if connection-related exceptions are encountered during setup.

Issue Type

  • Bug
  • Enhancement

Description

Currently if a user is encountering errors in issuing connections, they might find it useful to view the N2 diagram to check errant names and currently-unconnected inputs. However, setup will raise and prevent the N2 from being reviewed. When invoked from the command line, the N2 viewer should ignore connection errors and render the N2 diagram without them.

Example

N/A

Environment

N/A

AnalysisError not imported in SimpleGADriver

In version 2.4.0 AnalysisError is raised (line 277), but the AnalysisError is not imported.
Adding to the import statements solves the issue:

from openmdao.core.analysis_error import AnalysisError

Many new warnings raised in 2.7.1

The "check" function during setup raises the following new type of WARNING following the upgrade to 2.7:

WARNING: Input 'analysis.v0v1.acmodel.OEW.totalempty.W_propeller' was explicitly connected in group 'analysis.v0v1.acmodel' as 'W_propeller', but was promoted up from groups ['analysis', 'analysis.v0v1.acmodel']

I do this all over the place in my models in OpenConcept so dozens/hundreds of warnings are now raised at check time. Is this type of connection functionality staged for deprecation? If so, why? If not, why the warning? What exactly is the danger here?

Add support for approximation schemes for partials in MetaModelUnStructuredComp

Currently, if an output is added to a MetaModelUnStructuredComp component that uses a surrogate model that does not support analytical partials (aka did not override SurrogateModel.linearize), an optimization will always fail with the error that no Jacobian method has been defined (as is the default behavior in SurrogateModel.linearize).

I agree that surrogate models normallize should provide analytical gradients, but it might sometimes not be possible, for example during code testing.

To solve this, when adding an output variable, it should be tracked whether the surrogate model supports analytical gradients. This can for example be done using the overrides_method utils function (in openmdao.utils.class_util). Then, the _setup_partials function must be modified to support approximation schemes for the relevant output variable partials.

Virtual Environment

I cannot use the function 'check'. Do I must call this inside the python script, or in the cmd?
And if I have to add openmdao to the virtual environment, how do I do this?
Actually, I use the Conda distribution of Python.

thanks

COBYLA with scaling

Using COBYLA with the ref argument set or scaling in the objective causes optimization to fail:

from openmdao.api import Problem, ScipyOptimizeDriver, ExecComp, IndepVarComp

# We'll use the component that was defined in the last tutorial
from openmdao.test_suite.components.paraboloid import Paraboloid

def get_prob():
    # build the model
    prob = Problem()
    indeps = prob.model.add_subsystem('indeps', IndepVarComp())
    indeps.add_output('x', 3.0)
    indeps.add_output('y', -4.0)
    
    prob.model.add_subsystem('parab', Paraboloid())
    
    # define the component whose output will be constrained
    prob.model.add_subsystem('const', ExecComp('g = x + y'))
    
    prob.model.connect('indeps.x', ['parab.x', 'const.x'])
    prob.model.connect('indeps.y', ['parab.y', 'const.y'])
    
    # setup the optimization
    prob.driver = ScipyOptimizeDriver()
    prob.driver.options['optimizer'] = 'COBYLA'
    
    # to add the constraint to the model
    prob.model.add_constraint('const.g', lower=0, upper=10.)
    return prob

# Using ref0 and ref:
prob = get_prob()
prob.model.add_design_var('indeps.x', **{'ref0': 0, 'ref': 2, 'lower': -50, 'upper': 50})
prob.model.add_design_var('indeps.y', **{'ref0': 0, 'ref': 2, 'lower': -50, 'upper': 50})
prob.model.add_objective('parab.f_xy', scaler = 1)
prob.setup()
prob.run_driver()

# minimum value
print(prob['parab.f_xy'])

# location of the minimum
print(prob['indeps.x'])
print(prob['indeps.y'])

# Using scaler on the objective:
prob = get_prob()
prob.model.add_design_var('indeps.x', **{'ref0': 0, 'ref': 1, 'lower': -50, 'upper': 50})
prob.model.add_design_var('indeps.y', **{'ref0': 0, 'ref': 1, 'lower': -50, 'upper': 50})
prob.model.add_objective('parab.f_xy', scaler = 2)
prob.setup()
prob.run_driver()

# minimum value
print(prob['parab.f_xy'])

# location of the minimum
print(prob['indeps.x'])
print(prob['indeps.y'])

With SLSQP this runs fine.

scipy==1.0.0 causes paraboloid optimization example to fail

The paraboloid optimization example failed with error:

  File "paraboloid_optimization_example.py", line 33, in <module>
    prob.run_driver()
  File "/anaconda/envs/openmdao_py36/lib/python3.6/site-packages/openmdao/core/problem.py", line 322, in run_driver
    return self.driver.run()
  File "/anaconda/envs/openmdao_py36/lib/python3.6/site-packages/openmdao/drivers/scipy_optimizer.py", line 332, in run
    options=self.opt_settings)
  File "/anaconda/envs/openmdao_py36/lib/python3.6/site-packages/scipy/optimize/_minimize.py", line 492, in minimize
    return _minimize_cobyla(fun, x0, args, constraints, **options)
  File "/anaconda/envs/openmdao_py36/lib/python3.6/site-packages/scipy/optimize/cobyla.py", line 252, in _minimize_cobyla
    rhoend=rhoend, iprint=iprint, maxfun=maxfun,
UnboundLocalError: local variable 'iprint' referenced before assignment

See scipy issue 8118.

Switching from the latest scipy==1.0.0 to scipy==0.19.1 fixed the problem.

A couple of IPOPT issues.

Summary of Issue

Now that we are using IPOPT, a couple of issues have turned up.

Issue Type

  • Bug
  • Enhancement
    POEM #___ N/A

Description

  1. The pyoptsparse test test_show_exception_bad_opt uses IPOPT to test an optimizer the tester doesn't have. We should switch that over to one of the other commercial opts. Also, could skip the test if the user has the optimizer, since it defeats the purpose. We are checking the error message text here.

  2. Seems to be a small bug (TypeERROR raised) after IPOPT finishes with the signal handling code. Probably an easy fix. Add a test as well.

Example

'test_show_exception_bad_opt' in test_pyoptsparse shows both problems.

Environment

Operating System: All

Python environment: All

Packages: IPOPT must be installed

Test fails on Ubuntu 18.04

(test) hahnpv@dadpc:~$ testflo openmdao -n 1
....................................S....S............S..........................SSSSSSS.... ...............................................S.......S....SSS.SSSSSSSSS................... ..............SSSSSS.SS.......S.........S........S...................XXXXX.XS.............SS SSSSSSSSSS........SS..........................................................S......S...... ...S..............................................................................S......... .........S.SSSSSSSS.SSSSSSSSSSSSSSSSSS.................................................SSSS. .S....................................................SS..SSSSSSSSS..SSSSSSSSSSSSSSSSSSSSSSS SSSSSSSSSSSSSSSSSSSSSSSSSSSSS..........................
=======
circuit
=======
NL: Newton 0 ; 21.5152153 1
NL: Newton 1 ; 8.236021 0.382799841
NL: Newton 2 ; 3.02968362 0.140815863
NL: Newton 3 ; 1.11434147 0.0517931826
NL: Newton 4 ; 0.40971227 0.0190429082
NL: Newton 5 ; 0.150488221 0.00699450221
NL: Newton 6 ; 0.0551231446 0.00256205406
NL: Newton 7 ; 0.0200406862 0.000931465752
NL: Newton 8 ; 0.0071383729 0.000331782546
NL: Newton 9 ; 0.00240366903 0.000111719497
NL: Newton 10 ; 0.00069274325 3.21978303e-05
NL: Newton 11 ; 0.000129518518 6.01985693e-06
NL: Newton 12 ; 7.66202506e-06 3.56121236e-07
NL: Newton 13 ; 3.16310628e-08 1.4701718e-09
NL: Newton 14 ; 1.15199744e-12 5.35433844e-14
NL: Newton Converged
SSSSSS.........S...................S....SS..........................................S....... .......................................SSSS............................................S.... ..............S...............................................S..SSS..S..........S.......... .............SSSSSSSSSSSSSSSSSSSSS.......................................................... ..........................................................S..S............S................. ..............S.....................................S...........S/home/hahnpv/anaconda3/envs /test/lib/python3.7/site-packages/openmdao/code_review/test_lint_peps.py:LintTestCase.test_p ep8 ... FAIL (00:00:4.17, 154 MB)
Traceback (most recent call last):
File "/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/testflo/test.py", line 477, in _try_call
func()
File "/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/code_review/te st_lint_peps.py", line 115, in test_pep8
self.fail('{} PEP 8 Failure(s):\n'.format(report.total_errors) + '\n'.join(failures))
File "/home/hahnpv/anaconda3/envs/test/lib/python3.7/unittest/case.py", line 680, in fail
raise self.failureException(msg)
AssertionError: 88 PEP 8 Failure(s):
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/approximation_schemes/ complex_step.py:199: [W504] line break after binary operator
use_parallel_fd = system._num_par_fd > 1 and (system._full_comm is not None and
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/approximation_schemes/ finite_difference.py:258: [W504] line break after binary operator
use_parallel_fd = system._num_par_fd > 1 and (system._full_comm is not None and
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/surrogate_models/multi fi_cokriging.py:539: [W504] line break after binary operator
_logger.warning(('Cholesky decomposition of R at level %i failed' % lvl) +
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/surrogate_models/krigi ng.py:196: [W504] line break after binary operator
reduced_likelihood = -(np.log(np.sum(sigma2)) +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/surrogate_models/krigi ng.py:279: [W504] line break after binary operator
jac = np.einsum('i,j,ij->ij', self.Y_std, 1. /
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/surrogate_models/nn_in terpolators/rbf_interpolator.py:395: [W504] line break after binary operator
predz = ((np.dot(Rp, self.weights[..., 0]) * self._tvr) +
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/component.py:210: [W504] line break after binary operator
if self._num_par_fd > 1 and orig_comm.size > 1 and not (self._owns_approx_jac or
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/implicitcomponent .py:51: [W504] line break after binary operator
self.matrix_free = (overrides_method('apply_linear', self, ImplicitComponent) or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/implicitcomponent .py:52: [W504] line break after binary operator
(new_apply_linear is not None and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/implicitcomponent .py:55: [W504] line break after binary operator
self, ImplicitComponent) or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/implicitcomponent .py:56: [W504] line break after binary operator
(new_apply_multi_linear is not None and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/implicitcomponent .py:57: [W504] line break after binary operator
self._inst_functs['apply_multi_linear'] !=
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/implicitcomponent .py:60: [W504] line break after binary operator
self, ImplicitComponent) or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/implicitcomponent .py:61: [W504] line break after binary operator
(new_solve_multi_linear is not None and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/implicitcomponent .py:62: [W504] line break after binary operator
self._inst_functs['solve_multi_linear'] !=
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/system.py:1876: [ W504] line break after binary operator
if not (isinstance(indices, Iterable) and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/system.py:2888: [ W504] line break after binary operator
return MPI is None or not (self.comm is None or
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/group.py:606: [W5 04] line break after binary operator
if (mysub and mysub.comm.rank == 0 and (mysub._full_comm is None or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/group.py:804: [W5 04] line break after binary operator
if (prom_out not in allprocs_prom2abs_list_out and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/group.py:810: [W5 04] line break after binary operator
if (prom_in not in allprocs_prom2abs_list_in and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/group.py:827: [W5 04] line break after binary operator
raise RuntimeError("Output and input are in the same System " +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/group.py:963: [W5 04] line break after binary operator
if not self._has_input_scaling and not (abs_in in allprocs_discrete_in or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/group.py:1380: [E 117] over-indented
raise RuntimeError("%s: promotes"
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/group.py:1464: [W 504] line break after binary operator
raise RuntimeError("Output and input are in the same System for " +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/group.py:1673: [W 504] line break after binary operator
do_ln = sub_do_ln and (subsys._linear_solver is not None and
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/explicitcomponent .py:51: [W504] line break after binary operator
self, ExplicitComponent) or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/explicitcomponent .py:52: [W504] line break after binary operator
(new_multi_jacvec_prod is not None and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/explicitcomponent .py:53: [W504] line break after binary operator
new_multi_jacvec_prod !=
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/explicitcomponent .py:56: [W504] line break after binary operator
overrides_method('compute_jacvec_product', self, ExplicitComponent) or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/explicitcomponent .py:57: [W504] line break after binary operator
(new_jacvec_prod is not None and
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/total_jac.py:226: [W504] line break after binary operator
if (np.any(zeros[:, model._var_allprocs_abs2idx['linear'][name]]) or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/total_jac.py:232: [W504] line break after binary operator
if (np.any(zeros[:, model._var_allprocs_abs2idx['linear'][name]]) or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/total_jac.py:284: [W504] line break after binary operator
if self.comm.size > 1 or (model._full_comm is not None and
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/driver.py:235: [W 504] line break after binary operator
np.any([r['scaler'] is not None for r in itervalues(self._responses)]) or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/driver.py:277: [W 504] line break after binary operator
if (coloring_mod._use_sparsity and self._simul_coloring_info and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/driver.py:522: [W 504] line break after binary operator
if (name in self._remote_dvs and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/driver.py:740: [W 504] line break after binary operator
debug_print = 'totals' in self.options['debug_print'] and (not MPI or
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/problem.py:423: [ W504] line break after binary operator
if not (name in all_proms['input'] or name in all_proms['output'] or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/problem.py:837: [ W504] line break after binary operator
if ((mode == 'fwd' and desvar_size > response_size) or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/problem.py:1571: [W504] line break after binary operator
indented_lines = [(left_column_width + col_spacing) * ' ' +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/core/problem.py:1833: [E117] over-indented (comment)
# derivative calcs is greater than the rel toler ance
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/units.py:328: [W 504] line break after binary operator
return (self._factor == other._factor and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/units.py:329: [W 504] line break after binary operator
self._offset == other._offset and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/units.py:346: [W 504] line break after binary operator
if self._offset != 0 or (isinstance(other, PhysicalUnit) and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/units.py:375: [W 504] line break after binary operator
if self._offset != 0 or (isinstance(other, PhysicalUnit) and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/units.py:549: [W 504] line break after binary operator
return (self._powers[_UNIT_LIB.base_types['angle']] == 1 and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/units.py:637: [W 504] line break after binary operator
if (_UNIT_LIB.unit_table[name]._factor != unit._factor or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/units.py:639: [W 504] line break after binary operator
raise KeyError("Unit %s already defined with " % name +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/units.py:667: [W 504] line break after binary operator
if (_UNIT_LIB.unit_table[name]._factor != unit._factor or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/units.py:669: [W 504] line break after binary operator
raise KeyError("Unit %s already defined with " % name +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/units.py:891: [W 504] line break after binary operator
if(item[0] in _UNIT_LIB.prefixes and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/units.py:893: [W 504] line break after binary operator
add_unit(item, _UNIT_LIB.prefixes[item[0]] *
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/units.py:897: [W 504] line break after binary operator
elif(item[0:2] in _UNIT_LIB.prefixes and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/units.py:899: [W 504] line break after binary operator
add_unit(item, _UNIT_LIB.prefixes[item[0:2]] *
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/code_utils.py:73 : [W504] line break after binary operator
elif (len(fncname.split('.')) == 2 and fncname.split('.')[0] in self.mro_names a nd
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/write_outputs.py :227: [W504] line break after binary operator
indented_lines = [(left_column_width + indent_inc) * ' ' +
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/file_wrap.py:107 7: [W504] line break after binary operator
Optional(sign) +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/file_wrap.py:107 8: [W504] line break after binary operator
((digits + dot + Optional(digits)) | (dot + digits)) +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/file_wrap.py:108 5: [W504] line break after binary operator
nan = (ToInf(oneOf("Inf -Inf")) |
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/recorders/sqlite_recor der.py:335: [W504] line break after binary operator
self._prom2abs[io][v] = list(set(self._prom2abs[io][v]) |
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/recorders/case.py:338: [W504] line break after binary operator
out_stream.write('WARNING: Inputs not recorded. Make sure your recording ' +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/recorders/case.py:451: [W504] line break after binary operator
out_stream.write('WARNING: Outputs not recorded. Make sure your recording ' +
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/recorders/sqlite_reade r.py:34: [W605] invalid escape sequence '|'
_coord_split_re = re.compile('|\d+|')
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/recorders/sqlite_reade r.py:34: [W605] invalid escape sequence '|'
_coord_split_re = re.compile('|\d+|
')
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/vectors/vector.py:145: [W504] line break after binary operator
self._do_scaling = ((kind == 'input' and system._has_input_scaling) or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/vectors/vector.py:146: [W504] line break after binary operator
(kind == 'output' and system._has_output_scaling) or
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/vectors/default_transf er.py:132: [W504] line break after binary operator
offsets_in[iproc, idx_in] +
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/vectors/petsc_transfer .py:158: [W504] line break after binary operator
offsets_in[myproc, idx_in] +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/vectors/petsc_transfer .py:244: [W504] line break after binary operator
if (tgt_rel in group._var_discrete['input'] and
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/solvers/linesearch/bac ktracking.py:235: [W504] line break after binary operator
desc="If this is set to 'vector', the entire vector is backtracked together " +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/solvers/linesearch/bac ktracking.py:236: [W504] line break after binary operator
"when a bound is violated. If this is set to 'scalar', only the violating " +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/solvers/linesearch/bac ktracking.py:237: [W504] line break after binary operator
"entries are set to the bound and then the backtracking occurs on the vecto r " +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/solvers/linesearch/bac ktracking.py:238: [W504] line break after binary operator
"as a whole. If this is set to 'wall', only the violating entries are set " +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/solvers/linesearch/bac ktracking.py:239: [W504] line break after binary operator
"to the bound, and then the backtracking follows the wall - i.e., the " +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/solvers/linesearch/bac ktracking.py:299: [W504] line break after binary operator
while (self._iter_count < maxiter and
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/components/exec_comp.p y:15: [W605] invalid escape sequence '\w'
VAR_RGX = re.compile('([.][_a-zA-Z]\w[ ](?)')
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/components/exec_comp.p y:15: [W605] invalid escape sequence '('
VAR_RGX = re.compile('([.]
[_a-zA-Z]\w*[ ]*(?)')
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/components/meta_model_ structured_comp.py:340: [W504] line break after binary operator
return result.reshape(xi_shape[:-1] +
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/components/meta_model_ structured_comp.py:525: [W504] line break after binary operator
norm_distances.append((x - grid[i]) /
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/error_checking/check_c onfig.py:54: [W504] line break after binary operator
if not (src_system in cycle_idxs and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/error_checking/check_c onfig.py:55: [W504] line break after binary operator
tgt_system in cycle_idxs and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/error_checking/check_c onfig.py:119: [W504] line break after binary operator
if (src_sys in sub2i and tgt_sys in sub2i and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/error_checking/check_c onfig.py:281: [W504] line break after binary operator
(sys.nonlinear_solver and 'maxiter' in sys.nonlinear_solver.options) or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/error_checking/check_c onfig.py:290: [W504] line break after binary operator
(sys.linear_solver and
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/error_checking/check_c onfig.py:291: [W504] line break after binary operator
('maxiter' in sys.linear_solver.options or
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/error_checking/check_c onfig.py:292: [W504] line break after binary operator
isinstance(sys.linear_solver, DirectSolver))) or
^

/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/drivers/doe_generators .py:204: [W605] invalid escape sequence '['
np.fromstring(re.sub('[[]]', '', row[name]), sep=' '))
^
/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/drivers/doe_generators .py:204: [W605] invalid escape sequence ']'
np.fromstring(re.sub('[[]]', '', row[name]), sep=' '))
^

............................................................................................ .....................SS..................................................................... ....................S.........................................................SSSSSSSS...... ..........SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.......unexpected array size: ne w_size=2, got array with arr_size=1
..........................................
Normal return from subroutine COBYLA

NFVALS = 124 F =-2.733333E+01 MAXCV = 0.000000E+00
X = 6.666667E+00 -7.333332E+00
.../home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/drivers/tests/test_ scipy_optimizer.py:TestScipyOptimizeDriverFeatures.test_shgo ... FAIL (00:00:53.31, 331 MB)
Traceback (most recent call last):
File "/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/testflo/test.py", line 477, in _try_call
func()
File "/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/drivers/tests/ test_scipy_optimizer.py", line 1824, in test_shgo
assert_rel_error(self, prob['x'], np.zeros(size), 1e-6)
File "/home/hahnpv/anaconda3/envs/test/lib/python3.7/site-packages/openmdao/utils/assert_u tils.py", line 283, in assert_rel_error
% (actual, desired, error, tolerance))
File "/home/hahnpv/anaconda3/envs/test/lib/python3.7/unittest/case.py", line 680, in fail
raise self.failureException(msg)
AssertionError: actual [ 0. 0. -0.96], desired [0. 0. 0.], rel error 0.96, tolerance 1e -06

...................SSSSSSS

The following tests failed:
test_lint_peps.py:LintTestCase.test_pep8
test_scipy_optimizer.py:TestScipyOptimizeDriverFeatures.test_shgo

Passed: 1371
Failed: 2
Skipped: 267

Ran 1640 tests using 1 processes
Wall clock time: 00:03:37.63

Platform information:

uname_result(system='Linux', node='dadpc', release='4.18.12-041812-generic', version='#201810032137 SMP Thu Oct 4 01:39:48 UTC 2018', machine='x86_64', processor='x86_64')

Doc links broken

Hi. I've just noticed that doc links are broken on the OpenMDAO website (2.x not found, 1.x points to 2.0.2).

Fork current master to om2.10 branch

Summary of Issue

Add a parallel development OpenMDAO2.10 branch to facilitate (nearly) simultaneous releases of 2.10.0 and 3.0.0

Issue Type

  • Bug
  • Enhancement
  • Chore

Description

OpenMDAO 3.0.0 will be released as feature-compatible with 2.10.0 with the exception of:

  • __future__ imports that facilitate Python 2.x/3.x operation will be removed
  • The dependency on the six package will be removed
  • Existing deprecation warnings will be removed and the previous deprecated behavior no longer supported.

We'll need to make sure this branch is included in our CI until its merged back into master.

Example

N/A

Environment

N/A

Issue Report on Test OpenMDAO2

When i try to test OpenMDAO on my computer, it says like this:

The following tests failed:
c:\users\asus\anaconda3\lib\site-packages\openmdao\solvers\linear\tests\test_linear_block_gs.py:TestBGSSolver.test_implicit_cycle_precon
c:\users\asus\anaconda3\lib\site-packages\openmdao\solvers\linear\tests\test_scipy_iter_solver.py:TestScipyKrylovFeature.test_specify_precon

and

Passed: 1537
Failed: 2
Skipped: 237

Is there something that i should do to solve this?
Thank you,

Daffa

Issue with openmdao.surrogate_models.multifi_cokriging

Hi,

I am using co-Kriging from this library. I am modeling a 5 variable problem. Initially, I had 1400 low fidelity (LF) data and 500 high fidelity (HF) data. I was getting the error below. After I tried everything I reduced the number of samples to (500 LF and 250 HF) and now it works. My guess is that the correlation matrix became ill-conditioned.

File "", line 1, in
runfile('C:/Users/gisellefernandez/Desktop/Dropbox/PhD/LaTeX/PhDThesis/GiselleThesis/Multi-fidelity-chapter/Fitting_NFEP/co-Kriging/OpenMDAO_NFEP_LF_HF.py', wdir='C:/Users/gisellefernandez/Desktop/Dropbox/PhD/LaTeX/PhDThesis/GiselleThesis/Multi-fidelity-chapter/Fitting_NFEP/co-Kriging')

File "C:\Users\gisellefernandez\AppData\Local\Continuum\anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
execfile(filename, namespace)

File "C:\Users\gisellefernandez\AppData\Local\Continuum\anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 86, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/Users/gisellefernandez/Desktop/Dropbox/PhD/LaTeX/PhDThesis/GiselleThesis/Multi-fidelity-chapter/Fitting_NFEP/co-Kriging/OpenMDAO_NFEP_LF_HF.py", line 99, in
mcok.predict(np.array([[0.8],[0.3],[0.4],[0.3],[0.9]]).T, eval_MSE = True)

File "C:\Users\gisellefernandez\AppData\Local\Continuum\anaconda2\lib\site-packages\openmdao\surrogate_models\multifi_cokriging.py", line 642, in predict
Ft = solve_triangular(C, F, lower=True)

File "C:\Users\gisellefernandez\AppData\Local\Continuum\anaconda2\lib\site-packages\scipy\linalg\basic.py", line 286, in solve_triangular
raise ValueError('expected square matrix')

ValueError: expected square matrix

Feature request: active-set constraint calculation disabling

We are still using OpenMDAO 1.7.4, but would like to move to OpenMDAO 2. We have not moved up to OpenMDAO 2 largely because active-set constraint calculation disabling is still not a part of OpenMDAO 2.

This feature is important for our project since we deal with thousands of variables, most of which are unimportant at any given step. Active-set constraint calculation disabling provides us with significant speed-ups in solving our optimization problems.

Makefile:66: recipe for target 'buildall' failed

Encountered the following while running make all in openmdao/docs...

$ make all
touch make_sourcedocs
python _utils/preprocess_tags.py
sphinx-build -a -b html -d _build/doctrees  . _build/html
Running Sphinx v1.7.9
making output directory...
loading pickled environment... not yet created
building [mo]: all of 0 po files
building [html]: all source files
updating environment: 328 added, 0 changed, 0 removed
reading sources... [ 42%] basic_guide/first_optimization                                                                 
   Normal return from subroutine COBYLA

   NFVALS =   54   F =-2.700000E+01    MAXCV = 0.000000E+00
   X = 6.999999E+00  -6.999999E+00
[saiyaman-Lenovo-U310:19019] opal_os_dirpath_create: Error: Unable to create the sub-directory (/tmp/openmpi-sessions-saiyaman@saiyaman-Lenovo-U310_0) of (/tmp/openmpi-sessions-saiyaman@saiyaman-Lenovo-U310_0/37999/0/0), mkdir failed [1]
[saiyaman-Lenovo-U310:19019] [[37999,0],0] ORTE_ERROR_LOG: Error in file util/session_dir.c at line 107
[saiyaman-Lenovo-U310:19019] [[37999,0],0] ORTE_ERROR_LOG: Error in file util/session_dir.c at line 402
[saiyaman-Lenovo-U310:19019] [[37999,0],0] ORTE_ERROR_LOG: Error in file ess_hnp_module.c at line 638
--------------------------------------------------------------------------
It looks like orte_init failed for some reason; your parallel process is
likely to abort.  There are many reasons that a parallel process can
fail during orte_init; some of which are due to configuration or
environment problems.  This failure appears to be an internal failure;
here's some additional information (which may only be relevant to an
Open MPI developer):

  orte_session_dir failed
  --> Returned value Error (-1) instead of ORTE_SUCCESS
--------------------------------------------------------------------------
[saiyaman-Lenovo-U310:19021] opal_os_dirpath_create: Error: Unable to create the sub-directory (/tmp/openmpi-sessions-saiyaman@saiyaman-Lenovo-U310_0) of (/tmp/openmpi-sessions-saiyaman@saiyaman-Lenovo-U310_0/37993/0/0), mkdir failed [1]
[saiyaman-Lenovo-U310:19021] [[37993,0],0] ORTE_ERROR_LOG: Error in file util/session_dir.c at line 107
[saiyaman-Lenovo-U310:19021] [[37993,0],0] ORTE_ERROR_LOG: Error in file util/session_dir.c at line 402
[saiyaman-Lenovo-U310:19021] [[37993,0],0] ORTE_ERROR_LOG: Error in file ess_hnp_module.c at line 638
--------------------------------------------------------------------------
It looks like orte_init failed for some reason; your parallel process is
likely to abort.  There are many reasons that a parallel process can
fail during orte_init; some of which are due to configuration or
environment problems.  This failure appears to be an internal failure;
here's some additional information (which may only be relevant to an
Open MPI developer):

  orte_session_dir failed
  --> Returned value Error (-1) instead of ORTE_SUCCESS
--------------------------------------------------------------------------
[saiyaman-Lenovo-U310:19023] opal_os_dirpath_create: Error: Unable to create the sub-directory (/tmp/openmpi-sessions-saiyaman@saiyaman-Lenovo-U310_0) of (/tmp/openmpi-sessions-saiyaman@saiyaman-Lenovo-U310_0/37995/0/0), mkdir failed [1]
[saiyaman-Lenovo-U310:19023] [[37995,0],0] ORTE_ERROR_LOG: Error in file util/session_dir.c at line 107
[saiyaman-Lenovo-U310:19023] [[37995,0],0] ORTE_ERROR_LOG: Error in file util/session_dir.c at line 402
[saiyaman-Lenovo-U310:19023] [[37995,0],0] ORTE_ERROR_LOG: Error in file ess_hnp_module.c at line 638
--------------------------------------------------------------------------
It looks like orte_init failed for some reason; your parallel process is
likely to abort.  There are many reasons that a parallel process can
fail during orte_init; some of which are due to configuration or
environment problems.  This failure appears to be an internal failure;
here's some additional information (which may only be relevant to an
Open MPI developer):

  orte_session_dir failed
  --> Returned value Error (-1) instead of ORTE_SUCCESS
--------------------------------------------------------------------------
[saiyaman-Lenovo-U310:19025] opal_os_dirpath_create: Error: Unable to create the sub-directory (/tmp/openmpi-sessions-saiyaman@saiyaman-Lenovo-U310_0) of (/tmp/openmpi-sessions-saiyaman@saiyaman-Lenovo-U310_0/38005/0/0), mkdir failed [1]
[saiyaman-Lenovo-U310:19025] [[38005,0],0] ORTE_ERROR_LOG: Error in file util/session_dir.c at line 107
[saiyaman-Lenovo-U310:19025] [[38005,0],0] ORTE_ERROR_LOG: Error in file util/session_dir.c at line 402
[saiyaman-Lenovo-U310:19025] [[38005,0],0] ORTE_ERROR_LOG: Error in file ess_hnp_module.c at line 638
--------------------------------------------------------------------------
It looks like orte_init failed for some reason; your parallel process is
likely to abort.  There are many reasons that a parallel process can
fail during orte_init; some of which are due to configuration or
environment problems.  This failure appears to be an internal failure;
here's some additional information (which may only be relevant to an
Open MPI developer):

  orte_session_dir failed
  --> Returned value Error (-1) instead of ORTE_SUCCESS
--------------------------------------------------------------------------
reading sources... [ 55%] features/building_blocks/drivers/scipy_optimize_driver                                         
   Normal return from subroutine COBYLA

   NFVALS =  124   F =-2.733333E+01    MAXCV = 0.000000E+00
   X = 6.666667E+00  -7.333332E+00
WARNING: autodoc: failed to import module 'openmdao.components.demux_comp'; the following exception was raised:          
No module named 'openmdao.components.demux_comp'
WARNING: autodoc: failed to import module 'openmdao.components.mux_comp'; the following exception was raised:
No module named 'openmdao.components.mux_comp'
WARNING: autodoc: failed to import module 'openmdao.test_suite.components.matmultcomp'; the following exception was raised:
No module named 'openmdao.test_suite.components.matmultcomp'
WARNING: autodoc: failed to import module 'openmdao.test_suite.tot_jac_builder'; the following exception was raised:
No module named 'openmdao.test_suite.tot_jac_builder'
WARNING: autodoc: failed to import module 'openmdao.vectors.petsc_transfer'; the following exception was raised:
No module named 'PETSc'
WARNING: autodoc: failed to import module 'openmdao.vectors.petsc_vector'; the following exception was raised:
No module named 'PETSc'
WARNING: autodoc: failed to import method 'MuxComp.add_var' from module 'openmdao.components.mux_comp'; the following exception was raised:
No module named 'openmdao.components.mux_comp'
WARNING: autodoc: failed to import method 'DemuxComp.add_var' from module 'openmdao.components.demux_comp'; the following exception was raised:
No module named 'openmdao.components.demux_comp'
/home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/features/building_blocks/components/mux_demux_comps.rst:62: WARNING: No module named 'openmdao.components.tests.test_demux_comp'
/home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/features/building_blocks/components/mux_demux_comps.rst:74: WARNING: No module named 'openmdao.components.tests.test_mux_comp'
/home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/features/building_blocks/drivers/doe_driver.rst:73: WARNING: Running of embedded code openmdao.drivers.tests.test_doe_driver.TestParallelDOEFeature.test_full_factorial in docs failed due to: 

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/openmdao/docs/_utils/docutil.py", line 681, in run_code
    with open('%d.out' % i) as f:
FileNotFoundError: [Errno 2] No such file or directory: '0.out'
/home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/features/building_blocks/drivers/doe_driver.rst:102: WARNING: Running of embedded code openmdao.drivers.tests.test_doe_driver.TestParallelDOEFeature2.test_fan_in_grouped in docs failed due to: 

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/openmdao/docs/_utils/docutil.py", line 681, in run_code
    with open('%d.out' % i) as f:
FileNotFoundError: [Errno 2] No such file or directory: '0.out'
/home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/features/building_blocks/drivers/genetic_algorithm.rst:82: WARNING: type object 'TestFeatureSimpleGA' has no attribute 'test_constrained_with_penalty'
/home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/features/building_blocks/drivers/genetic_algorithm.rst:93: WARNING: Running of embedded code openmdao.drivers.tests.test_genetic_algorithm_driver.MPIFeatureTests.test_option_parallel in docs failed due to: 

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/openmdao/docs/_utils/docutil.py", line 681, in run_code
    with open('%d.out' % i) as f:
FileNotFoundError: [Errno 2] No such file or directory: '0.out'
/home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/features/building_blocks/drivers/genetic_algorithm.rst:107: WARNING: Running of embedded code openmdao.drivers.tests.test_genetic_algorithm_driver.MPIFeatureTests4.test_option_procs_per_model in docs failed due to: 

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/openmdao/docs/_utils/docutil.py", line 681, in run_code
    with open('%d.out' % i) as f:
FileNotFoundError: [Errno 2] No such file or directory: '0.out'
/home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/features/building_blocks/solvers/linear/linear_user_defined.rst:39: WARNING: Running of embedded code openmdao.solvers.linear.tests.test_user_defined.TestUserDefinedSolver.test_feature in docs failed due to: 

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/openmdao/docs/_utils/docutil.py", line 736, in run_code
    exec(code_to_run, globals_dict)
  File "<string>", line 119, in <module>
  File "/usr/local/lib/python3.6/dist-packages/openmdao/solvers/linear/petsc_ksp.py", line 188, in __init__
    raise RuntimeError("PETSc is not available.")
RuntimeError: PETSc is not available.
/home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/features/building_blocks/solvers/linear/petsc_krylov.rst:19: WARNING: Running of embedded code openmdao.solvers.linear.tests.test_petsc_ksp.TestPETScKrylovSolverFeature.test_specify_solver in docs failed due to: 

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/openmdao/docs/_utils/docutil.py", line 736, in run_code
    exec(code_to_run, globals_dict)
  File "<string>", line 29, in <module>
  File "/usr/local/lib/python3.6/dist-packages/openmdao/solvers/linear/petsc_ksp.py", line 188, in __init__
    raise RuntimeError("PETSc is not available.")
RuntimeError: PETSc is not available.

Exception occurred:
  File "/usr/local/lib/python3.6/dist-packages/openmdao/solvers/linear/petsc_ksp.py", line 188, in __init__
    raise RuntimeError("PETSc is not available.")
RuntimeError: PETSc is not available.
The full traceback has been saved in /home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/sphinx-err-oph9e12p.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
Makefile:66: recipe for target 'buildall' failed
make: *** [buildall] Error 2

sphinx-err-oph9e12p.log below:

# Sphinx version: 1.7.9
# Python version: 3.6.6 (CPython)
# Docutils version: 0.14 
# Jinja2 version: 2.10
# Last messages:
#   reading sources... [ 58%] features/building_blocks/solvers/linear/linear_block_gs
#   
#   reading sources... [ 58%] features/building_blocks/solvers/linear/linear_block_jac
#   
#   reading sources... [ 58%] features/building_blocks/solvers/linear/linear_runonce
#   
#   reading sources... [ 59%] features/building_blocks/solvers/linear/linear_user_defined
#   
#   reading sources... [ 59%] features/building_blocks/solvers/linear/petsc_krylov
#   
# Loaded extensions:
#   alabaster (0.7.11) from /usr/local/lib/python3.6/dist-packages/alabaster/__init__.py
#   sphinx.ext.autodoc (1.7.9) from /usr/local/lib/python3.6/dist-packages/sphinx/ext/autodoc/__init__.py
#   sphinx.ext.autosummary (1.7.9) from /usr/local/lib/python3.6/dist-packages/sphinx/ext/autosummary/__init__.py
#   sphinx.ext.doctest (1.7.9) from /usr/local/lib/python3.6/dist-packages/sphinx/ext/doctest.py
#   sphinx.ext.todo (1.7.9) from /usr/local/lib/python3.6/dist-packages/sphinx/ext/todo.py
#   sphinx.ext.coverage (1.7.9) from /usr/local/lib/python3.6/dist-packages/sphinx/ext/coverage.py
#   sphinx.ext.mathjax (1.7.9) from /usr/local/lib/python3.6/dist-packages/sphinx/ext/mathjax.py
#   sphinx.ext.viewcode (1.7.9) from /usr/local/lib/python3.6/dist-packages/sphinx/ext/viewcode.py
#   numpydoc (0.8.0) from /usr/local/lib/python3.6/dist-packages/numpydoc/__init__.py
#   embed_code (1.7.9) from /home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/_exts/embed_code.py
#   embed_options (1.7.9) from /home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/_exts/embed_options.py
#   embed_compare (1.7.9) from /home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/_exts/embed_compare.py
#   embed_shell_cmd (1.7.9) from /home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/_exts/embed_shell_cmd.py
#   embed_bibtex (1.7.9) from /home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/_exts/embed_bibtex.py
#   tags (0.1) from /home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/_exts/tags.py
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/sphinx/cmdline.py", line 304, in main
    app.build(args.force_all, filenames)
  File "/usr/local/lib/python3.6/dist-packages/sphinx/application.py", line 325, in build
    self.builder.build_all()
  File "/usr/local/lib/python3.6/dist-packages/sphinx/builders/__init__.py", line 299, in build_all
    self.build(None, summary='all source files', method='all')
  File "/usr/local/lib/python3.6/dist-packages/sphinx/builders/__init__.py", line 355, in build
    updated_docnames = set(self.env.update(self.config, self.srcdir, self.doctreedir))
  File "/usr/local/lib/python3.6/dist-packages/sphinx/environment/__init__.py", line 568, in update
    self._read_serial(docnames, self.app)
  File "/usr/local/lib/python3.6/dist-packages/sphinx/environment/__init__.py", line 587, in _read_serial
    self.read_doc(docname, app)
  File "/usr/local/lib/python3.6/dist-packages/sphinx/environment/__init__.py", line 662, in read_doc
    doctree = read_doc(self.app, self, self.doc2path(docname))
  File "/usr/local/lib/python3.6/dist-packages/sphinx/io.py", line 302, in read_doc
    pub.publish()
  File "/usr/local/lib/python3.6/dist-packages/docutils/core.py", line 217, in publish
    self.settings)
  File "/usr/local/lib/python3.6/dist-packages/docutils/readers/__init__.py", line 72, in read
    self.parse()
  File "/usr/local/lib/python3.6/dist-packages/docutils/readers/__init__.py", line 78, in parse
    self.parser.parse(self.input, document)
  File "/usr/local/lib/python3.6/dist-packages/sphinx/parsers.py", line 85, in parse
    self.statemachine.run(inputstring, document, inliner=self.inliner)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 171, in run
    input_source=document['source'])
  File "/usr/local/lib/python3.6/dist-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/local/lib/python3.6/dist-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 2988, in text
    self.section(title.lstrip(), source, style, lineno + 1, messages)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
    node=section_node, match_titles=True)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/local/lib/python3.6/dist-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/local/lib/python3.6/dist-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 2753, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
    node=section_node, match_titles=True)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/local/lib/python3.6/dist-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/local/lib/python3.6/dist-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 2326, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 2338, in explicit_construct
    return method(self, expmatch)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 2081, in directive
    directive_class, match, type_name, option_presets)
  File "/usr/local/lib/python3.6/dist-packages/docutils/parsers/rst/states.py", line 2130, in run_directive
    result = directive_instance.run()
  File "/home/saiyaman/gitrepos/cloned/OpenMDAO/openmdao/docs/_exts/embed_options.py", line 40, in run
    options = getattr(klass(), attribute_name)
  File "/usr/local/lib/python3.6/dist-packages/openmdao/solvers/linear/petsc_ksp.py", line 188, in __init__
    raise RuntimeError("PETSc is not available.")
RuntimeError: PETSc is not available.

Issue Running openmdao on Command Line with Windows 10

I currently have version 2.2 of openmdao and I would like to be able to generate an N2 diagram. When trying to run the openmdao command on the command line I receive the error "ModuleNotFoundError: No module named 'resource' ". As I understand 'resource' is a Unix specific package. Is there anyway to get around this issue on Windows 10?

N2 Diagram will no longer give special treatment to colons in variable names

Summary of Issue

The N2 diagram will no longer create an extra "layer" for variable names after a colon.

Issue Type

  • Bug
  • Enhancement
    POEM #N/A

Description

Colons in variable names are frequently used to provide "classes" of variables in Dymos or Pycycle, but trying to give them special treatment in the N2 viewer is unnecessarily complex. The behavior of OpenMDAO will not change, colons will still be legal characters in variable names, but they'll just appear as standard variable names in the N2 viewer.

Example

N/A

Environment

N/A

Makefile:79: recipe for target 'mock' failed

I'm encountering the following error when attempting to run make all in openmdao/docs, despite having installed sphinx and mock via pip.

$ make all
touch make_sourcedocs
The 'mock' package is required to build the docs. Install with:
 pip install mock
Makefile:79: recipe for target 'mock' failed
make: *** [mock] Error 1

License file in pypi archive

The pypi source archive isn't including the LICENSE.txt file, or documentation files like the readme or release notes. Would it be possible to add them? The license in particular, and the other documentation files in general, are very helpful when packaging this for Linux distributions. Thank you.

Current doc building code does not make use of skip decorators

Summary of Issue

The doc building code should honor skip decorators on embedded tests.

Issue Type

  • Bug
  • Enhancement
    POEM #N/A

Description

Currently, the embed code is supposed to run the code with the decorators so that skip decorators can skip tests that can't run on a given environment. There's a lot of code to handle skipped tests but it's never used because of this. Skipped tests are still supposed to result in the code being put into the docs but for the output section, we state the code was skipped and why.

Skip should raise a warning in order to fail on CI if a skip is encountered.

Example

For example, this test decorator is ignored when doing the embed code when doing the doc build.

   @unittest.skipUnless(LooseVersion(scipy_version) >= LooseVersion("1.2"),
                         "scipy >= 1.2 is required.")
    def test_feature_shgo_rastrigin(self):

Environment

Operating System:

Python environment:

Packages: N/A

Miscellaneous updates for 3.0 release

Summary of Issue

  • removal of beta status
  • updating setup.py for our supported python versions and dependencies updates
  • removal of references to OpenMDAO as 2.x

Description

With major release 3.0, OpenMDAO is no longer considered Beta and only Python >= 3.6 is supported.

OpenMDAO 2 Test Failure

SYSTEM INFO:
(('Windows', '10.0.17134'), ('AMD64', 'Intel64 Family 6 Model 78 Stepping 3, GenuineIntel'), '3.7.2 (default, Jan 2 2019, 17:07:39) [MSC v.1915 64 bit (AMD64)]')

FAILURE DETAILS:
Was following the instructions on this page: https://github.com/openmdao/openmdao
Ran "pip install openmdao[test]" followed by "testflo openmdao -n 1".
Saw the following output:

..c:<REDACTED>\miniconda3\lib\site-packages\pycodestyle.py:113: FutureWarning: Possible nested set at position 1
EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
...................................................................................................................................................................................................................SUCCESS: The process with PID 4936 (child process of PID 4664) has been terminated.
SUCCESS: The process with PID 4664 (child process of PID 10128) has been terminated.
...............................................................................................................................................S.....S.S.S..S.S.S.S.S.S.S.S.S.............................................................................S..SSSSSSSSSSSS........SS........SSSSSS.SS.......S..............SSSSSS........S...............................SSSS...SSSSSSSS.SSSSSSSSSSSS....................................................................................................................................................................................................................S.SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.................SSSSSSSSS....................................................SSSSSSSSSSSS.XXXXX.X..SS......S.................................SSS.

circuit

NL: Newton 0 ; 21.5152153 1
NL: Newton 1 ; 8.236021 0.382799841
NL: Newton 2 ; 3.02968362 0.140815863
NL: Newton 3 ; 1.11434147 0.0517931826
NL: Newton 4 ; 0.40971227 0.0190429082
NL: Newton 5 ; 0.150488221 0.00699450221
NL: Newton 6 ; 0.0551231446 0.00256205406
NL: Newton 7 ; 0.0200406862 0.000931465752
NL: Newton 8 ; 0.0071383729 0.000331782546
NL: Newton 9 ; 0.00240366903 0.000111719497
NL: Newton 10 ; 0.00069274325 3.21978303e-05
NL: Newton 11 ; 0.000129518518 6.01985693e-06
NL: Newton 12 ; 7.66202506e-06 3.56121236e-07
NL: Newton 13 ; 3.16310628e-08 1.4701718e-09
NL: Newton 14 ; 1.15199744e-12 5.35433844e-14
NL: Newton Converged
SSSSSS..........................SSSSSSSSSSSSSSS................SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.......unexpected array size: new_size=2, got array with arr_size=1
..........................................
Normal return from subroutine COBYLA

NFVALS = 124 F =-2.733333E+01 MAXCV = 0.000000E+00
X = 6.666667E+00 -7.333332E+00
...c:<REDACTED>\miniconda3\lib\site-packages\openmdao\drivers\tests\test_scipy_optimizer.py:TestScipyOptimizeDriverFeatures.test_shgo ... FAIL (00:01:1.48, 0 MB)
Traceback (most recent call last):
File "c:<REDACTED>\miniconda3\lib\site-packages\testflo\test.py", line 477, in _try_call
func()
File "c:<REDACTED>\miniconda3\lib\site-packages\openmdao\drivers\tests\test_scipy_optimizer.py", line 1824, in test_shgo
assert_rel_error(self, prob['x'], np.zeros(size), 1e-6)
File "c:<REDACTED>\miniconda3\lib\site-packages\openmdao\utils\assert_utils.py", line 283, in assert_rel_error
% (actual, desired, error, tolerance))
File "c:<REDACTED>\miniconda3\lib\unittest\case.py", line 680, in fail
raise self.failureException(msg)
AssertionError: actual [ 0. 0. -0.96], desired [0. 0. 0.], rel error 0.96, tolerance 1e-06

...................................................................................................................................SSSS.............S................................................................................S......................................................................................SSSSSSSSSSSSSSSSS...........................SSSS.......................................................................................................S...S........S......................................S....S......................................................S...............................................S.........................................S..

The following tests failed:
c:<REDACTED>\miniconda3\lib\site-packages\openmdao\drivers\tests\test_scipy_optimizer.py:TestScipyOptimizeDriverFeatures.test_shgo

Passed: 1596
Failed: 1
Skipped: 254

Ran 1851 tests using 1 processes
Wall clock time: 00:03:58.86

Release notes 2.7.0

Two little things regarding 2.7.0 release notes:

  • long lines are truncated on the website page
  • and as OpenMDAO embeds an XDSMjs version (0.6), would you mind adding a link to the XDSMjs repo?

Coloring in 'auto' mode sometimes results in a bidirectional coloring that's worse than a single direction coloring.

Summary of Issue

Sometimes the bidirectional coloring algorithm results in a higher number of colors than would be computed using a single direction coloring.

Issue Type

  • Bug
  • Enhancement

Description

A single direction coloring is sometimes better than the bidirectional one we compute if mode is set to 'auto'. To fix this we should compute the single direction colorings along with the bidirectional one and just choose the best.

Example

The two_burn_orbit_raise_problem test in dymos results in 43 reverse colors in 'auto' mode, but if 'fwd' mode is set explicitly, there are only 18 colors.

Environment

All OSs and python versions.

Packages: Dymos 0.15.0, OpenMDAO 2.9.1

Issue: Failures in test

Following the instruction, I found two failures when testing OpenMDAO. And the installation statements are attached.
OpenMDAO_install.txt

...............................................................................................................

The following tests failed:
test_linear_block_gs.py:TestBGSSolver.test_implicit_cycle_precon
test_scipy_iter_solver.py:TestScipyKrylovFeature.test_specify_precon

Passed: 1536
Failed: 2
Skipped: 238

Ran 1776 tests using 1 processes
Wall clock time: 00:02:56.59

xiangrudeMacBook-Air:~ xiangru$ python
Python 3.7.1 (default, Dec 14 2018, 13:28:58)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

import platform, sys
info = platform.uname()
(info.system, info.version), (info.machine, info.processor), sys.version
(('Darwin', 'Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64'), ('x86_64', 'i386'), '3.7.1 (default, Dec 14 2018, 13:28:58) \n[Clang 4.0.1 (tags/RELEASE_401/final)]')
OpenMDAO_install.txt

Add check on size of bound arrays when using indices for design variables

This is not so much an issue as an idea for improvement. I was working on a script the past weeks and to add a design variable I used:

p.model.add_design_var('z_hat_str', lower=np.array([0.2, 0.666, 0.875, 0.45, 0.72, 0.5]), upper=np.array([1.8, 1.333, 1.125, 1.45, 1.27, 1.5]), indices=[0,3,4,5])

As the original vector z_hat_str has six elements I also provided a six-element lower and upper bound vector. However, only four elements need to be used by the optimizer, so I added indices=[0,3,4,5].

To my surprise the optimizer was not behaving as expected and I found out that for the bounds the optimizer will simply use the first four entries of the lower and upper bounds, instead of the indices 0, 3, 4, 5. So in the end the right way to specify the design variables was:

p.model.add_design_var('z_hat_str', lower=np.array([0.2, 0.45, 0.72, 0.5]), upper=np.array([1.8, 1.45, 1.27, 1.5]), indices=[0,3,4,5])

It took me a while to figure this out and I thought it might be helpful for other users to add a check on the size of the lower and upper bound vectors to see if they have the expected size when indices are provided, thereby forcing the user to provide the inputs in the way that is expected.

User should get better error when attempting to make an output the target of a connection

Summary of Issue

Currently a user gets an error that says "input does not exist for 'foo'" when attempting to make an output the target of a connection. While true, this can be frustrating for users with large models who might not immediately realize whether a given variable is an input or output.

Issue Type

Description

See example.

Example

The following test should be added to test_group.py:TestConnect

    def test_connect_target_is_output(self):
        msg = "Group (sub): Cannot connect source 'src.x' to target 'tgt.y' - The target is an output."

        self.sub.connect('src.x', 'tgt.y')

        with assertRaisesRegex(self, RuntimeError, msg):
            self.prob.setup()

Environment

N/A

Improved singular matrix errors

Summary of Issue

Currently OpenMDAO detects some forms of singular matrix problems, but not all. As a result, a user sometimes gets an error message that a singular matrix has been detected with no other information. The singularity detection should be improved to provide better feedback to the user.

Issue Type

Description

Consider three scenarios where a singular matrix issue can arise:

  • There is no way to impact a residual in the system (a zero row)

    OpenMDAO currently handles this.

  • Two rows are linearly dependent.

    If a matrix singularity is encountered and there are no zero-rows, OpenMDAO should check to see if any rows are linear combinations of others.

  • Multiple rows combine to form a singularity.

    If the previous two cases are not encountered, its possible that interactions between multiple components result in a system which is singular, but is not as simple as a zero-row or a linear combination of two rows. In this case, OpenMDAO should assess the matrix at varying levels of depth (depth-first), until the singularity is encountered. This would at least inform the user as to the group at which the singularity exists.

Example

We need test cases for these three scenarios.

pyOptSparseDriver does not support split MPI communicators

I have an optimization problem where I need to run several computationally expensive simulations per function evaluations. I've created a hierarchically parallelized optimization problem in openmdao, where my mpi comm world is split into two groups: group A runs the parallel finite differencing (ParallelFDGroup) and group B are additional computational resources for parallelization the simulations per function evaluation.

This setup works using the ScipyOptimizer driver, but not the pyOptSparseDriver driver. The problem is in pyoptsparse's pyOpt_optimization.py. The Optimization class receives 'comm' as a key word argument; if a communicator is not passed, it uses COMM_WORLD.

class Optimization(object):
    def __init__(self, name, objFun, comm=None):

        self.name = name
        self.objFun = objFun
        if comm is None:
            self.comm = MPI.COMM_WORLD
        else:
            self.comm = comm

When pyoptsparse_driver.py initializes Optimization, if does not pass a communicator, so COMM_WORLD is used.

opt_prob = Optimization(self.options['title'], self._objfunc)

As a result, the pyOptSparseDriver never gets past the initial evaluation, it hangs waiting for the ranks from Group B. This can be fixed simply by creating a 'comm' keyword argument for pyOptSparseDriver :

class pyOptSparseDriver(Driver):
    def __init__(self, comm=None):
        super(pyOptSparseDriver, self).__init__()
        self.comm = comm

which then gets passed to Optimization in run():

opt_prob = Optimization(self.options['title'], self._objfunc, comm=self.comm)

I'm currently using openmdao==1.7.4, but from looking at the openmdao 2 source, it looks like its an issue there as well. Would love to see these changes made to the openmdao 1 and 2 repos, currently trying to figure out a 'patch' solution for our collaborators.

Inequality constraint not working with SLSQP optimizer

Hi - I'm working with version 0.10.3.2 of OpenMDAO to allow integration with the NREL Wisdem tools.

I have used OpenMDAO with a numerical model of a wind farm to iterate on turbine positions with the objective of maximising energy yield. I imposed a constraint that the turbines remain within a certain radius of my x-y origin. When using the PSQP optimizer this constraint was applied properly. However when changing to the SLSQP optimizer this constraint was ignored. I made no other changes to my code (except the specification of the maximum number of iterations which requires a slightly different format for the two optimizers). Is this a known bug with the SLSQP optimizer, or should I be looking for a problem with my code?

Many thanks for any suggestions.

unit conversion for design variables, constraints, and objectives

It would be nice if constraints and objectives had the option to specify units. Many times I have to reach down into sub-models to grab variables for constraints and objectives and I am not totally sure what their units are (especially if i come back to a model after a few months of not working on it, or if the sub-model was created by someone else). This would also be useful if you wanted to change all the top level units for consistency purposes. For completeness design variables would be nice too, but that is probably less useful b/c they are typically at the top level of my.

-Jeff

Design variable listing not available before setup

The listing of design variables through the System.get_design_vars (I tested it with problem.model.get_design_vars()) method fails before problem.setup() has been called. This seems to be because self._var_allprocs_prom2abs_list is not initialized yet at that point.

To me, however, it would seem logical that it would be possible to list all design variables after adding them, but before setting up the problem.

Assigning complex value to component output raises a warning

Discovered this while writing unit tests for a new component. Within the component, I allocate a numpy placeholder array as complex if the user specifies complex=True as an option (in case they're using CS derivatives for testing).

I think the following warning is being raised when I assign output['my_variable'] = computed_value within the compute() method of my component, but pytest isn't providing the entire stack trace so I can't be sure.

force_alloc_complex is True and the cs derivatives are being computed correctly.

`openconcept/utilities/math/tests/test_multiply_divide_comp.py::TestElementMultiplyDivideDivisionFirst::test_partials
C:\Users\Ben\Anaconda3\lib\site-packages\openmdao\vectors\vector.py:421: ComplexWarning: Casting complex values to real discards the imaginary part
self._views[abs_name][slc] = value

openconcept/utilities/math/tests/test_multiply_divide_comp.py::TestElementMultiplyDivideDivisionFirst::test_results
C:\Users\Ben\Anaconda3\lib\site-packages\openmdao\vectors\vector.py:421: ComplexWarning: Casting complex values to real discards the imaginary part
self._views[abs_name][slc] = value`

Fixes for spline_comp

Summary of Issue

Misc fixes to spline_comp and its documentation.

Issue Type

Description

  • Make We have included three different distribution functions for users to replicate functionality that used to be built-in to the individual akima and bsplines components a note
  • Add in the description of num_cp that if it’s None, it will use a linspace
  • Move spline_distribution into om.api
  • Make sure to add the right imports for the doc cases
  • Add units=y_units and add test for it.
  • Clean docs for spline_distribution

Example

N/A

Genetic algorithm ValueError with vector design variables

Version

I'm testing with 2.5.0, but it's probably in other versions as well

MWE

from openmdao.api import Problem, ScipyOptimizeDriver, ExecComp, IndepVarComp, SimpleGADriver

will_i_live = False
prob = Problem()
indeps = prob.model.add_subsystem('indeps', IndepVarComp())
indeps.add_output('x', [4.0, -4])
prob.model.add_subsystem('paraboloid', ExecComp('f = (x[0]-3.5)**2 + (x[1]+4.2)**2 - 3',
                                                x=[0, 0]))
prob.model.connect('indeps.x', 'paraboloid.x')

if will_i_live: prob.driver = ScipyOptimizeDriver()
else: prob.driver = SimpleGADriver()

prob.model.add_design_var('indeps.x', lower=-10, upper=10)
prob.model.add_objective('paraboloid.f')
prob.setup()
prob.run_driver()
print(prob['indeps.x'])

In particular, it's the log_range calculation part that dies:


  File "c:\users\rink\git\openmdao\openmdao\core\problem.py", line 556, in run_driver
    return self.driver.run()

  File "c:\users\rink\git\openmdao\openmdao\drivers\genetic_algorithm_driver.py", line 256, in run
    if log_range % 2 > 0:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Numpy 1.17 Prefers random.Generator Instead of random.RandomState

In Numpy 1.17 random.Generator is preferred over using random.RandomState. RandomState is considered a legacy, backwards compatibility feature and it is frozen. According to the docs: "This class should only be used if it is essential to have randoms that are identical to what would have been produced by previous versions of NumPy." However, in OpenMDAO RandomState is used in several places (like the SimpleGADriver).

In the setup.py Numpy is listed simply as 'numpy'. This means no version is preferred by OpenMDAO. Is there a reason not to require 1.17+?

Variable bounds not recorded with SqliteRecorder

Taking the latest version of OpenMDAO at the moment I am not able to collect the lower and upper bounds of variables from the recorder. As a test I use the example in the documentation (found here). Hence I use the following test script:

from openmdao.api import Problem, ScipyOptimizeDriver, SqliteRecorder, CaseReader
from openmdao.test_suite.components.sellar import SellarDerivatives

import numpy as np

prob = Problem(SellarDerivatives())

prob.model.add_design_var('z', lower=np.array([-10.0, 0.0]),
                               upper=np.array([10.0, 10.0]))
prob.model.add_design_var('x', lower=0.0, upper=10.0)
prob.model.add_objective('obj')
prob.model.add_constraint('con1', upper=0.0)
prob.model.add_constraint('con2', upper=0.0)

prob.driver = ScipyOptimizeDriver()

prob.driver.recording_options['record_metadata'] = True

recorder = SqliteRecorder("cases.sql")
prob.driver.add_recorder(recorder)

prob.setup()
prob.run_driver()

prob.cleanup()

cr = CaseReader("cases.sql")

z_lower = cr.output2meta['z']['lower']
z_upper = cr.output2meta['z']['upper']

For z_lower and z_upper I expected to retrieve the arrays that were specified with prob.model.add_design_var('z', lower=np.array([-10.0, 0.0]), upper=np.array([10.0, 10.0])), but instead I simply get None returned. Is this an issue or am I missing something in how I should retrieve the specified bounds from the recorder?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.