Skip to content

Commit

Permalink
πŸ“ Document artifact loaders
Browse files Browse the repository at this point in the history
  • Loading branch information
falexwolf committed Sep 17, 2024
1 parent b92e149 commit 733390f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lnschema_core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2330,17 +2330,14 @@ def open(
def load(
self, is_run_input: bool | None = None, stream: bool = False, **kwargs
) -> Any:
"""Stage and load to memory.
"""Cache and load into memory.
Returns in-memory representation if possible such as an `AnnData` object for an `h5ad` file.
See all artifact loaders :mod:`~lamindb.core.loaders`.
Examples:
Load as a `DataFrame`:
Load a `DataFrame`-like artifact:
>>> df = ln.core.datasets.df_iris_in_meter_batch1()
>>> ln.Artifact.from_df(df, description="iris").save()
>>> artifact = ln.Artifact.get(description="iris")
>>> artifact.load().head()
sepal_length sepal_width petal_length petal_width iris_organism_code
0 0.051 0.035 0.014 0.002 0
Expand All @@ -2349,7 +2346,7 @@ def load(
3 0.046 0.031 0.015 0.002 0
4 0.050 0.036 0.014 0.002 0
Load as an `AnnData`:
Load an `AnnData`-like artifact:
>>> artifact.load()
AnnData object with n_obs Γ— n_vars = 70 Γ— 765
Expand Down

0 comments on commit 733390f

Please sign in to comment.