Closed rpauly18 closed 3 years ago
@kmruehl and @ssolson I still need to develop the tests for these new functions, but they are ready to be reviewed, particularly for the DocString information. Thanks!
I think you have the loads functions at both the loads level and the sub folder level:
It looks like there is still a test data folder. Is your plan to move all of this to example data when you write the tests?
Yes, I am working on that as we speak.
@rpauly18 do you mean that you would like me to check the API documentation?
@kmruehl yes, or at least do a general proof read. If you have time, it would also be good for you to run some of the functions and/or the example notebooks. Thanks!
Rebecca to be consistient with python the wave.io folder should have a subfolder called NDBC and then each function would be request data etc. Is this possible/ does it make sense in MATLAB?
Also will you be able to wrap the WEC-SIM IO? I don't expect it to change in structure at this point.
@ssolson I will not be wrapping the WEC-Sim IO because WEC-Sim data is already in a MATLAB friendly format, so wrapping the Python function would not be necessary/ counter productive.
I could create the sub folder for NDBC, but at this point it would be the only folder in IO, so it might not be necessary.
That being said, it would be useful to develop a WEC-Sim example notebook.
Of course that makes sense to not wrap it! Agreed on the notebook/ testing the WEC-SIM Matlab data to MHKiT functions.
I would be in favor of creating the NDBC subfolder as we plan to at least add Aiden's work in the future and then the NDBC functionality would remain consisteient e.g. no rework of the examples/ tests and documentation. But its your call.
Rebecca I am getting this error below when I try to run the contour notebook example:
I would change the title of section 3 to something like "Find the 100 year contour line " (this should eventually be changed on the Python side too)
line 18 on the definition of period needs semicolon to close the line.
Sterling, what version of Matlab do you have? I do not get that error. @kmruehl can you try running the example ad see if you also get the error?
'9.8.0.1417392 (R2020a) Update 4' Looks like Update 5 is out so I will install that to see if it fixes the issue.
OK, I really hope MATLAB did not do away with converting numpy to double in 2020, because that will mean just about every wrapper in the package will need to be changed. I am still on 2019.
@rpauly18 I can take a look. I have both 2020a and 2018b on my laptop.
@ssolson Have you been able to run any of the other examples? Many of the MHKiT-MATLAB functions make that conversion, so it would be good to see if you get the same error in other notebooks.
I'm trying to run but I think your feature branch is missing the other data files? e.g. only the wave data is available.
Also Update 5 did not fix the issue
Yes I am getting the error in wave:
@ssolson I made some updates to how numpy arrays are handled in NDBC_request_data. Can try re-running the environmental contours example to see if this methodology will work for you?
Hey Rebecca, I installed the 3.1 toolbox and I am getting the same conversion to double error
Darn. OK, I am going to wait until Kelley reports back to proceed. I will need to go through NREL IT to get a copy of R2020, so I cannot test it yet myself.
That being said, it would be useful to develop a WEC-Sim example notebook.
I already have one I can add, I developed a *.py
and *.m
example at the same time.
Thats great. Thanks, Kelley!
@rpauly18 and @ssolson I just ran environmental_contours_example.mlx
in 2020a without issue. I'll test the other examples too.
What python and numpy version do you guys run? I python 3.8.3 and numpy 1.19.1
Name: numpy Version: 1.18.1
Python 3.7.6
numpy 1.18.5
Python 3.7.5
I thought Python 3.8 might be an issue, but according to this https://www.mathworks.com/help/matlab/matlab_external/system-requirements-for-matlab-engine-for-python.html it should be fine.
@ssolson Turns out the issue is Python 3.8. I updated and got the same error. I have now reverted back to 3.7. We will need to think about how to handle this issue.
Super happy we diagnosed the issue. Now I can change the MATLAB instructions to state that it is only compatible with 3.6 and 3.7 as it did before.
Can you switch back to 3.8 and see if you get the WEC SIM io error I was getting on the detrend call?
@ssolson is there any way you can update to Matlab 2020b? According to Matlab forums, 2020a does not support Python3.8. The first Matlab version to support 3.8 is 2020b.
Yes I am downloading it now. I'll let you know if it fixes the issue.
@rpauly18 I've reviewed all of the MATLAB Live examples and made some minor revisions to the examples with https://github.com/MHKiT-Software/MHKiT-MATLAB/pull/33/commits/aacbfbe3c138b362378b9bf6b769e29c4a55cda6, namely:
Updating to 2020b resolved the double conversion issue for Python 3.8
@ssolson @kmruehl I think this PR is ready for a final review, and hopefully merging.
I am going to wait until we tag the Python release on pip before merging, just in case someone tries to download this before they can pip install the corresponding MHKiT-Python.
This PR contains the new functions and reorganizations for MHKiT v0.3.0.
Still to-do: Tests for all new functions