-
Notifications
You must be signed in to change notification settings - Fork 44
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
kiva tutorial #676
kiva tutorial #676
Conversation
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.
This is off to a solid start.
What do you think about adding some structure to this so that components line resistors and meters are drawn by functions? The whole diagram drawing could then fit in a small "paragraph" of code which gives a high level overview of what is drawn and the functions contain the nitty-gritty details. That would also be a bit closer to how kiva code exists in the wild, at least in the context of Chaco tools and plot renderers.
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.
🥇I'm really happy with this overall. Still have a bit of feedback but it's quite close now.
gc.save("images/step_45.png") | ||
|
||
# step 6) switch | ||
# white out the wire |
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.
"Whiting out" like this will work on pixel-based backends, but may not work on postscript/pdf backend. Check those to see what you get.
As a style guide, it's generally better to draw only the lines you want.
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.
That makes sense, I had only considered the performance issue john mentioned, not that it might not even work. I don't think the example will work at all with postscript/pdf because we use draw_marker_at_points
. Nonetheless, it might be worth adding a sentence saying not only that we generally wouldn't want to do this for performance reasons, but also that it may not even produce correct results if using a different backend.
I believe the advanced_tutorial.py
should work, although I still need to try running it with different backends to make sure
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.
Very nice!
A couple of minor nits from me, and you might go over it with an eye to where you might be able to tighten up the prose, but particularly the advanced example was pretty much exactly what I had in mind.
closes #622
Adds a tutorial for drawing this: