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

v3.0.2 #367

Merged
merged 18 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "wecopttool"
version = "3.0.1"
version = "3.0.2"
description = "WEC Design Optimization Toolbox"
readme = "README.md"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def test_unstructured_controller_long_crested_wave(self,
Fex = res_fd[0].force.sel(
type=['Froude_Krylov', 'diffraction']).sum('type')
power_optimal = (np.abs(Fex)**2/8 / np.real(hydro_impedance.squeeze())
).squeeze().sum('omega').item()
).squeeze().sum('omega').item()

assert power_sol == approx(power_optimal, rel=1e-2)

Expand Down
5 changes: 5 additions & 0 deletions wecopttool/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,11 @@ def solve(self,
_log.info("Solving pseudo-spectral control problem "
+ f"for realization number {realization}.")

try:
wave = wave.squeeze(dim='realization')
except KeyError:
pass

# objective function
sign = -1.0 if maximize else 1.0

Expand Down
Loading