New Work: “Candlestick Point”

Candlestick Point”, copyright 2013 Nathan Yergler

8” x 10” linocut print, printed on Magnani Pescia

A dear friend sent me a photograph she took from Candlestick Point shortly after I made a print of a canal in Amsterdam. She noted that I’d been working with images of water, and thought of me when she looked out over the bay. I’ve been thinking about the image for a while, and started working on the actual print a couple months ago. I was finally ready to print on Wednesday.

Candlestick Point” plate, midway through carving

In this case I made a drawing from the photograph, transferred it the lino plate, and then starting thinking about how to actually carve things away. I was about 90% of the way done when I scanned the plate, as an experiement. I think it’s pretty interesting to look at, too. The rocks, in particular, are something new for me. It’s taken me a while to ease into using parallel lines like that to indicate shading and shape. It’s a technique I’ve seen others use very effectively, and I’m excited to develop it for my own work.

author:Nathan Yergler
category:printmaking
tags:linocut
comments:

“Effective Django” at OSCON

I’m going to be presenting my introductory Django tutorial, Effective Django at OSCON later this month. If you’re going to be at OSCON and haven’t selected your tutorials yet, or just think a trip to Portland, Oregon sounds nifty, there’s still time to sign up. You can find the details on the OSCON tutorial page.

In preparation for that I’ve been continuing to work on the content. I presented the tutorial to some of the Eventbrite engineering team a couple weeks ago, and thier feedback was very useful. In response, I’ve made a few changes. Specifically, I split up the Views chapter with a brief interlude on static assets and template inheritance. It’s something that I didn’t cover the first time around, but based on the questions, I think some guidance is useful.

The revisions for OSCON also include updating the sample code repository that goes with the tutorial. I developed a tool, Tut, to help manage these stacked branches, and while making changes to early parts of the tutorial code, I realized it still requires significant work to really be a good workflow tool. One of the most important requirements for Tut is the ability to manage an ordered series of “checkpoints” and move between them.

When I started working on the sample code this time around, I was on a new laptop, so I had to start from a fresh clone. This was revealing and frustrating. I discovered Tut assumed all the branches were already local, which they obviously aren’t with a fresh clone. Worse, the git magic I was trying to use to get the branch list in the “right” order was pretty fragile, and broke when I tried to lean on it at all.

This screenshot shows a common editing case. My intention is to manage each step, or checkpoint, in the tutorial as a branch. Each step builds on the previous one, so if I make a change to something early in the tutorial, I just need to merge the branches “forward” until I get to master. In this example I’ve checked out the contact_form_test branch and added a new commit. In order for Tut to help me merge that forward, I need to be able to generate the list of steps.

The correct order here (last step first) is master, custom_form_rendering, contact_form_test, edit_addresses, address_model, confirm_contact_email, contact_detail_view. But you can’t get that out with either date or topo ordering. You really need to walk back from master, looking for branches (head refs), and at each step look for any head refs reachable (as children) that you haven’t already seen. I haven’t figured out how to do that yet with git plumbing commands, so for the time being I’m just using a text file to record the correct order. [1]

I’m really excited about presenting Effective Django at OSCON, and appreciate the feedback and suggestions from everyone.

[1]I contemplated just using a text file in the repo as the solution, but realized that this has its own issues: if it’s under version control as well, then what’s the “right” version to look at when you’re in a branch? That branch’s? Master’s? It’s not clear to me.
author:Nathan Yergler
category:Effective Django
tags:talks, effective django, python, tut,
comments:

New Work: “Welcome Home”

Welcome Home”, copyright 2013 Nathan Yergler

5” x 7” two plate linocut print, printed on Rives BFK

Richard and I just moved from South Beach back to the area I lived in when I first moved to San Francisco, and we first started dating. We’ve been in the new place for a couple weeks now, and it already feels like we’re more in the city than we were before: closer to friends, closer to things to do in the evenings, and more in a neighborhood. I was in the studio on a Wednesday evening, just days before we moved, and I wanted to commemorate our new home. This is what came out. It’s not a literal drawing of the front gate and building, but it sort of takes the elements and rearranges them a bit. It’s one of the first things I’ve done where I just drew directly on the plate before carving, instead of doing a drawing first. Of course, I forgot to reverse it, so I still wound up tracing what I’d drawn, cleaning off the plates, and then re-drawing it. Sigh.

author:Nathan Yergler
category:printmaking
tags:linocut, multiplate
comments:

Hieroglyph 0.5.5

As I mentioned last month, there were a few improvements to Hieroglyph sitting in the master branch, awaiting a release. Now that PyCon is over, I’ve cut the Hieroglyph 0.5.5 release. This is primarily a bug fix release, and it feels good to fix a bunch of issues that I discovered as I used Hieroglyph to develop and present Effective Django.

