Siddharth Bhat

### A weblog of sorts

GSoC VisPy Week 6
Jul 24, 2015

As usual, here’s the update for week 6. Let’s get down to it!

## SceneGraph Overhaul

The fabled PR is yet to be closed, but we have everything we need for it to be merged. There were 2 remaining (outstanding) bugs related to the Scenegraph - both stemming from the fact that not all uniforms that were being sent to the shader were being used correctly. One of these belonged to the MeshVisual, a Visual that I had ported, so tracking this down was relatively easy. The fix is waiting to be merged.

The other one was a shader compliation bug and was fixed by Eric

Once Luke Campagnola is back, these changes should get merged, and the PR should be merged as well. That would be closure to the first part of my GSoC project.

## Plotting API

The high level plotting API has been coming together - not at the pace that I would have loved to see, but it’s happening. I’ve been porting the ColorBarVisual so it can be used with a very simple, direct API. I’d hit some snags on text rendering, but it was resolved with Eric’s help.

Text rendering was messed up initially, as my code wasn’t respecting coordinate systems. I rewrote the buggy code I’d written to take the right coordinate systems into account.

Another bug arose from the problem that I wasn’t using text anchors right. I’d inverted what a top anchor and a bottom anchor does in my head. The top anchor makes sure that all text is placed below it, while the bottom anchor pushes text above itself. Once that was fixed, text rendered properly.

However, There’s still an inconsistency. I don’t fully understand the way anchors interact with transforms. The above stated solution works under translation / scaling, but breaks under rotation. Clearly, there are gaps in my knowledge. I’ll be spending time fixing this, but I’m reasonably confident that it shouldn’t take too much time.

There was also a bug related to bounding box computation that was caught in the same PR, which I’ve highlighted.

## Inetellisense / Autocomplete

There’s a module in VisPy called vispy.scene.visuals whose members are generated by traversing another module (vispy.visuals) and then wrapping (“decorating”, for the Design Patterns enthusiasts) the members of vispy.visuals.

Since this is done at run-time (to be more explicit, this happens when the module is initialized), no IDE / REPL was able to access this information. This caused autocomplete for vispy.scene.visuals to never work.

After deliberating, we decided to unroll the loop and hand-wrap the members, so that autocomplete would work.

This is a very interesting trade-off, where we’re exchanging code compactness / DRY principles for usability.

Here’s the pull request waiting to be merged.

## Odds and Ends

I’ve been meaning to improve the main github page of VisPy, so it provides more context and development information to developers. There’s an open PR that I want to get merged by the end of this week.

That’s all for now! Next week should see the ColorBar integrated into vispy.plot. I’ll hopefully be working on layout using Cassowary by this time next week, but that’s just a peek into the future :). Adios!

Back to posts