lamindb.track¶
- lamindb.track(transform=None, *, project=None, space=None, branch=None, features=None, params=None, new_run=None, path=None, pypackages=None)¶
Track a run of a notebook or script.
Populates the global run
contextwithTransform&Runobjects and tracks the compute environment.- Parameters:
transform (
str|Transform|None, default:None) – A transform (stem)uid(or record). IfNone, auto-creates atransformwith itsuid.project (
str|Project|None, default:None) – A project (or itsnameoruid) for labeling entities.space (
str|Space|None, default:None) – A restricted space (or itsnameoruid) in which to store entities. Default: the"all"space. Note that bionty entities ignore this setting and always get written to the"all"space. If you want to manually move entities to a different space, set the.spacefield (Manage access).branch (
str|Branch|None, default:None) – A branch (or itsnameoruid) on which to store records.features (
dict|None, default:None) – A dictionary of features & values to track for the run.params (
dict|None, default:None) – A dictionary of params & values to track for the run.new_run (
bool|None, default:None) – IfFalse, loads the latest run of transform (default notebook), ifTrue, creates new run (default non-notebook).path (
str|None, default:None) – Filepath of notebook or script. Only needed if it can’t be automatically detected.pypackages (
bool|None, default:None) – IfTrueorNone, infers Python packages used in a notebook.
- Return type:
None
Examples
To track the run of a notebook or script:
import lamindb as ln ln.track() # initiate a tracked notebook/script run # your code automatically tracks inputs & outputs ln.finish() # mark run as finished, save execution report, source code & environment
To ensure one version history across file renames:
ln.track("Onv04I53OgtT")
To sync code with a git repo, see: sync-code-with-git.
To track parameters and features, see: Track parameters & features.
To browse more examples, see: Track notebooks, scripts & functions.