Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
swryan committed May 14, 2024
2 parents a323fbd + 5eb923f commit d0b7c26
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.31.2-dev
current_version = 3.32.1-dev
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ body:
attributes:
label: OpenMDAO Version
description: What version of OpenMDAO is being used.
placeholder: "3.31.2-dev"
placeholder: "3.32.1-dev"
validations:
required: true
- type: textarea
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/openmdao_audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ jobs:
echo "Scan environment for pypi packages with known vulnerabilities"
echo "found in the Python Packaging Advisory Database"
echo "======================================================================="
python -m pip_audit -s pypi --ignore-vuln GHSA-hcpj-qp55-gfph
python -m pip_audit -s pypi
echo "======================================================================="
echo "Scan environment for packages with known vulnerabilities"
echo "found in the Open Source Vulnerability database"
echo "======================================================================="
python -m pip_audit -s osv --ignore-vuln GHSA-hcpj-qp55-gfph
python -m pip_audit -s osv
- name: Notify slack
uses: act10ns/slack@v2.0.0
Expand Down
2 changes: 1 addition & 1 deletion openmdao/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '3.31.2-dev'
__version__ = '3.32.1-dev'

INF_BOUND = 1.0E30
19 changes: 2 additions & 17 deletions openmdao/docs/openmdao_book/tests/jupyter_gui_test.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,24 @@
"""Test Jupyter doc GUI mods specific to OpenMDAO using Playwright."""
import asyncio
from aiounittest import async_test
import contextlib
import http.server
import os
import pathlib
import socket
import sys
import threading
import unittest


from playwright.async_api import async_playwright

if 'win32' in sys.platform:
# Windows specific event-loop policy & cmd
asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())

from openmdao.utils.gui_testing_utils import _GuiTestCase
from openmdao.utils.gui_testing_utils import _GuiTestCase, get_free_port

HEADLESS = True # Set to False if you want to see the browser

def get_free_port():
"""
Get a free port.
Returns
-------
port : int
a free port
"""
with contextlib.closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as _socket:
_socket.bind(('', 0))
_, port = _socket.getsockname()
return port

