Planet London Python

October 11, 2014

Nicholas Tollervey

PyconUK 2014 Round Up

PyconUK 2014 Round Up

Saturday 11th October (5:30PM)

(This write-up is a bit late: I've been ill and we've recently had a death in the family.)

This year was the biggest ever PyCon UK conference - a community organised event for users of the Python programming language. Just under 500 tickets were booked including 45 for teachers and 75 for kids. We couldn't have done it without the support of the sponsors, especially Bank of America, the Python Software Foundation and Raspberry Pi Foundation without whom the education track would not have been possible.

For me, the person responsible for the education track, I had most fun working with the teachers and kids who turned up. I also seemed to be giving far too many presentations (four in total during PyCon UK). I also realised, due to circumstances beyond my control, that I have many kind and generous friends in the Python community and that when disaster strikes people step up and make "stuff" happen even at 4 o'clock in the morning!

It was a privilege to watch several masters at work during the education track:

The education team from the RaspberryPi Foundation are insane, inspiring and intelligent in equal measure - if you can attend one of their free Picademy events for teachers than you're in for a real treat. It's easy to sound bombastic about the work of the Raspberry Pi Foundation (so allow me to demonstrate): the pedagogical forces that they unleash are both unique (because who'd have thought such a small, cheap and "raw" piece of kit would result in such a huge amount of interest) and important (because the Raspberry Pi liberates computing education from the boring sad little world of locked down RM boxes, presentations and spreadsheets). That they are a UK based effort makes it all the more important that we, the UK's Python community, give them as much of our support as possible.

It was also wonderful to see Martin O'Hanlon work his Minecraft magic on both teachers and students. Martin introduces Python programming via only a handful of very simple Minecraft related concepts that he uses to build some amazing things within the Minecraft world (his in-game house that follows you around was a big hit with the kids). He's so good at this sort of thing that he's written a book on this very subject (that's bound to be a big hit with young programmers and teachers alike - what an inspiring textbook that would be). In case you can't wait for its publication you can grab his PyCon UK resources here.

