Get familiar with Python coding styles, idioms, and get set up to do automatic linting!
Who this is for
I made this short tutorial for my fellow Insight Fellows. However, I see it as being applicable to data scientists out there.
Why code style matters
For data scientists, coding style can affect personal and team productivity. The biggest motivation for writing code with good style is maintenance. A few months down the road, you're going to be reading your own code, or you're going to hand off your code to an engineering team to be put into production. If you write code with good style, your personal and team productivity will simultaneously improve for the long run.
Remember, small wins compound into big wins!
Where it gets difficult
Code style seemingly looks like YARTF: "yet-another-requirement-to-fulfill". That's because code style requirements are picky, opinionated, and worst of all difficult to memorize. Fear not! There's a way out.
How we make it easy
We use linters! Code linters have those picky, opinionated (I will address this point later) criteria programmed into their codebase. This means they're able to automatically figure out where your code doesn't match accepted code style!
What's in this short tutorial
- A collection of Python idioms and where to use them, geared towards a data scientist's most probable use cases.
- A short walk-through on how to get set up for automatic code linting with the Atom text editor.
- An example of how to write idiomatic matplotlib code!