MHKiT-Software / MHKiT-MATLAB

MHKiT-MATLAB provides the marine renewable energy (MRE) community tools for data processing, visualization, quality control, resource assessment, and device performance.
https://mhkit-software.github.io/MHKiT/
BSD 3-Clause "New" or "Revised" License
15 stars 23 forks source link

testing fix for h5py error #51

Closed rpauly18 closed 3 years ago

rpauly18 commented 3 years ago

removed mhkit load from circular function. If this works it can be applied to all other functions- but a solution will need to be found for the WPTO hindcast function

rpauly18 commented 3 years ago

@ssolson can you pull down this PR and test the call to the circular function? You might need to reload the MHKiT-MATLAB Toolbox after doing so.

ssolson commented 3 years ago

Getting error with h5_py although it is now slightly different than before.

Error using h5>init h5py.h5 (line 1)
Python Error: ImportError: DLL load failed while importing defs: The specified procedure could not be found.

Error in version><module> (line 15)

Error in __init__><module> (line 33)

Error in multi_file_resource><module> (line 5)

Error in __init__><module> (line 8)

Error in hindcast><module> (line 3)

Error in __init__><module> (line 3)

Error in __init__><module> (line 2)

Error in __init__><module> (line 1)

Error in <frozen importlib>_call_with_frames_removed (line 219)

Error in <frozen importlib>exec_module (line 783)

Error in <frozen importlib>_load_unlocked (line 671)

Error in <frozen importlib>_find_and_load_unlocked (line 975)

Error in <frozen importlib>_find_and_load (line 991)

Error in <frozen importlib>_gcd_import (line 1014)

Error in __init__>import_module (line 127)

Looking at the h5py source code where is fails on line 15 of version.py I believe it is trying to load a pyd file.

image

My guess is there some mismatch between the local DLLs and the DLLs these were complied with and they are not being matched correctly when called through MATLAB. I don't know much about this though so I am just taking a guess here.

rpauly18 commented 3 years ago

I do not know anything about DLLs either. It does look like h5py is up to version 3.1.0. Can you try updating the package? Although they still have an open issue about this https://github.com/h5py/h5py/issues/1774

ssolson commented 3 years ago

The error above was received with h5py-3.1.0

rpauly18 commented 3 years ago

I doubt this will work, but try one more time with this change. If this does not work, we may need to consider removing the WPTO hindcast function temporarily until we can find a solution

ssolson commented 3 years ago

Same error as before. Yeah, I think we should remove this until h5py and anaconda resolve this issue.

rpauly18 commented 3 years ago

Can you take care of removing it as you can more quickly test the Matlab side to make sure everything that needs to be removed to make Matlab work has been done?

ssolson commented 3 years ago

ohh you know I was thinking we would remove it from Matlab not python...Now I see that doesn't make sense. I will see if a non-anaconda version of python works with MATLAB.

ssolson commented 3 years ago

Well I can report that this is not an anaconda issue.

ssolson commented 3 years ago

Okay so you cannot change the MATLAB version HDF5 because it is closely tied to the MATLAB executable. Currently, Matlab R2020b Update 4 uses an outdated as far as I can tell version of HDF5 library 1.8.12. You can check your version in MATLAB using [ver_major,ver_minor,ver_patch] = H5.get_libversion

At a surface level to me, it seems to me that that HDF5 version 1.10 breaks some backward compatibility.

The python package h5py brings precompiled HDF5 libraries that uses up to date HDF5 version 1.12.0. You can check your version in Python

import h5py
h5py.h5.get_libversion()

It is possible to compile hypy using a custom compiled source but this is far from a plug and play solution. This will require each MATLAB user to do custom compilations. I have not yet confirmed that this will solve the issue either.

rpauly18 commented 3 years ago

Thanks for continuing to dive into this. This issue brings to light a couple underlying issues with the Python/Matlab development. I plan to have this as a discussion item for the broader team to try and determine a path forward with development in general.

rpauly18 commented 3 years ago

This issue is fixed by https://github.com/MHKiT-Software/MHKiT-Python/pull/104