Skip to content

FLOWERS subpackage integration#169

Open
cfrontin wants to merge 179 commits intoNLRWindSystems:developfrom
cfrontin:feature/full_flowers_integration
Open

FLOWERS subpackage integration#169
cfrontin wants to merge 179 commits intoNLRWindSystems:developfrom
cfrontin:feature/full_flowers_integration

Conversation

@cfrontin
Copy link
Collaborator

@cfrontin cfrontin commented Jan 8, 2026

FLOWERS subpackage integration

While working with some offshore work, we brought in FLOWERS but in a mostly untested standalone repo; this is a more permanent home for FLOWERS in Ard that will allow it to live with Ard but still be used independently, i.e. this still would work with complete backward compatibility:

from flowers import FlowersModel

Merge with flowers repo

The FLOWERS git history has been preserved in its entirety in this Ard pr. Try git blame on OG FLOWERS features to see changes from bayc or locascio-m To do this, I:

  1. did some organization maintenance in Ard, so that
    • unit and system subdirectories were underneath their target subpackage in the Ard repo
      • test/ard/unit, etc.
  2. made synced changes to FLOWERS in https://github.com/cfrontin/flowers/tree/prep_for_ard_move so that the directory structure matches Ard
    • e.g. locate the system-level tests in test/flowers/system
  3. merged w/ no-history settings to get both the Ard history and independent FLOWERS history in the Ard PR branch
  4. re-factored the pyproject.toml to allow independent subpackage installation
    • now pip install ard results in both import flowers and import ard being available in the python env
  5. refactored CI/CD testing to get subpackage unit and system testing stood up independently of mainline Ard

Other updates

  • ???

Outstanding work

  • ???

File changes summarized