In addition to fixing half a dozen bugs, I also reviewed and revised almost all of the documentation for this release. Asheesh used Hieroglyph for his talk on web scraping at PyCon last week, and it was really interesting to get feedback from him about what worked and what was confusing. As a result, there’s a new Getting Started guide. There’s still work to be done, in particular in the Advanced Usage document; hopefully that will get rewritten and expanded soon.

Asheesh’s feedback demonstrated to me how little I know about why people use (or don’t) use Hieroglyph, and what’s difficult or confusing to them that I take for granted. If you’ve used Hieroglyph, thought about it and rejected it, or tried it and been frustrated, I’d like to hear about your experience. You can email me at nathan@yergler.net, or ping me on Identi.ca or Twitter: @nyergler

author:Nathan Yergler
category:hieroglyph
tags:hieroglyph, sphinx, rst
comments:

Tut: Easier Tutorial Documentation with Sphinx

The PyCon sessions wound down today, so I’m finally coming up for air. This year I presented Effective Django, which evolved out of last year’s PyCon presentation and my PyOhio 2012 talk. As I prepared my PyCon talk last year, I started building Hieroglyph, which makes it easy to build HTML-based slides using Sphinx. This year I was preparing a different kind of presentation: a tutorial. As I started putting it together, I realized that tutorial-style documents differ from the previous presentations and documentation I’ve written.

In the past I used Sphinx code blocks in my documents, and then used the doctest builder to verify that they were written correctly. With a tutorial, however, I was putting together a demo application, and wanted to include code directly from that. Sphinx has the literalinclude directive, but that wasn’t quite enough: I was using git to manage the sample source repository, so what I really wanted to do was include code from that repository at a particular point in time.

I didn’t want to just copy and paste the code from the Python source into the ReStructured Text files: I did that briefly, and found it difficult to keep in sync as my thinking about the code evolved. I’d copy and paste, write some more text, realize I needed to make a change to the sample code, and then need to go back and change it in two places.

To solve this problem, I wrote Tut. Tut is a Sphinx extension that provides a simple directive, checkpoint. The checkpoint directive switches a git repository to a particular point in time: a branch, tag, or SHA; basically anything you can git checkout.

I used tags for Effective Django, so Tut also includes a script to help manage those. The script installs a post-rewrite hook in your git repository, so that if you need to reorder your commits your tags will be moved to the new SHAs. This can be useful if you find a bug and want to change it (“back in time”), or decide to reorder parts of your tutorial source.

I think Tut is a pretty handy little extension: it allowed me to use Sphinx’s built in inclusion directives in my documents, and eliminated work that took my focus off of actually creating content. You can find it on PyPI, and the source is available on github.

author:Nathan Yergler
category:tut
tags:sphinx, rst, hieroglyph, tut
comments:

flymake with Sphinx

Working on my PyCon tutorial (next week!), I’ve been spending a lot of time in Emacs editing reStructured Text documents. I use Sphinx and Hieroglyph to generate the HTML, the slides, and the PDF from a single source, which make it easy for me to keep everything in sync. flymake is an Emacs mode that’s designed to do syntax or spell checking as you work. The name reveals its roots: in its simplest form, it just runs make for your project.

I was tired of flipping over to the shell to re-build the Sphinx project, so I decided to enable flymake for .rst files and see what happened. The flymake-allowed-file-name-masks variable has a list of regular expressions to flymake commands, so I added the following element to the list:

("\\.rst\\'" flymake-simple-make-init)

That was enough to get flymake to invoke the Makefile, and then I just needed to add the target it looks for: check-syntax. I added the following target to my Sphinx project Makefile:

check-syntax:
        $(SPHINXBUILD) -n -N -q -b html $(ALLSPHINXOPTS) $(BUILDDIR)/
        $(SPHINXBUILD) -n -N -q -b slides $(ALLSPHINXOPTS) $(BUILDDIR)/slides

In my case I’m building both HTML and Slides from the Sphinx project, and I wanted both to be updated when I changed a file in Emacs. That did it.

Now all I wanted was automagic execution of make, but to my pleasant surprise, Sphinx’s warning and error output is compatible with flymake by default. Suddenly Emacs highlighted missing targets and directives with missing arguments in red. With flymake-cursor enabled, moving my cursor over one of those red lines showed me the Sphinx error below the mode-line.

There you have it: Sphinx just works with Emacs and flymake, you just need to turn it on.

author:Nathan Yergler
category:python, sphinx, emacs
tags:none
comments:

Hieroglyph Improvements

