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

USGS and NOAA data requests not working #72

Closed Matthew-Boyd closed 2 years ago

Matthew-Boyd commented 2 years ago

Requesting data from the USGS and NOAA servers via request_usgs_data() and request_noaa_data() almost always fail with the error:

Python Error: SSLError: HTTPSConnectionPool(host='waterservices.usgs.gov', port=443): Max retries exceeded with url: /nwis/dv/?format=json&sites=15515500&startDT=2009-08-01&endDT=2009-08-10&statCd=00003&parameterCd=00060&siteStatus=all (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))

On rare occasions the same error occurs when running just the wrapped Python call in MHKiT-Python. This has been tested from Windows 10.

Matthew-Boyd commented 2 years ago

@rpauly18 I have researched and debugged this for a while now with no success, while digging fairly deep into the various SSL libraries and their potential path issues and MATLAB conflicts. Do you see an issue with requesting the data directly from MATLAB and not going through the Python calls? It would seem fairly low risk or duplicated code.

rpauly18 commented 2 years ago

I have no problem with re-working the code to cut our Python. This is a known issue that happens on the Python side as well, as you note. Generally It resolves itself by re-running the code. Interesting that it happens more frequently on the Matlab side.