Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiple phase realizations to waves #297

Merged
merged 13 commits into from
Dec 7, 2023

Conversation

jtgrasb
Copy link
Collaborator

@jtgrasb jtgrasb commented Nov 15, 2023

Description

This PR adds a realization dimension to the waves DataArray (Issue #262). The number of realizations is set equal to 1 by default, but is set to 5 for tutorial 3 and 4 which have irregular waves. The solve() function now loops over multiple phase realizations and returns a list of the results from all optimizations.

Type of PR

  • Bug fix
  • New feature
  • Documentation
  • Other: (specify)

Checklist for PR

Additional details

I am still working on adding a section to one of the tutorials to demonstrate multiple phase realizations vs. a longer time window.

@coveralls
Copy link

coveralls commented Dec 6, 2023

Pull Request Test Coverage Report for Build 7134822091

  • 115 of 116 (99.14%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 93.983%

Changes Missing Coverage Covered Lines Changed/Added Lines %
wecopttool/core.py 50 51 98.04%
Totals Coverage Status
Change from base Build 6910014540: 0.05%
Covered Lines: 2499
Relevant Lines: 2659

💛 - Coveralls

@jtgrasb
Copy link
Collaborator Author

jtgrasb commented Dec 7, 2023

I have updated this PR and it is ready for review. The waves.py script has been updated such that when creating an irregular wave, there is now an option to input the number of wave phase realizations and the output is a waves variable with an extra dimension/coordinate called realization. The solve() function of the core.py script takes in the waves Dataset and iterates over the realizations, outputting a list of optimized results. Even when 1 realization is used, I've left the output as a list of length 1 for consistency. I've also updated the tutorials accordingly, with LUPA and Pioneer now using multiple realizations. The tests have also been updated.

I am still working on a demonstration of how to determine the number of phase realizations needed. I think it is best to merge this PR to include the functionality in WecOptTool, and I will work on another PR which updates one of the tutorials to demonstrate the multiple phase realizations and a reliable method for determining the number to use.

Copy link
Member

@cmichelenstrofer cmichelenstrofer left a comment

Choose a reason for hiding this comment

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

Looks really good! just some minor changes. I reviewed the source and tests but not the tutorials.

wecopttool/waves.py Outdated Show resolved Hide resolved
wecopttool/waves.py Outdated Show resolved Hide resolved
wecopttool/waves.py Show resolved Hide resolved
wecopttool/waves.py Show resolved Hide resolved
wecopttool/waves.py Outdated Show resolved Hide resolved
wecopttool/core.py Outdated Show resolved Hide resolved
wecopttool/core.py Outdated Show resolved Hide resolved
wecopttool/core.py Outdated Show resolved Hide resolved
tests/test_waves.py Show resolved Hide resolved
tests/test_integration.py Outdated Show resolved Hide resolved
@jtgrasb jtgrasb merged commit 598e875 into sandialabs:main Dec 7, 2023
10 checks passed
@jtgrasb jtgrasb mentioned this pull request Jan 12, 2024
10 tasks
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.

3 participants