cormorack / yodapy

Your Ocean Data Access in Python
https://cormorack.github.io/yodapy/
MIT License
9 stars 10 forks source link

ooi.view_site() warning message #94

Open robfatland opened 5 years ago

robfatland commented 5 years ago

This code

from yodapy.datasources import OOI
ooi = OOI()
ooi.view_sites()

gives this warning...

/opt/conda/lib/python3.6/site-packages/grequests.py:21: RuntimeWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. Please monkey-patch earlier.
  curious_george.patch_all(thread=False, select=False)
100% |###################################################|Time elapsed: 0:00:12

in the Port Cormorack Jupyter Hub

lsetiawan commented 5 years ago

Thanks!

robfatland commented 5 years ago

Source repo http://github.com/robfatland/synoptic and sub-folder 'rco' usying notebook yodapy.ipynb. Testing on the pangeo/NASA JupyterHub.

Revisiting this: It appears the "dataframe can't be evaluated" issue is still present even with the git+https://github.com/cormorack/yodapy.git install... so I broke this down a bit more from ooi.sites; ooi.instruments; ooi.sites after install and declaring ooi=OOI()

import yodapy
from yodapy.datasources import OOI
print(yodapy.__version__)

0.2.4-beta

ooi=OOI()
ooi.sites

-> gives "Insecure Request Warning" followed by a proper table and then more such warnings

ooi.instruments

works properly, no errors, no warnings, just the table; then

ooi.sites

produces a lot of grief:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-9-aa8629e4a080> in <module>
----> 1 ooi.sites

/srv/conda/envs/notebook/lib/python3.6/site-packages/yodapy/datasources/ooi/OOI.py in sites(self)
    165     def sites(self):
    166         """ Returns the OOI sites """
--> 167         if not isinstance(self._sites, pd.DataFrame):
    168             try:
    169                 self._sites = pd.read_csv(self._OOI_PORTAL_SITES).dropna(subset=[  # noqa

/srv/conda/envs/notebook/lib/python3.6/site-packages/pandas/core/generic.py in __nonzero__(self)
   1476         raise ValueError("The truth value of a {0} is ambiguous. "
   1477                          "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
-> 1478                          .format(self.__class__.__name__))
   1479 
   1480     __bool__ = __nonzero__

ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
lsetiawan commented 5 years ago

@robfatland I am not getting the errors you see. Can I have access to the jupyterhub you're using...?