Closed mbruggs closed 1 year ago
Hello! Added small function to compute the value at a given return period and also updated the example. Please let me know if anything can be tightened up on this.
Thank you for your interest in MHKiT-python @mbruggs! We will need to add a test for sure and clean up some formatting, and variable names but before we do that I want to check with @cmichelenstrofer for interest in incorporating this function.
@cmichelenstrofer could you quickly comment on your thoughts about incorporating this proposed function into MHKiT and if incorporated would we include it in extreme.py
or in the utils
module?
Thanks for looking @ssolson! Sorry for not adding the test, I completely missed the test directory when I looked. I'll add a test once we have some feedback from Carlos.
I've run autopep8 over the function and pushed the changes but let me know what other formatting changes are needed.
@ssolson Yes this is very useful. I was doing it manually in the examples but having a function is better.
@mbruggs Carlos approved your changes. Can you add a test for this function? There are several examples in /tests/loads/ for reference. I'm also going to change this PR to go into our Develop branch, per our current workflow. @ssolson or I can do a final review once the test is in.
Adam
Thanks for the input everyone, much appreciated. I've added a test but it found it hard to know exactly what the test should be. In the end, the test is against a 'known value', ie computed with the function under test itself. This should, at least, guard against any unexpected changes in the function signature or calculation, assuming that the current calculation is correct.
Sorry for missing that the branch should be merged into Develop. I've rebased my branch against Develop so the merge should be neat.
Thanks again for all the work on MHKiT!
This PR adds a function called
return_year_value
. An example usage can be seen in theextreme_response_full_sea_state_example.ipynb
. The example would be adjusted from:To:![image](https://user-images.githubusercontent.com/13438942/192002394-f4572488-7a60-4aaf-a771-19d57433c3a8.png)
With the
return_year_value
function defined as follows: