A pattern for unit testable Python argparse implementation

Python argparse is a standard library for a Python script to extract command line arguments. It’s pretty useful, but unfortunately most tutorials and even the documentation itself don’t assume unit testing of your argument parsing. I present here a pattern for argparse usage that enables and facilitates unit testing, along with a nice encapsulation of a “user options” concept for maintaining the user options specified from the command line.

TDD implies higher quality code

I don’t mean just fewer errors, although that is definitely a happy side effect of TDD. I mean that the code is easier to read, maintain and has fewer leaky abstractions.

Scaling Gitlab runners

Gitlab documents a method for auto-scaling a gitlab-runner. But what if you are not able to apply Docker Machine concepts to your cluster, or don’t need autoscaling and are content to scale manually? Read on for my solution to simple, manual scaling of Gitlab runners in a Docker swarm.

Charting the multiport black box parameters of linear, time invariant electrical networks

This tutorial gives an overview of multiport black-box model theory and how it relates to commonly used parameters of linear, time invariant electrical networks. Expressions are also derived for the conversions between the various multiport parameters.

Combining principles; Theorem 3

When each of the \( M \) branch networks and source resistances are identical there is an equivalence between the multiport combiner with source resistance below and the single branch network also shown below, comprised of an effective source resistance \( R_{e} \), a scaled branch network \( \mathbf{Y_{e}} \) and the original trunk network \( \mathbf{Z_{t}} \).

Ideal combining network

Effective equivalent single source combining network