The following is a summary of changes by type, to help streamline the review process since this PR is so heavy.

  • imported from flowers repo; unless noted: black formatter applied, inaccessible code deleted
    • examples/flowers/_archive/compute_AEP.py: moved to a directory for legacy tests
    • examples/flowers/data/HKW_wind_rose.csv: moved to a shared location
    • flowers/__init__.py: auto-removed trailing whitespace
    • flowers/flowers_model.py
    • flowers/optimization/__init__.py
    • flowers/optimization/model_interface.py
    • flowers/optimization/optimization_interface.py
    • flowers/tools.py
    • flowers/visualization.py
    • pyproject_flowers.toml: renamed to dodge conflict, saved for validation
    • test/flowers/__init__.py
    • test/flowers/_archive/conftest.py
    • test/flowers/_archive/regression/test_flowers_aep.py
  • tailored changes:
    • .coveragerc: add ignores for legacy FLOWERS code I don't want to dispose yet
    • .github/workflows/python-tests-consolidated.yaml: integrate parallel FLOWERS testing
    • pyproject.toml: updated to include subpackage
    • test/run_local_test_system.sh
    • test/run_local_test_unit.sh
  • moved under refactor, renamed w/o changes
    • examples/{ => ard}/01_onshore/inputs/ard_system.yaml
    • examples/{ => ard}/01_onshore/inputs/windio.yaml
    • examples/{ => ard}/01_onshore/optimization_demo.ipynb
    • examples/{ => ard}/02_offshore_fixed/inputs/ard_system.yaml
    • examples/{ => ard}/02_offshore_fixed/inputs/windio.yaml
    • examples/{ => ard}/02_offshore_fixed/optimization_demo.ipynb
    • examples/{ => ard}/03_offshore_floating_custom_system/inputs/ard_system.yaml
    • examples/{ => ard}/03_offshore_floating_custom_system/inputs/windio.yaml
    • examples/{ => ard}/03_offshore_floating_custom_system/optimization_demo.ipynb
    • examples/{ => ard}/05_onshore_batch/inputs/NREL_Reference_5MW_126.csv
    • examples/{ => ard}/05_onshore_batch/inputs/ard_system.yaml
    • examples/{ => ard}/05_onshore_batch/inputs/h2i/driver_config.yaml
    • examples/{ => ard}/05_onshore_batch/inputs/h2i/h2i_ard.yaml
    • examples/{ => ard}/05_onshore_batch/inputs/h2i/plant_config.yaml
    • examples/{ => ard}/05_onshore_batch/inputs/open-meteo-56.20N8.54E86m-short.yaml
    • examples/{ => ard}/05_onshore_batch/inputs/open-meteo-56.20N8.54E86m.yaml
    • .../{ => ard}/05_onshore_batch/inputs/power_thrust_table_ccblade_NREL-5p0-126-RWT.csv
    • examples/{ => ard}/05_onshore_batch/inputs/resource_prep/convert_weather_to_speed_dir.py
    • examples/{ => ard}/05_onshore_batch/inputs/resource_prep/open-meteo-56.20N8.54E86m.csv
    • examples/{ => ard}/05_onshore_batch/inputs/windIO-plant_turbine_NREL-5.0MW-126m-RWT.yaml
    • examples/{ => ard}/05_onshore_batch/inputs/windio.yaml
    • examples/{ => ard}/05_onshore_batch/onshore-batch.ipynb
    • examples/{ => ard}/05_onshore_batch/run_wind_ard.py
    • examples/{ => ard}/06_onshore_multiobjective/inputs/ard_system.yaml
    • examples/{ => ard}/06_onshore_multiobjective/inputs/windio.yaml
    • examples/{ => ard}/06_onshore_multiobjective/optimization_demo.ipynb
    • examples/{ => ard}/data/offshore/GulfOfMaine_bathymetry_100x99.txt
    • examples/{ => ard}/data/windIO-plant_turbine_IEA-22MW-284m-RWT.yaml
    • examples/{ => ard}/data/windIO-plant_turbine_IEA-3.4MW-130m-RWT.yaml
    • examples/{ => ard}/data/windIO-plant_wind-resource_wrg-example.yaml
  • only changes to resource location descriptions for compatibility w/ refactor
    • assets/logomaker/inputs/windio.yaml
    • test/ard/system/api/inputs_offshore_floating/ard_system.yaml
    • test/ard/system/api/inputs_offshore_monopile/ard_system.yaml
    • test/ard/system/api/inputs_onshore/ard_system.yaml
    • test/ard/system/collection/test_optiwindnet.py
    • test/ard/system/cost/test_spacing_approximations_connections.py
    • test/ard/system/geometry/test_constraints.py
    • test/ard/system/offshore/test_mooring_packing.py
    • test/ard/unit/api/inputs_onshore/ard_system_bad_windio.yaml
    • test/ard/unit/api/inputs_onshore/windio.yaml
    • test/ard/unit/cost/test_orbit_wrap.py
    • test/ard/unit/cost/test_wisdem_wrap.py
    • test/ard/unit/farm_aero/test_floris.py
    • test/ard/unit/geographic/test_geomorphology.py
  • new test development
    • test/flowers/system/rotation/__init__.py
    • test/flowers/system/rotation/precooked.yaml
    • test/flowers/system/rotation/rotational_consistency.npz
    • test/flowers/system/rotation/sandbox.py
    • test/flowers/system/rotation/test_rotational_consistency.py
    • test/flowers/system/rotation/test_rotational_workbench.py
    • test/flowers/system/test_flowers_stack.py
    • test/flowers/system/wind_roses/wr4.p
    • test/flowers/unit/layouts/garbage5.p
    • test/flowers/unit/test_flowers_model.py
    • test/flowers/unit/test_tool_discrete_pyrite.npz
    • test/flowers/unit/test_tool_random_pyrite.npz
    • test/flowers/unit/test_tools.py
    • test/flowers/unit/wind_roses/wr4.p
  • miscellaneous
    • .gitignore: auto-removal of trailing whitespace
    • ard/__init__.py: extraneous addition of experimental "house style" code for matplotlib...

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 FLOWERS package (a rapid wind farm energy simulation tool) into the Ard repository. The integration includes moving FLOWERS code into the main repository structure, updating test infrastructure to support both packages, and reorganizing example data files.