# Only can test if the docs have been built
@unittest.skipUnless(pathlib.Path(__file__).parent.parent.joinpath("_build").exists(),
"Cannot test without docs being built")
Expand Down
11 changes: 9 additions & 2 deletions openmdao/drivers/pyoptsparse_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def _declare_options(self):
desc='Title of this optimization run')
self.options.declare('print_opt_prob', types=bool, default=False,
desc='Print the opt problem summary before running the optimization')
self.options.declare('print_results', types=bool, default=True,
self.options.declare('print_results', types=(bool, str), default=True,
desc='Print pyOpt results if True')
self.options.declare('gradient_method', default='openmdao',
values={'openmdao', 'pyopt_fd', 'snopt_fd'},
Expand Down Expand Up @@ -646,7 +646,14 @@ def run(self):
# Print results
if self.options['print_results']:
if not MPI or model.comm.rank == 0:
print(sol)
if self.options['print_results'] == 'minimal':
if hasattr(sol, 'summary_str'):
print(sol.summary_str(minimal_print=True))
else:
print('minimal_print is not available for this solution')
print(sol)
else:
print(sol)

# Pull optimal parameters back into framework and re-run, so that
# framework is left in the right final state
Expand Down
35 changes: 35 additions & 0 deletions openmdao/drivers/tests/test_pyoptsparse_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,41 @@ def test_simple_paraboloid_linear_with_y_intercept_ineq(self):
assert_near_equal(prob['x'], 19.5, 1e-6)
assert_near_equal(prob['y'], 5.5, 1e-6)

def test_minimal_print(self):
prob = om.Problem()
model = prob.model

model.set_input_defaults('x', 50.0)
model.set_input_defaults('y', 50.0)
model.set_input_defaults('z', 0)

parab = om.ExecComp('f_xy = (x-3.0)**2 + x*y + (y+4.0)**2 - 3.0 + z')

model.add_subsystem('comp', parab, promotes=['*'])
model.add_subsystem('con', om.ExecComp('c = x + y - 25.0'), promotes=['*'])

prob.set_solver_print(level=0)

prob.driver = om.pyOptSparseDriver()
prob.driver.options['optimizer'] = OPTIMIZER

model.add_design_var('x', lower=-50.0, upper=50.0)
model.add_design_var('y', lower=-50.0, upper=50.0)
model.add_design_var('z', lower=-50.0, upper=0)
model.add_objective('f_xy')
model.add_constraint('c', lower=25)
model.add_constraint('x', upper=30)
model.add_constraint('y', upper=0)
model.add_constraint('z', upper=50)

prob.setup()
prob.driver.options['print_results'] = True
prob.run_driver()

prob.setup()
prob.driver.options['print_results'] = 'minimal'
prob.run_driver()

def test_simple_array_comp2D(self):

prob = om.Problem()
Expand Down
17 changes: 17 additions & 0 deletions openmdao/utils/gui_testing_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Define utils for use in testing GUIs with Playwright."""

import contextlib
import socket
import unittest


Expand Down Expand Up @@ -104,3 +106,18 @@ async def get_handle(self, selector):
selector + "' in the N2 diagram.")

return handle


def get_free_port():
"""
Get a free port.
Returns
-------
int
A free port.
"""
with contextlib.closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as _socket:
_socket.bind(('', 0))
_, port = _socket.getsockname()
return port
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ docs = [
"numpydoc>=1.1",
"sphinx-sitemap",
"idna>=3.7",
"jinja2>=3.1.4",
"tqdm>=4.66.3"
]
doe = [
"pyDOE3",
Expand Down
50 changes: 50 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
***********************************
# Release Notes for OpenMDAO 3.32.0

May 03, 2024

OpenMDAO 3.32.0 is a regular update with a few new features and several bug fixes. We're continuing to refine our submodel implementation, and now we give the user explicit access to the subproblem so that they can interact with it
using the `Problem` API.

POEM 093 is implemented, which allows caching of the linear solution which can improve performance in some situations.

The `assert_near_equal` utility for testing can now be set to only enforce absolute error, in cases where the nominal value is small and relative error isn't meaningful.

We now support scipy's differential evolution optimizer's ability to enforce constraints.

From a Python development perspective we've upgraded from using `setup.py` to using `pyproject.toml`, which should hep users who want to manage OpenMDAO installation with non-pip tools, like `poetry`.

The `openmdao graph` command has been added as a quick way to visualize the call graph in OpenMDAO. This is mostly for debugging purposes as it can get very complex with any sizable model.

## New Features

- Added an 'openmdao graph' command to visualize OpenMDAO's computational graph. [#3163](https://github.com/OpenMDAO/OpenMDAO/pull/3163)
- Added capability for IVCs to be instantiated with a list of variables [#3204](https://github.com/OpenMDAO/OpenMDAO/pull/3204)
- Gave user explicit access to the subproblem in SubModelComp [#3191](https://github.com/OpenMDAO/OpenMDAO/pull/3191)
- Warning in AddSubtractComp for duplicate input names [#3190](https://github.com/OpenMDAO/OpenMDAO/pull/3190)
- Added ability to force `assert_near_equal` to use absolute error. [#3188](https://github.com/OpenMDAO/OpenMDAO/pull/3188)
- Added support for constraints when using the SciPy differential evolution optimizer [#3187](https://github.com/OpenMDAO/OpenMDAO/pull/3187)
- Implementation branch for POEM93 (Linear solution caching) [#3185](https://github.com/OpenMDAO/OpenMDAO/pull/3185)

## Bug Fixes

- Fix pyOptSparse `hotstart_file` `@property` method [#3202](https://github.com/OpenMDAO/OpenMDAO/pull/3202)
- Fix for a SubmodelComp indexing issue that was preventing data from being copied properly from the outer model to the inner model. [#3192](https://github.com/OpenMDAO/OpenMDAO/pull/3192)
- Fixed bugs pertaining to the use of aliases in set_constraint_options and set_objective_options. [#3184](https://github.com/OpenMDAO/OpenMDAO/pull/3184)
- Updated ExternalCodeComp to handle a period in the executable pathname [#3178](https://github.com/OpenMDAO/OpenMDAO/pull/3178)
- Quick fix for colormap on partials plot [#3175](https://github.com/OpenMDAO/OpenMDAO/pull/3175)
- Updated ExternalCodeComp to handle path separators in the executable name [#3173](https://github.com/OpenMDAO/OpenMDAO/pull/3173)
- Fixes a relevance related bug in the krylov solvers that was introduced in a recent relevance PR [#3165](https://github.com/OpenMDAO/OpenMDAO/pull/3165)
- Fix for bug when 'val' is passed as part of metadata to declare_partials involving residuals. [#3157](https://github.com/OpenMDAO/OpenMDAO/pull/3157)
- Updated pyoptsparse_driver to address change in pyoptsparse v2.11.0 [#3218](https://github.com/OpenMDAO/OpenMDAO/pull/3218)

## Miscellaneous

- Updated Audit and Test workflows to use `setup-miniconda@v3` [#3210](https://github.com/OpenMDAO/OpenMDAO/pull/3210)
- Updated dependencies and tests for NumPy/SciPy compatibility [#3198](https://github.com/OpenMDAO/OpenMDAO/pull/3198)
- Addressed vulnerability in dependency [#3194](https://github.com/OpenMDAO/OpenMDAO/pull/3194)
- Fixed the temporarily broken search functionality in the docs [#3170](https://github.com/OpenMDAO/OpenMDAO/pull/3170)
- Added inputs to OpenMDAO Tests workflow_dispatch trigger [#3168](https://github.com/OpenMDAO/OpenMDAO/pull/3168)
- Replaced `setup.py` with `pyproject.toml` using `hatchling` backend [#3152](https://github.com/OpenMDAO/OpenMDAO/pull/3152)


***********************************
# Release Notes for OpenMDAO 3.31.1

Expand Down

0 comments on commit d0b7c26

Please sign in to comment.