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

MethodNotFound error #11

Closed
bolliger32 opened this issue Nov 28, 2015 · 4 comments
Closed

MethodNotFound error #11

bolliger32 opened this issue Nov 28, 2015 · 4 comments

Comments

@bolliger32
Copy link

I'm trying to run one of the quick sample codes from the Climate Viewer:

from climata.snotel import RegionDailyDataIO

data = RegionDailyDataIO(
start_date="2013-01-01",
end_date="2013-12-31",
basin="18010202",
parameter="SNWD",
)

I'm getting the following MethodNotFound error:
MethodNotFound: Method not found: 'AwdbWebService.AwdbWebServiceImplPort.nonzero'

Any thoughts here? Not sure if this is a bug or just user error, b/c I can't find any documentation.

@sheppard
Copy link
Member

This looks like it might have been a temporary issue with the NRCS web service. Can you try it again?

@bolliger32
Copy link
Author

Interesting. I just tried again and unfortunately received the same error. Sorry I can't provide much more insight as I'm not too familiar with web services. Let me know if you have any other thoughts and I'm happy to try them. I'm using climata 0.4.0 and suds 0.6

@sheppard
Copy link
Member

sheppard commented Dec 3, 2015

Ok, I was able to reproduce this in Python 2 (my previous check was with Python 3). It turns out it wasn't a web service issue, but rather an interesting interpretation of "not":

if not _server:
    _server = Client(...)

My intended interpretation: "if the server connection hasn't been initalized yet". However, Suds+Python 2 interpreted this to also mean "if the server object evaluates to a non-truthy value". This is what triggered the call to __nonzero__ which doesn't exist. I fixed the issue by changing it to if _server is None.

I also added a unit test for SNOTEL to the repository to ensure both Python versions are tested.

@bolliger32
Copy link
Author

aha! thank you for investigating this. I've had problems with "if not" for the same reasons before.

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