atlas news
    
Ned Batchelder
18  novembre     12h47
Autism Adulthood, 3rd edition
Ned Batchelder    Today is the publication of the third edition of Autism Adulthood: Insights and Creative Strategies for a Fulfilling Life. It’s my wife Susan’s book collecting stories and experiences from people all along the autism spectrum, from the self-diagnosed to the profound.The book includes dozens of...
16  novembre     12h55
Why your mock breaks later
Ned Batchelder    In Why your mock doesn’t work I explained this rule of mocking:Mock where the object is used, not where it’s defined.That blog post explained why that rule was important: often a mock doesn’t work at all if you do it wrong. But in some cases, the mock will work even if you don’t follow this rule,...
09  novembre     23h27
Three releases, one new organization
Ned Batchelder    It’s been a busy, bumpy week with coverage.py. Some things did not go smoothly, and I didn’t handle everything as well as I could have.It started with trying to fix issue 2064 about conflicts between the sysmon measurement core and a concurrency setting.To measure your code, coverage.py needs to...
30  octobre     10h23
Side project advice
Ned Batchelder    Last night was a Boston Python project night where I had a good conversation with a few people that was mostly guided by questions from a nice guy named Mark.How to write nice code in researchMark works in research and made the classic observation that research code is often messy, and asked about...
21  octobre     11h14
Natural cubics, circular Simplex
Ned Batchelder    This post continues where Hobby Hilbert Simplex left off. If you haven’t read it yet, start there. It explains the basics of Hobby curves, Hilbert sorting and Simplex noise that I’m using.AnimationTo animate one of our drawings, instead of considering 40 lines, we’ll think about 140 lines. The...
26  septembre     12h14
Hobby Hilbert Simplex
Ned Batchelder    I saw a generative art piece I liked and wanted to learn how it was made. Starting with the artist’s Kotlin code, I dug into three new algorithms, hacked together some Python code, experimented with alternatives, and learned a lot. Now I can explain it to you.It all started with this post by aBe on...
22  septembre     16h04
Testing is better than DSA
Ned Batchelder    I see new learners asking about DSA a lot. Data Structures and Algorithms are of course important: considered broadly, they are the two ingredients that make up all programs. But in my opinion, DSA as an abstract field of study is over-emphasized.I understand why people focus on DSA: it’s a...
24  août     21h28
Finding unneeded pragmas
Ned Batchelder    To answer a long-standing coverage.py feature request, I threw together an experiment: a tool to identify lines that have been excluded from coverage, but which were actually executed.The program is a standalone file in the coverage.py repo. It is unsupported. I’d like people to try it to see what...
13  août     10h14
Starting with pytest’s parametrize
Ned Batchelder    Writing tests can be difficult and repetitive. Pytest has a feature called parametrize that can make it reduce duplication, but it can be hard to understand if you are new to the testing world. It’s not as complicated as it seems.Let’s say you have a function called add nums() that adds up a list...
28  juillet     16h04
Coverage.py regex pragmas
Ned Batchelder    Coverage.py lets you indicate code to exclude from measurement by adding comments to your Python files. But coverage implements them differently than other similar tools. Rather than having fixed syntax for these comments, they are defined using regexes that you can change or add to. This has been...