Skip to content

Commit

Permalink
v3.0.2 (#367)
Browse files Browse the repository at this point in the history
* remove realization dimension if it exists (#365)

* Update pyproject.toml
  • Loading branch information
michaelcdevin authored Aug 2, 2024
1 parent ea97be0 commit b9e1e0d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
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

0 comments on commit b9e1e0d

Please sign in to comment.