π§° 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
ποΈ Run archivesOne dated folder per run, named after its parameters, with a
metadata.yml (date, Git commit, Python, parameters).
π¨ Editable figuresSave matplotlib figures as .plt files and change them months later, in Python or in the desktop editor.
π₯οΈ Terminal helpersProgress bars with an ETA, logs written to a file, coloured text and separators.
β¨ 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#
Guides
Reference
Community
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.