Skip to content

Conversation

@paulf81
Copy link
Collaborator

@paulf81 paulf81 commented Nov 8, 2024

Implement automatic model calibration

This pull request adds a new class to FLASC: ModelFit. Currently under development the new class implements a new paradigm for automatic model calibration. The PR includes new examples and will include additional documentation.

Checklist of work to go:

  • Update examples to match latest uses
  • Decide which cost function to keep/delete/rename
  • Add opt sweep to optimization module and include an example
  • Remove temporary code
  • Hide/delete former methods of calibration
  • Add deprecation warnings to old code
  • Complete testing
  • Add docs
  • Add examples using optuna plots to show parameter importance etc.,
  • Update smarteole examples
  • Decide if we should use custom cost function in smarteole example
  • List out un-related changes

Review of changes

  • Model fit class added fo flasc/model_fitting
  • floris_tuning.py is notably deprecated
  • testing of model_fit. (and cost and opt functions added)
  • testing of floris_tuning deprecated
  • new dependencies added
  • model fit add to docs and docs cleaned up a bit to organize flow

Unrelated linting-type changes that got grouped in

  • emgauss.yaml is formatted
  • several of the smarteole examples (notebooks) were re-run and saved but not clearly updated meaninfully
  • a duplicate wind_up notebook is removed

Flying below the radar

results_analysis.py, which was useful for conducting analysis of results generated from model_fit in other projects in included but not yet linked into any examples or docs. This is probably ok for this first pass.

Feature or improvement description
This PR replaces #213

misi9170 and others added 30 commits September 4, 2024 17:16
…atLabRockies#199)

* Adding at the root level for now; could consider moving to utilities/

* Ruff.

* precommit stuff.

* Add example notebook

* Add wide to long

* Add test

* Update README.md engagement

* Update README.md replacing 'FLORIS' typo

* Feature/add docstrings (NatLabRockies#197)

* Update to 15 (NatLabRockies#202)

* Update for PyPI installation. (NatLabRockies#204)

* Update version number; ignore version.py for ruff.

* Adhere to FLASC formatting rules.

* psuedocode for conversions. Tests for saving dataframe to file.

* Print warning when to_feather used.

* String formatting.

* Add several more tests and n_turbines property.

* Adding TODOs for long/wide conversions.

* Clean up, a few more tests.

* Improved printout.

* ruff format.

---------

Co-authored-by: Paul <paul.fleming@nrel.gov>
Co-authored-by: christiannvaughn <139596563+christiannvaughn@users.noreply.github.com>
@paulf81
Copy link
Collaborator Author

paulf81 commented Sep 25, 2025

First follow-up comment is the ResultsAnalysis is out

@misi9170
Copy link
Collaborator

@paulf81 regarding the verbose flag for Optuna---I think it's something we can fix. The verbose option in opt_optuna() simply isn't used---probably there's a way to pass it along to the actual optuna call :)

@paulf81
Copy link
Collaborator Author

paulf81 commented Sep 25, 2025

@misi9170 on form_flasc_dataframe it is only used in that example so it could fairly go. My only pause is that it isn't totally useless, it could for example instead of just being cut, moved to utilities, or utilities_examples. Which would you prefer?

@misi9170
Copy link
Collaborator

@misi9170 on form_flasc_dataframe it is only used in that example so it could fairly go. My only pause is that it isn't totally useless, it could for example instead of just being cut, moved to utilities, or utilities_examples. Which would you prefer?

I guess I'm not really seeing what it's adding compared to just actually instantiating a FlascDataFrame from scratch?

@paulf81
Copy link
Collaborator Author

paulf81 commented Sep 25, 2025

@misi9170 on form_flasc_dataframe it is only used in that example so it could fairly go. My only pause is that it isn't totally useless, it could for example instead of just being cut, moved to utilities, or utilities_examples. Which would you prefer?

I guess I'm not really seeing what it's adding compared to just actually instantiating a FlascDataFrame from scratch?

Ok, I'll kill it

@paulf81
Copy link
Collaborator Author

paulf81 commented Sep 25, 2025

Also I tracked down the parallel thing, in very early versions of things, we were converting all ParallelFlorisModel under the hood but got rid of that and just never caught up the examples. I think the best thing to do could be to remove the language from the examples,

Question for you @misi9170, do you think useful to include a parallel example that does use ParFlorisModel

@paulf81
Copy link
Collaborator Author

paulf81 commented Sep 25, 2025

@misi9170 on form_flasc_dataframe it is only used in that example so it could fairly go. My only pause is that it isn't totally useless, it could for example instead of just being cut, moved to utilities, or utilities_examples. Which would you prefer?

I guess I'm not really seeing what it's adding compared to just actually instantiating a FlascDataFrame from scratch?

Ok, I'll kill it

On second thought I found where it's used in the ModelFit process and while I could make it inline, I thought just switching it to a private member function was a little cleaner

@paulf81 paulf81 merged commit 5526fd6 into NatLabRockies:develop Sep 26, 2025
3 checks passed
@paulf81 paulf81 deleted the feature/modelfit_2 branch September 26, 2025 03:53
@misi9170 misi9170 mentioned this pull request Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants