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

kiva tutorial #676

Merged
merged 9 commits into from
Mar 8, 2021
Merged

kiva tutorial #676

merged 9 commits into from
Mar 8, 2021

Conversation

aaronayres35
Copy link
Contributor

@aaronayres35 aaronayres35 commented Mar 3, 2021

closes #622

Adds a tutorial for drawing this:
tutorial

Copy link
Member

@jwiggins jwiggins left a 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.

docs/source/kiva_tutorial/tutorial.py Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.py Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.py Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.py Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.py Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.rst Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.rst Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.rst Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.rst Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.rst Outdated Show resolved Hide resolved
Copy link
Member

@jwiggins jwiggins left a 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.

docs/source/kiva_tutorial/tutorial_advanced.py Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial_advanced.py Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial_advanced.py Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial_advanced.py Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial_advanced.py Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.rst Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.rst Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.rst Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.rst Outdated Show resolved Hide resolved
docs/source/kiva_tutorial/tutorial.rst Outdated Show resolved Hide resolved
gc.save("images/step_45.png")

# step 6) switch
# white out the wire
Copy link
Contributor

@corranwebster corranwebster Mar 5, 2021

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.

Copy link
Contributor Author

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

Copy link
Contributor

@corranwebster corranwebster left a 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.

docs/source/index.rst Outdated Show resolved Hide resolved
@rahulporuri rahulporuri self-requested a review March 5, 2021 14:28
@jwiggins
Copy link
Member

jwiggins commented Mar 6, 2021

:shipit:

@aaronayres35 aaronayres35 changed the title [WIP] kiva tutorial kiva tutorial Mar 8, 2021
@aaronayres35 aaronayres35 merged commit 6ba95d4 into master Mar 8, 2021
@rahulporuri rahulporuri deleted the doc/kiva-tutorial branch March 8, 2021 13:00
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

Successfully merging this pull request may close these issues.

Kiva Tutorial
3 participants