Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test errors #13

Open
pradal opened this issue May 28, 2022 · 2 comments
Open

Test errors #13

pradal opened this issue May 28, 2022 · 2 comments
Assignees

Comments

@pradal
Copy link
Contributor

pradal commented May 28, 2022

All test fail:

from weatherdata.ipm import WeatherDataHub, WeatherDataSource
wdh= WeatherDataHub()
wdh.list_resources.name
In [4]: wdh.list_resources.name
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [4], in <cell line: 1>()
----> 1 wdh.list_resources.name

File ~/devlp/git/weatherdata/src/weatherdata/ipm.py:72, in WeatherDataHub.list_resources(self)
     61 """ display a dataframe of list of resources with their description 
     62 
     63 Returns
   (...)
     66     name and description of available weatherdatasource on IPM service
     67 """  
     68 # if local:
     69 #     return list(self.local_sources)
     70     
     71 # else: 
---> 72 df= pandas.DataFrame(self.__resources__).T.reset_index()
     73 df.rename({"index":"name"},inplace=True)
     74 return df[["name","description","parameters"]]

File ~/devlp/git/weatherdata/src/weatherdata/ipm.py:52, in WeatherDataHub.__resources__(self)
     48 @property
     49 def __resources__(self):
     51     if self.sources is None:
---> 52         self.sources= self.ipm.get_weatherdatasource()
     54     if len(self.local_sources)>0:
     55         self.sources.append(self.local_sources)

File ~/devlp/git/agroservices/src/agroservices/ipm.py:424, in IPM.get_weatherdatasource(self)
    416 res = self.services.http_get(
    417     "wx/rest/weatherdatasource", 
    418     frmt='json',
    419     headers=self.services.get_headers(content='json'),
    420     params={'callback':self.callback}
    421     )
    423 for r in res:
--> 424     r['spatial']['geoJSON']=json.loads(r['spatial']['geoJSON'])
    426 return res
@mlabadie
Copy link
Member

mlabadie commented May 28, 2022

@pradal
this is really strange. On my computer, all tests run with pytest. I only get warnings. Did you do the test branch merge correctly?

image

@pradal
Copy link
Contributor Author

pradal commented May 28, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants