MHKiT-Python icon indicating copy to clipboard operation
MHKiT-Python copied to clipboard

Wave performance `mean_annual_energy_production_matrix` has no test & is incompatible with example

Open ssolson opened this issue 7 months ago • 0 comments

In the wave_example.ipynb Input box [15] calls:

# Calcaulte maep from matrix
maep_matrix = wave.performance.mean_annual_energy_production_matrix(
    LM_mean, JM, LM_freq
)

In MHKiT v0.8.1 this will fail because mean_annual_energy_production_matrix is not setup to handle 2D DataFrames. Additionally the check:

    if not np.abs(frequency.sum() - 1) < 1e-6:
        raise ValueError("Frequency components must sum to one.")

was added but does not work for this LM_freq matrix provided.

@akeeste could you add a test for this function and determine why the example LM_freq does not pass this check which was previously commented out.

https://github.com/MHKiT-Software/MHKiT-Python/blob/a07ecc427ab924e32f8a2305d4be7193e5125614/mhkit/wave/performance.py#L258

For #330 I will calculate manually and leave the MHKiT function call commented out.

ssolson avatar Jul 03 '24 15:07 ssolson