lamindb.Transform#
- class lamindb.Transform(name: str, short_name: Optional[str] = None, version: Optional[str] = None, type: Optional[TransformType] = None, reference: Optional[str] = None, reference_type: Optional[str] = None, is_new_version_of: Optional[Transform] = None)#
Bases:
Registry
,HasParents
Transforms of files & datasets.
Pipelines, notebooks, app uploads.
A pipeline is versioned software that transforms data. This can be anything from typical workflow tools (Nextflow, Snakemake, Prefect, Apache Airflow, etc.) to simple (versioned) scripts.
- Parameters:
name –
str
A name or title.short_name –
Optional[str] = None
A short name or abbreviation.version –
Optional[str] = None
A version.type –
Optional[TransformType] = None
Either'notebook'
,'pipeline'
or'app'
. IfNone
, defaults to'notebook'
within an IPython environment and to'pipeline'
outside of it.reference –
Optional[str] = None
A reference like a URL.is_new_version_of –
Optional[Transform] = None
An old version of the transform.
See also
lamindb.track()
Track global Transform & Run for a notebook or pipeline.
Run
Executions of the transform.
Notes
For more info, see tutorial: Data flow.
Examples
Create a transform for a pipeline:
>>> transform = ln.Transform(name="Cell Ranger", version="7.2.0", type="pipeline") >>> transform.save()
Create a transform from a notebook:
>>> ln.track()
View parents of a transform:
>>> transform.view_parents()
Fields
- id AutoField
Internal id, valid only in one DB instance.
- uid CharField
Universal id.
- name CharField
Transform name or title, a pipeline name, notebook title, etc..
- short_name CharField
A short name (optional).
- version CharField
Version (default
None
).Use this to label different versions of a transform.
Consider using semantic versioning with Python versioning.
- type CharField
Transform type.
Defaults to
"notebook"
if run from ipython and to"pipeline"
if run from python.If run from the UI, it defaults to
app
.
- latest_report ForeignKey
Latest run report.
- source_file ForeignKey
Source of the transform if stored as file within LaminDB.
- reference CharField
Reference for the transform, e.g., a URL.
- reference_type CharField
Type of reference, e.g., github link.
- initial_version ForeignKey
Initial version of the transform, a
Transform
record.
- created_at DateTimeField
Time of creation of record.
- updated_at DateTimeField
Time of last update to record.
- created_by ForeignKey
Creator of record, a
User
.
- parents ManyToManyField
Parent transforms (predecessors) in data flow.
These are auto-populated whenever a transform loads a file as run input.
Methods
- get_type_display(*, field=<django.db.models.fields.CharField: type>)#