Changes:

  • Added complete FLOWERS package source code and tests
  • Updated test scripts to support running tests for both ard and flowers packages
  • Relocated example data files from examples/data/ to examples/ard/data/
  • Updated pyproject.toml to include flowers package and add Christopher Bay as an author

Reviewed changes

Copilot reviewed 35 out of 74 changed files in this pull request and generated 31 comments.

Show a summary per file
File Description
test/run_local_test_unit.sh Updated to support running unit tests for both ard and flowers packages
test/run_local_test_system.sh Updated to support running system tests for both ard and flowers packages
flowers/*.py New FLOWERS source code for wind farm modeling and optimization
test/flowers/**/*.py New comprehensive test suite for FLOWERS functionality
pyproject.toml Updated to include flowers package in build configuration
examples/ard/data/*.yaml Relocated data files with updated paths in dependent test files

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

@cfrontin cfrontin changed the title Full FLOWERS integration FLOWERS subpackage integration Jan 22, 2026
@cfrontin cfrontin marked this pull request as ready for review January 22, 2026 23:36
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.

I'm excited to see this come in!

Most of my comments are on doc strings being out of date or missing. Should be pretty easy to fix. There are a few slightly more involved comments. I would also like to move away from using binary files and pyrite in tests if we can as I think they complicate things unnecessarily.

It looks like most of the FLOWERS tests are integration tests. Probably my biggest concern is the lack of unit testing in FLOWERS (I know you added some). Maybe breaking up the code into more methods and unit testing those needs to be in a follow on PR, but if so I think we should make an issue so we don't lost track of it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocking, but in the future I think we should shoot to have all resource data in the repo in the windio format

print("Factor of Improvement: {:.1f}x".format(time_floris / time_flowers))
print("============================")

if timer:
Copy link
Contributor

Choose a reason for hiding this comment

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

I have found varying returns a dangerous practice in the past. I would like to adjust this, but am up for leaving that for a later PR.

"""

def __init__(
self,
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to use a more self-documenting approach for this init, but I think we can role with it for now


if conventional_model is None or conventional_model == "gauss":
self.floris_interface = wfct.floris_interface.FlorisInterface(
"./input/gauss.yaml"
Copy link
Contributor

Choose a reason for hiding this comment

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

importing hard-coded paths this deep in the code seems dangerous to me. Perhaps we can at least make these paths using Path so they are OS agnostic. Better would be to have default dictionaries or something that will always work but could be modified by user input if desired.

)
elif conventional_model == "jensen":
self.floris_interface = wfct.floris_interface.FlorisInterface(
"./input/jensen.yaml"
Copy link
Contributor

Choose a reason for hiding this comment

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

See above comment about hard-coded paths

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you intend to include this file? If so, maybe add some comments at the top about why it is included in the repo

Copy link
Contributor

Choose a reason for hiding this comment

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

are all the pickle files necessary? I would prefer to not include any pickle files for testing, but lets for sure not include ones we don't need.


flowers/visualization.py
flowers/optimization/optimization_interface.py
flowers/optimization/model_interface.py No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

why is model_interface.py omitted?

@@ -23,6 +23,7 @@ authors = [
{name = "Cory Frontin", email = "cory.frontin@nrel.gov"},
{name = "Rafael Mudafort", email = "rafael.mudafort@nrel.gov"},
{name = "Jared Thomas", email = "jared.thomas@nrel.gov"},
Copy link
Contributor

Choose a reason for hiding this comment

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

should @locascio-m be included here?, maybe with a FLOWERS specific comment?

Copy link
Contributor

Choose a reason for hiding this comment

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

or we could add an author block in the flowers pyproject file

]
[project.urls]
# Homepage = "https://example.com"
Documentation = "https://wisdem.github.io/flowers"
Copy link
Contributor

Choose a reason for hiding this comment

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

need to update links

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.

4 participants