(Here's a photo of Martin and fellow author Carrie Anne looking like the cartoon versions of themselves used in their books.)

I was especially pleased to welcome John Pinkney and his NAO robots. I met John at a CAS hub meeting over the summer where he described how he uses robots as a catalyst for all sorts of interesting educational activities. The visual programming tool used to interact with the robots strikes me as particularly child-friendly. Interestingly the code behind the visual building blocks used to describe the robot's behaviour is all written in Python (and thus handily gave me an excuse to invite John to PyCon UK). John gave two workshops (one for teachers, the other for kids) and the fact that he managed to keep both groups in rapt awe for an hour is testament to both his skill as a teacher and the "charisma" of the robots. We also ran a robot code dojo at which we let the developers play with the bots. I gave a quick overview of the Python API to the assembled developers and my slides can be found here.

Dave Ames also deserves a special mention for leading a couple of excellent workshops on using the PyGame project. Dave's workshops involved taking an existing (yet broken / unfinished) game and modifying the code to fix things and make it your own. I really like this approach since it gives students an existing base to work from. It also makes sure that beginner coders begin the think about debugging their own and other people's code (for which we provided all attendees with a PyCon UK Debug Duck. This rather excellent state of affairs is wonderfully encapsulated in the following video from the kids' day:

Alan O'Donohoe, Ben Smith and Vikki Dodd are three teachers without which the education track would not function. Alan's pragmatic encouragement when disaster struck (twice) was invaluable and Ben and Vikki made innumerable contributions throughout the event that meant I was regularly thinking, "Oh wow, [Ben/Vikki] has already done that." That's what I mean when I say that people "step up".

It was an immense privilege and a lot of fun to work with Naomi Ceder (founder of the PyCon US Education Summit) on our own small contribution to the education track: introducing object oriented programming to teachers through the medium of cows. I especially enjoyed the tag wrestling modus operandi of our talk. I'll leave you to guess which one of us was Big Daddy or Giant Haystacks (a UK specific cultural reference I'm sure Naomi will be delighted to quickly forget). In any case, both teachers and developers got stuck into our Parrot related exercise (as the picture below shows):

Finally, Carrie Anne gave a stonking keynote address to the whole conference on Sunday afternoon. I've heard far too many boring-yet-worthy-important-people-talking-about-boring-yet-worthy-important-things as conference keynotes in my time. Happily it soon became apparent that Carrie Anne's keynote was definitely not a boring-yet-worthy talk about matters of an educational nature. If you want to actually know what Carrie Anne said you should invite her to your conference to give the keynote. It would be definitely worth it: evidence via social networks suggests hers was the warmest received and most highly regarded keynote of this year's conference.

Other wonderful aspects of this year's PyCon UK included the beer for the conference meal (brewed using Python), the charity cheese shop that raised several hundred pounds for a local children's hospice and the inevitable silliness during the lightning talks.

Finally, it was a pleasure to catch up with Van Lindberg (chair of the Python Software Foundation). I'll leave what we discussed for a separate blog post but, in the meantime, you should all totally sign up to be members of the PSF here. Why? Because,

The mission of the Python Software Foundation is to promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers.

We've already started planning next year's conference. If you can think of any ways in which we can make it better please don't hesitate to get in touch.

October 11, 2014 05:30 PM

Ian Ozsvald

My Keynote at PyConIreland 2014 – “The Real Unsolved Problems in Data Science”

I’ve just given the opening keynote here at PyConIreland 2014 – many thanks to the organisers for letting me get on stage. This is based on 15 years experience running my own consultancies in Data Science and Artificial Intelligence. (Small note  – with the pic below James mis-tweeted ‘sexist’ instead of ‘sexiest’ (from my opening slide) <sigh>)

 

The slides for “The Real Unsolved Problems in Data Science” are available on speakerdeck, I’ll embed them with the video here when it is available. I wrote this for the more engineering-focused PyConIreland audience. These are the high level points, I did rather fill my hour:

  • Data Science is driven by companies needing new differentiation tactics (not by ‘big data’)
  • Problem 1 – People asking for too-complex stuff that’s not really feasible (‘magic’)
  • Problem 2 – Lack of statistical education for engineers – do go statistics courses!
  • Problem 3 – Dirty data is a huge cost – think about doing a Data Audit
  • Problem 4 – We need higher-level data cleaning APIs that understand human-level data (rather than numbers, strings and bools!) – much work is required here
  • Problem 5 – Visualisation with Python still hard and clunky, has a poor on-boarding experience for new users (and R does well here)
  • Problem 6 – Lots of go-faster/high-performance options but really Python should ‘handle this for us’ (and yes, I have written a book on this)
  • Problem 7 – Lack of shared vocabulary for statisticians & engineers
  • Problem 8 – Heterogeneous storage world is mostly non-Python (at least for high performance work), we need a “LAMP Stack for Data Science”
  • Problem 9 – Collaboration is still painful (but the IPython Notebook is improving this)
  • Problem 10 – We’re still building the same tools over and over (but the Notebook makes it easier) - we could do with some shared tools here
  • Linked Open Data is very useful and you should contribute to it and consume it
  • Our common tooling in Python is very powerful – please join numpy and scipy projects and contribute to the core
  • I noted a few times that the Python science stack works in Python 3 so you should just use Python 3.4+ for all new projects
  • PyData/EuroSciPy/SciPy/DataKind meetups are a great way to get involved
  • We need a “Design Patterns for Data Science with Python” book (and I want to know what you want to learn)

From discussions afterwards it seems that my message “you need clean data to do neat data science stuff” was well received. I’m certainly not the only person in the room battling with Unicode foolishness (not in Python of course as Python 3+ solves the Unicode problem :-).


Ian applies Data Science as an AI/Data Scientist for companies in ModelInsight, sign-up for Data Science tutorials in London. Historically Ian ran Mor Consulting. He also founded the image and text annotation API Annotate.io, co-authored SocialTies, programs Python, authored The Screencasting Handbook, lives in London and is a consumer of fine coffees.

by Ian at October 11, 2014 03:18 PM

October 08, 2014

Peter Bengtsson

Premailer on Python 3

Premailer is probably my most successful open source project in recent years. I base that on the fact that 25 different people have committed to it.

Today I merged a monster PR by Michael Jason Smith of OnlineGroups.net.

What it does is basically that it makes premailer work in Python 3, PyPy and Python 2.6. Check out the tox.ini file. Test coverage is still 100%.

If you look at the patch the core of the change is actually surprisingly little. The majority of the "secret sauce" is basically a bunch of import statements which are split by if sys.version_info >= (3, ): and some various minor changes around encoding UTF-8. The rest of the changes are basically test sit-ups.

A really interesting thing that hit us was that the code had assumptions about the order of things. Basically the tests assumed the the order of certain things in the resulting output was predictable even though it was done using a dict. dicts are famously unreliable in terms of the order you get things out and it's meant to be like that and it's a design choice. The reason it worked till now is not only luck but quite amazing.

Anyway, check it out. Now that we have a tox.ini file it should become much easier to run tests which I hope means patches will be better checked as they come in.

October 08, 2014 09:00 PM