The tbcontrol package collects functions useful for the kinds of problems encountered in undergraduate process control
textbooks. It is the distributable part of this larger collection of Jupyter notebooks for CPN321 (Process Dynamics) and
CPB421 (Process Control) at the University of Pretoria.
There is also a Dynamics and Control YouTube channel with videos related to the notebooks.
The supported notebook environment is managed by uv and pinned to Python 3.13 through
.python-version. The published tbcontrol library is intentionally less restrictive: it supports Python 3.10 and newer,
has no upper bounds on its runtime dependencies, and is tested separately across Python 3.10–3.14.
On macOS, install uv with Homebrew:
brew install uvOther platforms can use the official uv installation instructions.
A plain sync installs the ordinary notebook environment:
uv sync
uv run jupyter labThe neural-network notebook and the test tools are kept in focused groups. Install them when running the complete test suite:
uv sync --group ml-ai --group test --group notebook-test
uv run --group ml-ai --group test pytest tests
uv run --group ml-ai --group test --group notebook-test pytest -n 2 --verbose test_all_notebooks.pyThe dependency groups are:
default: Jupyter and the constrained numerical, symbolic, control, spreadsheet, plotting, and notebook-diff packages used by this repository.ml-ai: TensorFlow and Keras for1_Dynamics/7_System_identification/Neural networks.ipynb.test: the lightweighttbcontrolpackage-test dependency.notebook-test: notebook execution and parallel-test tooling.docs: Sphinx and the documentation extensions used by Read the Docs.
To build the documentation locally:
uv sync --group docs
uv run --group docs sphinx-build -M html . _buildThe repository's .envrc uses layout uv. Install direnv, add its shell hook, and install the
uv layout from the direnv wiki, then run:
direnv allowConfigure editors and notebook clients to use .venv/bin/python.