🧰 LRFutils#

Small tools for everyday scientific work: keep every run traceable, keep every figure editable, and see what your scripts are doing.

pip install LRFutils

✨ In one example#

import matplotlib.pyplot as plt
import numpy as np
from LRFutils import archive, logs, pltedit, progress

run = archive.new("sweep", wavelength_nm=1550)   # archives/<date>_<commit>/0001-sweep-…
logs.info(f"Results in {run.path}")

bar = progress.Bar(max=200, prefix="Sweep")
signal = []
for i in range(200):
    signal.append(np.sin(i / 20))
    bar(i + 1)

fig, ax = plt.subplots()
ax.plot(signal)
pltedit.save(fig, run.path / "signal.plt")       # reopen it with pltedit.load

New here? Start with πŸš€ Getting started.

πŸ—ΊοΈ Contents#

Note

LRFutils 0.2 merges VFSciTools, which it replaces: vfscitools.archive and pltedit are now LRFutils.archive and LRFutils.pltedit, with the same behaviour and file formats.