If you’re using Hieroglyph for generating slides with Sphinx, you may want to use the version in git rather than the release. A few things have landed there recently:

  • tjadevries contributed fixes for incremental slides in Chrome.

    It seems that a recent change in Chrome caused the incremental slide Javascript, which originated in the Google HTML5 Slides project, to stop working. master has a fix for that.

  • Proper pruning when autoslides are disabled.

    If you have autoslides turned off in a document, Hieroglyph will now properly prune the document when generating slides to only show explicit slide directives. This was broken in 0.5.

  • Fixed header sizing for slide directives.

    The slide directive allows you to specify a level attribute. This is supposed to be used for determining how to render the slide title (for example, a level of 2 should render the title as an <h2>). This was broken in 0.5, and is fixed now.

I’m using Hieroglyph for my PyCon tutorial, “Effective Django[1], but the way I’m using it is pretty different than it has been previously. The slides and HTML output differ more, so I’m not relying on automatic slide generation the way I was initially. I expect I’ll make a new release around PyCon (mid-March) when I’ve done an entire talk in this manner.

[1]I’ve started practicing my tutorial with the engineering team at Eventbrite in one hour chunks, once a week. I’ll probably post something about that experience once I have an opinion about how it works.
author:Nathan Yergler
category:hieroglyph
tags:sphinx, hieroglyph, rst
comments:

New Work: Untitled (Bay Bridge)

Untitled (Bay Bridge)”, copyright 2013, Nathan Yergler

8” x 10” four plate linocut print, printed on Rives BFK

Shortly after I finished “Golden Gate” last year I decided I needed to do a companion piece depicting the other bridge in San Francisco. I pulled the first prints of the new piece on Wednesday, and I think it’s pretty interesting how it turned out. Just like on “Golden Gate”, I tried to stretch technically. One of the plates — the sky and water — is cut in two so I could ink the gradient the way I wanted to. When carving the water I limited myself to a rounded edge carving tool to try and make it more “shimmering”. And the cables on the bridge are represented using carved lines against the sky. All three experiments feel pretty successful to me.

When I was printing “Days Getting Shorter“, I experienced how much fun printing multiplate prints can be when the registration is loose. The loose registration on those plates meant that I could focus on inking, colors, and other things, and the registration just sort of happened. The registration on this piece is much tighter, and of the five I printed I only got one where it’s really right on. But even the ones where’s it’s a little off don’t feel like failures to me: I think because there’s so much going on, it’s easy to enjoy other parts of the image. And working on tight registration is something I can practice in upcoming work.

author:Nathan Yergler
category:printmaking
tags:linocut, multiplate
comments:

“Golden Gate”, Linocut Print with Watercolor

Golden Gate”, copyright 2013, Nathan Yergler

8” x 10” linocut print with watercolor, printed on Rives BFK

In the process of working on Golden Gate last year, I printed the black plate on its own a few times. I’ve been experimenting with watercolors recently, and this is my latest attempt at mixing watercolors with my printmaking. I like how different it feels from the four plate print version. In Art & Fear, the authors talk about how every piece necessarily contains within it the seeds of what comes next: something you want to experiment with, try to do differently, take a little further. Part of what’s been so satisfying about experimenting with watercolors is that that seed is obvious, and at the same time I’m able to enjoy where I am today. That balance, appreciating what I’m doing today while at the same time feeling energized about where I’m going, is difficult and often fleeting. So I’m trying to enjoy it while it’s here.

author:Nathan Yergler
category:printmaking
tags:linocut, watercolor
comments:

“Effective Django” at PyCon 2013

PyCon (the US variation, at least), is about a month and half away, and once again I’m looking at the schedule of presentations and events and wondering how it is the community pulls it off every year. I’m also busy preparing my contribution to PyCon. This year I’m happy to be presenting a tutorial, Effective Django.

You may wonder what I mean by “Effective Django”. It’s an introduction to Django with a focus on good engineering practices. What I’ve noticed from my own experience over the years is that with all of its features and flexibility, Django makes it easy to get up and going really quickly. It also lets you write code that’s difficult to test, scale, and maintain. I have written plenty of code like that over the years, and the problem is that the real pain may come long after the initial implementation. From talking to engineers at Eventbrite and elsewhere I have learned that I’m not alone in this, so I’ve been working on documenting how to do leverage Django effectively. My goal is that attendees of the tutorial will leave feeling like they’re able to work on a Django application and identify things to do (and avoid) that will help them write code that’s cohesive, testable, and scalable.

I’m enjoying putting together the material for PyCon, and I hope that if you’re new to Django and interested in starting off on the right foot you’ll join me in Santa Clara for the afternoon.

If you’re totally new to Django and want to get a complete introduction to web apps and Django, Effective Django pairs well with Karen Rustad’s “Going from web pages to web apps“.

author:Nathan Yergler
category:pycon
tags:talks, effective django, python,
comments: