-
Notifications
You must be signed in to change notification settings - Fork 271
Add type hints for plot #833
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
Conversation
I think you've got |
And |
Looking through the code it looks like it's a list of lists of floats (look at |
Yes, but it could very well be a list of list of ints in another case, right? |
Maybe |
Looks like you have some syntax errors -- check the build errors or try to import the library locally in a python interpreter. |
@marcharper The error has been showing up since the first commit on this PR, which was quite simple. and set I am assuming it has something to do with the way I import? |
@marcharper Never mind. It is an import error. I saw one of your commits on type hinting, you did something to the effect of |
The reason that See PEP328 for info on absolute versus relative imports (or Google around). That's what's going on with |
@drvinceknight @marcharper I've exhausted all the options. I've tried different ways to import And is there a way to run tests locally? The commit history on this PR is ugly. |
Yup, it's easy enough to run the tests locally, there's information about it here http://axelrod.readthedocs.io/en/latest/tutorials/contributing/strategy/running_tests.html but here's how you would run the tests on the
I've just done that locally and gotten the following error:
Which indicates that |
@drvinceknight I removed the |
It looks like that's a dynamically created class. Here's a SO question with relevant info: http://stackoverflow.com/questions/11690597/there-is-a-class-matplotlib-axes-axessubplot-but-the-module-matplotlib-axes-has Try changing it to:
|
when I do that on this branch the tests pass fine but I get a few other errors when running |
@drvinceknight Can we take this to gitter? |
This looks good to me, one final thing could you add |
902f961
to
feb72cf
Compare
…to typeHint-plot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good to me.
#808
@marcharper @drvinceknight Obviously there's a lot left. But I need to discuss before attempting any further.
The parameter
data
I think, can be list of ints, floats, etc. I think it would be better to just dodata: list
.The parameter
title
too can be an int, float, and object, list or anything. I can't think of way to assign a broad enough type for it.I think the type of the parameter
ax
ismatplotlib.axes._subplots.AxesSubplot
, although I am not sure.I don't understand what is
names
.