Quantcast
Channel: Planet Python
Viewing all articles
Browse latest Browse all 23124

Python Bytes: #275 Airspeed velocity of an unladen astropy

$
0
0
<p><strong>Watch the live stream:</strong></p> <a href='https://www.youtube.com/watch?v=zrtdG-VsblU' style='font-weight: bold;'>Watch on YouTube</a><br> <br> <p><strong>About the show</strong></p> <p>Sponsored by <a href="https://pythonbytes.fm/foundershub"><strong>Microsoft for Startups Founders Hub</strong></a>.</p> <p>Special guest: <a href="https://twitter.com/emilyemorehouse"><strong>Emily Morehouse-Valcarcel</strong></a></p> <p><strong>Michael #1:</strong> <a href="https://fredrikaverpil.github.io/2017/06/20/async-and-await-with-subprocesses/"><strong>Async and await with subprocesses</strong></a></p> <ul> <li>by <a href="https://fredrikaverpil.github.io/"><strong>Fredrik Averpil</strong></a></li> <li>People know I do all sorts of stuff with async</li> <li>Lots of cool async things are not necessarily built into Python, but our instead third-party packages</li> <li>E.g. files via <a href="https://www.twilio.com/blog/working-with-files-asynchronously-in-python-using-aiofiles-and-asyncio">aiofiles</a></li> <li>But asyncio has <code>asyncio.create_subprocess_exec</code> </li> <li>Fredrik’s article has some nice examples</li> <li>I started using this for mp3 uploads and behind the scenes processing for us</li> </ul> <p><strong>Brian #2:</strong> <a href="https://typesplainer.herokuapp.com/"><strong>Typesplainer</strong></a></p> <ul> <li>Arian Mollik Wasi, <a href="https://twitter.com/wasi_master">@wasi_master</a> </li> <li>Suggested by Will McGugan</li> <li>Now released <a href="https://twitter.com/wasi_master/status/1503103913070764032">a vscode extension</a> for that! Available on vscode as typesplainer</li> </ul> <p><strong>Emily</strong> <strong>#3:</strong> <a href="https://ibis-project.org/ibis-for-sql-programmers/"><strong>Ibis Project</strong></a></p> <ul> <li>via <a href="https://twitter.com/marlene_zw">Marlene Mhangami</a></li> <li>“Productivity-centric Python data analysis framework for SQL engines and Hadoop” focused on: <ul> <li>Type safety</li> <li>Expressiveness</li> <li>Composability</li> <li>Familiarity</li> </ul></li> <li>Marlene wrote an excellent <a href="https://marlenemhangami.com/an-introduction-to-ibis-for-python-programmers">blog post</a> as an introduction</li> <li>Works with tons of different <a href="https://ibis-project.org/backends/">backends</a>, either directly or via compilation <ul> <li>Depending on the backend, it actually uses <a href="https://www.sqlalchemy.org/">SQLAlchemy</a> under the hood</li> </ul></li> <li>There’s a ton of options for interacting with a SQL database from Python, but Ibis has some interesting features geared towards performance and analyzing large sets of data. It’s a great tool for simple projects, but an excellent tool for anything data science related since it plays so nicely with things like pandas</li> </ul> <p><strong>Michael #4:</strong> <a href="https://asv.readthedocs.io/en/stable/"><strong>ASV</strong></a></p> <ul> <li>via Will McGugan</li> <li>AirSpeed Velocity (asv) is a tool for benchmarking Python packages over their lifetime.</li> <li>Runtime, memory consumption and even custom-computed values may be tracked.</li> <li>See <a href="https://asv.readthedocs.io/en/stable/using.html">quickstart</a></li> <li>Example of <a href="https://asv.readthedocs.io/en/stable/using.htmlhttps://www.astropy.org/astropy-benchmarks/">astropy here</a>.</li> <li><a href="https://asv.readthedocs.io/en/stable/using.html#finding-a-commit-that-produces-a-large-regression">Finding a commit that produces a large regression</a></li> </ul> <p><strong>Brian #5:</strong> <a href="https://github.com/tonybaloney/perflint"><strong>perflint</strong></a></p> <ul> <li>Anthony Shaw</li> <li>pylint extension for performance anti patterns <ul> <li>curious why a pylint extension and not a flake8 plugin.</li> </ul></li> <li>I think the normal advice of “beware premature optimization” is good advice.</li> <li>But also, having a linter show you some code habits you may have that just slow things down is a nice learning tool.</li> <li>Many of these items are also not going to be the big show stopper performance problems, but they add unnecessary performance hits.</li> <li>To use this, you also have to use pylint, and that can be a bit painful to start up with, as it’s pretty picky. <ul> <li>Tried it on a tutorial project today, and it complained about any variable, or parameter under 3 characters. Seems a bit picky to me for tutorials, but probably good advice for production code.</li> <li>These are all configurable though, so you can dial back the strictness if necessary.</li> </ul></li> <li>perflint checks: <ul> <li>W8101 : Unnessecary list() on already iterable type</li> <li>W8102: Incorrect iterator method for dictionary</li> <li>W8201: Loop invariant statement (loop-invariant-statement) ←- very cool</li> <li>W8202: Global name usage in a loop (loop-invariant-global-usage)</li> <li>R8203 : Try..except blocks have a significant overhead. Avoid using them inside a loop (loop-try-except-usage).</li> <li>W8204 : Looped slicing of bytes objects is inefficient. Use a memoryview() instead (memoryview-over-bytes)</li> <li>W8205 : Importing the "%s" name directly is more efficient in this loop. (dotted-import-in-loop)</li> </ul></li> </ul> <p><strong>Emily</strong> <strong>#6:</strong> <a href="https://peps.python.org/pep-0594/"><strong>PEP 594 Acceptance</strong></a></p> <ul> <li>“Removing dead batteries from the standard library”</li> <li>Written by <a href="https://twitter.com/christianheimes">Christian Heimes</a> and <a href="https://twitter.com/brettsky">Brett Cannon</a> back in 2019, though the conversation goes back further than that <ul> <li>It’s a very thin line for modules that might still be useful to someone versus the development effort needed to maintain them. </li> </ul></li> <li>Recently accepted, targeting Python 3.11 (final release planned for October 2022, development begins in May 2021. See the <a href="https://peps.python.org/pep-0664/">full release schedule</a>)</li> <li>Deprecations will begin in 3.11 and modules won’t be fully removed until 3.13 (~October 2024)</li> <li>See the <a href="https://peps.python.org/pep-0594/#deprecated-modules">full list of deprecated modules</a></li> <li>Bonus: new <a href="https://twitter.com/brettsky/status/1501671557503983617">PEP site and theme</a>!</li> </ul> <p><strong>Extras</strong> </p> <p>Brian: Michael:</p> <p>Emily: </p> <ul> <li>Riff off of one of Brian’s topics from last week: <ul> <li>Automate your interactive rebases with <a href="https://thoughtbot.com/blog/autosquashing-git-commits">fixups and auto-squashing</a></li> </ul></li> <li><a href="https://twitter.com/di_codes/status/1503186146137980930">Cool award that The PSF just received</a></li> <li><a href="https://psfmember.org/civicrm/contribute/transact?reset=1&amp;id=37">PSF Spring Fundraiser</a></li> <li><a href="https://cut.tl/careers">Cuttlesoft is hiring</a>!</li> </ul> <p><strong>Jokes:</strong> </p> <ul> <li><a href="https://twitter.com/tenderlove/status/1498354428734107649"><em>*Changing *</em></a> (via Ruslan)</li> <li><a href="https://twitter.com/PR0GRAMMERHUM0R/status/1502962705023520776">Please hire me</a></li> </ul>

Viewing all articles
Browse latest Browse all 23124

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>