You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In wec.core.solve, the xarray groupby method is used to iterate over the different phase realizations. Previously, this has squeezed out the realization dimension in the DataArray and WecOptTool has indexed the wave information in the solve steps under that assumption.
However, squeezing the dimension was only occurring for monotonically increasing DataArrays, which led to confusion among xarray users and the functionality is no longer default and has been deprecated. As a result, as of xarray v2024.07.0, the dimensions are not squeezed, leaving the realization dimension in waves and causing downstream dimension sizing issues involving numpy.concatenate:
ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 2 dimension(s) and the array at index 1 has 3 dimension(s)
---------------
Traceback:
---------------
wecopttool\core.py:825: in solve
optim_res = minimize(**problem)
C:\Users\mcdevin\AppData\Local\mambaforge\envs\wot_dev_new\Lib\site-packages\scipy\optimize\_minimize.py:743: in minimize
res = _minimize_slsqp(fun, x0, args, jac, bounds,
C:\Users\mcdevin\AppData\Local\mambaforge\envs\wot_dev_new\Lib\site-packages\scipy\optimize\_slsqp_py.py:333: in _minimize_slsqp
meq = sum(map(len, [atleast_1d(c['fun'](x, *c['args']))
C:\Users\mcdevin\AppData\Local\mambaforge\envs\wot_dev_new\Lib\site-packages\scipy\optimize\_slsqp_py.py:333: in <listcomp>
meq = sum(map(len, [atleast_1d(c['fun'](x, *c['args']))
wecopttool\core.py:789: in scaled_resid_fun
return self.residual(x_wec, x_opt, wave)
wecopttool\core.py:598: in residual
ri = ri - f(self, x_wec, x_opt, waves)
wecopttool\core.py:2025: in force
force_fd = complex_to_real(wave_excitation(force_coeff, waves), False)
wecopttool\core.py:1703: in complex_to_real
out = np.concatenate([out, d])
C:\Users\mcdevin\AppData\Local\mambaforge\envs\wot_dev_new\Lib\site-packages\autograd\numpy\numpy_wrapper.py:38: in <lambda>
concatenate = lambda arr_list, axis=0 : concatenate_args(axis, *arr_list)
C:\Users\mcdevin\AppData\Local\mambaforge\envs\wot_dev_new\Lib\site-packages\autograd\tracer.py:48: in f_wrapped
return f_raw(*args, **kwargs)
The text was updated successfully, but these errors were encountered:
In
wec.core.solve
, the xarray groupby method is used to iterate over the different phase realizations. Previously, this has squeezed out therealization
dimension in the DataArray and WecOptTool has indexed the wave information in the solve steps under that assumption.However, squeezing the dimension was only occurring for monotonically increasing DataArrays, which led to confusion among xarray users and the functionality is no longer default and has been deprecated. As a result, as of xarray v2024.07.0, the dimensions are not squeezed, leaving the
realization
dimension inwaves
and causing downstream dimension sizing issues involvingnumpy.concatenate
:The text was updated successfully, but these errors were encountered: