Skip to content

Conversation

@cfrontin
Copy link
Collaborator

Bring in NSGA2 from the WISDEM and enable its use as an OpenMDAO driver.

@cfrontin cfrontin changed the base branch from main to develop November 25, 2025 16:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR integrates the NSGA2 (Non-dominated Sorting Genetic Algorithm II) optimization driver from WISDEM into the ARD framework, enabling its use as an OpenMDAO driver for multi-objective optimization problems.

  • Adds NSGA2Driver import and conditional instantiation in the driver setup logic
  • Introduces a new visualization utility function for calculating plot ranges with configurable buffers
  • Provides a new example configuration (example 06) demonstrating NSGA2 driver usage for onshore multifidelity optimization

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
ard/api/interface.py Adds NSGA2Driver support with conditional instantiation based on driver name in configuration
ard/viz/utils.py New utility function for calculating plot value ranges with percentage-based buffers
examples/06_onshore_multifidelity/inputs/windio.yaml Configuration file defining wind plant site, boundaries, and turbine layout for example 06
examples/06_onshore_multifidelity/inputs/ard_system.yaml System configuration showcasing NSGA2 driver setup with optimization parameters, design variables, constraints, and objectives

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +236 to +237
if name_driver == "NSGA2":
prob.driver = NSGA2Driver()
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NSGA2Driver integration lacks test coverage. Since there are existing tests for other drivers (e.g., test_multiobjective.py), consider adding tests to verify that the NSGA2 driver is correctly instantiated, accepts configuration options, and can be used in optimization scenarios.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be worth adding an NSGA2 test, even with a generation termination, just to make sure everything stays working with NSGA2 inside Ard.

Copy link
Contributor

@jaredthomas68 jaredthomas68 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good. Just a few comments, mostly on the example.

Comment on lines +236 to +237
if name_driver == "NSGA2":
prob.driver = NSGA2Driver()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be worth adding an NSGA2 test, even with a generation termination, just to make sure everything stays working with NSGA2 inside Ard.

"id": "b0732705",
"metadata": {},
"source": [
"Here, you should see each of the groups or components described as they are added to the `Ard` model and, occasionally, some options being turned on on them, like semi-total finite differencing on groups.\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment would be more clear if it started with "above" instead of "here"

]
},
{
"cell_type": "markdown",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the case would be more interesting if the boundaries played some role, or were at least closer to the used area of the farm, non-blocking change

"<Figure size 640x480 with 2 Axes>"
]
},
"metadata": {},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a bunch of the processing and plotting code could be made into utility functions that would be pretty helpful in the future

"output_type": "display_data"
}
],
"source": [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plots are missing axis and colorbar labels, please add them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants