<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on Christian Krudewig</title><link>https://krudewig.dev/de/tags/python/</link><description>Recent content in Python on Christian Krudewig</description><generator>Hugo</generator><language>de-DE</language><lastBuildDate>Sat, 01 Jun 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://krudewig.dev/de/tags/python/index.xml" rel="self" type="application/rss+xml"/><item><title>Simulating Home Solar with Python</title><link>https://krudewig.dev/de/post/2024-06-01-Simulating-home-solar-installation/</link><pubDate>Sat, 01 Jun 2024 00:00:00 +0000</pubDate><guid>https://krudewig.dev/de/post/2024-06-01-Simulating-home-solar-installation/</guid><description>&lt;p&gt;&lt;strong&gt;Ever wondered if a solar installation would pay off? I&amp;rsquo;ll show you how to find out with Python.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;When we had ordered a new heat pump as replacement for the old gas boiler,&#10;we assumed that a solar installation would also be a good idea.&#10;Not only because we could make a little contribution to the rise of renewables,&#10;but with the additional electricity demand it was likely to pay off financially, too.&lt;/p&gt;</description></item><item><title>Python packaging unboxed</title><link>https://krudewig.dev/de/post/2024-02-23-python-packaging-from-imports-to-docker/</link><pubDate>Fri, 23 Feb 2024 00:00:00 +0000</pubDate><guid>https://krudewig.dev/de/post/2024-02-23-python-packaging-from-imports-to-docker/</guid><description>&lt;p&gt;&lt;strong&gt;Python packaging has a reputation for being confusing. With tools like setuptools, pip, poetry, flit, pdm, and twine, it&amp;rsquo;s easy to get lost. This post demystifies the packaging workflow from the import system to Docker deployments.&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Python 3.11 thirty percent faster indeed</title><link>https://krudewig.dev/de/post/2022-11-10-python-311/</link><pubDate>Thu, 10 Nov 2022 00:00:00 +0000</pubDate><guid>https://krudewig.dev/de/post/2022-11-10-python-311/</guid><description>&lt;p&gt;&lt;strong&gt;Two weeks back the new version 3.11 of Python was released with the promise of a significant speedup.&#10;Let&amp;rsquo;s test it!&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;For fun, I&amp;rsquo;m maintaining a &lt;a href="https://github.com/chr1st1ank/speeding-up-python"&gt;small benchmarking project&lt;/a&gt;.&#10;There, a couple of computational tasks are solved with Python and with different speedup methods&#10;such as Cython, Numba and C extensions written in C++ or Rust. Main purpose for me was to figure&#10;out which method has the greatest effect and how good the user experience is.&lt;/p&gt;</description></item><item><title>Locating memory leaks in a Python service – Part 2: C-Extensions</title><link>https://krudewig.dev/de/post/2022-09-12-locating-memory-leaks-in-services-part2/</link><pubDate>Mon, 12 Sep 2022 00:00:00 +0000</pubDate><guid>https://krudewig.dev/de/post/2022-09-12-locating-memory-leaks-in-services-part2/</guid><description>&lt;p&gt;&lt;strong&gt;Building up on last week&amp;rsquo;s issue about diagnosing memory leaks in Python, this blog post will show how to identify memory issues in native extension modules.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;From [the first posting]({% post_url 2022-09-04-locating-memory-leaks-in-services-part1 %})&#10;we have the tools to clearly diagnose a memory leak in pure Python. So let&amp;rsquo;s proceed to the next level and add some native code to the picture.&#10;It is one of the strengths of Python how easy it can be extended with compiled code e.g. in C, by so called &amp;ldquo;extension modules&amp;rdquo;. This is a key factor which made Python the first choice for data science: The heavy number crunching can be done by optimized routines and the program logic is written in the high-level Python language.&lt;/p&gt;</description></item><item><title>Locating memory leaks in a Python service – Part 1: Pure Python</title><link>https://krudewig.dev/de/post/2022-09-04-locating-memory-leaks-in-services-part1/</link><pubDate>Sun, 04 Sep 2022 00:00:00 +0000</pubDate><guid>https://krudewig.dev/de/post/2022-09-04-locating-memory-leaks-in-services-part1/</guid><description>&lt;p&gt;&lt;strong&gt;Even in a garbage-collected language like Python it is possible to create applications with memory leaks. This means that the program keeps memory reserved vor variables which are no longer needed. So the memory could be freed, but it isn&amp;rsquo;t. Especially in long-running applications this can lead to a huge memory consumption over time, up to a point where the hardware limit is reached.&#10;In a series of two blog posts I&amp;rsquo;ll show how to debug such memory issues in a Python web service.&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Machine Learning Models Light as a Feather with ONNX</title><link>https://krudewig.dev/de/post/2021-09-09-Machine-Learning-Models-Light-as-a-Feather/</link><pubDate>Thu, 09 Sep 2021 00:00:00 +0000</pubDate><guid>https://krudewig.dev/de/post/2021-09-09-Machine-Learning-Models-Light-as-a-Feather/</guid><description>&lt;p&gt;&lt;strong&gt;Have you ever faced the challenge to create a fast and lightweight web service out of your machine learning model? In this case you are maybe annoyed by the overhead introduced by all the machine learning dependencies from the training environment that you also need to carry over to the production environment. This post tests an approach which claims to make it possible to leave most of this behind and share the blank model in a way that it can even be used across multiple programming languages.&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>The Throughput Paradox – Why a Machine Learning API Needs Load Shedding</title><link>https://krudewig.dev/de/post/2021-05-02-throughput-paradox/</link><pubDate>Sun, 02 May 2021 00:00:00 +0000</pubDate><guid>https://krudewig.dev/de/post/2021-05-02-throughput-paradox/</guid><description>&lt;p&gt;&lt;strong&gt;Especially compute-intensive services like a machine learning inference API can heavily suffer from queueing effects.&lt;/strong&gt;&#10;&lt;strong&gt;I will demonstrate this with response time measurements of small demo service and show how to deal with this using load-shedding&lt;/strong&gt;&lt;/p&gt;</description></item></channel></rss>