Skip to main content

Posts

Showing posts from July, 2024

Reducing NumPy memory usage with lossless compression.

If you’re running into memory issues because your NumPy arrays are too large, one of the basic approaches to reducing memory usage is compression. By changing how you represent your data, you can reduce memory usage and shrink your array’s footprint—often without changing the bulk of your code. In this article we’ll cover:     * Reducing memory usage via smaller dtypes.     * Sparse arrays.     * Some situations where these solutions won’t work.

uv - pip killer or yet another package manager?

    Uv is the "pip but blazingly fast™️ because it's written in rust" and is developed by the same folks that built ruff. It is designed as a drop-in replacement for pip and pip-tools for package management. uv supports everything you'd expect from a modern Python packaging tool: editable installs, Git dependencies, URL dependencies, local dependencies, constraint files, source distributions, custom indexes, and more, all designed around drop-in compatibility with your existing tools. uv's virtual environments are standards-compliant and work interchangeably with other tools — there's no lock-in or customization required. It supports Linux, Windows, and macOS, and has been tested at-scale against the public PyPI index. Read more...

Effective Python Testing With Pytest

Testing your code brings a wide variety of benefits. It increases your confidence that the code behaves as you expect and ensures that changes to your code won’t cause regressions. Writing and maintaining tests is hard work, so you should leverage all the tools at your disposal to make it as painless as possible. pytest is one of the best tools that you can use to boost your testing productivity. read more...