Skip to content

Commit c3160e7

Browse files
authored
♻️ Canonicalize import patterns (#31)
* ♻️ Canonicalize import patterns * 🩹 F-string
1 parent 19048f6 commit c3160e7

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

docs/mlflow.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@
5050
},
5151
"outputs": [],
5252
"source": [
53-
"import lamindb as ln\n",
5453
"import lightning as pl\n",
54+
"import lamindb as ln\n",
55+
"from lamindb.integrations import lightning as ll\n",
5556
"import mlflow\n",
5657
"from pathlib import Path\n",
5758
"\n",
@@ -286,8 +287,8 @@
286287
" autoencoder = LitAutoEncoder(hidden_size=32, bottleneck_size=16)\n",
287288
"\n",
288289
" # Create a LaminDB LightningCallback which also (optionally) annotates checkpoints by desired metrics\n",
289-
" lamindb_callback = ln.integrations.lightning.Callback(\n",
290-
" path=Path(\"model_checkpoints\") / \"{mlflow_run.info.run_id}_last_epoch.ckpt\",\n",
290+
" lamindb_callback = ll.Callback(\n",
291+
" path=Path(\"model_checkpoints\") / f\"{mlflow_run.info.run_id}_last_epoch.ckpt\",\n",
291292
" key=f\"testmodels/mlflow/{mlflow_run.info.run_id}.ckpt\",\n",
292293
" features={\n",
293294
" \"mlflow_run_id\": mlflow_run.info.run_id,\n",

docs/wandb.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@
4646
},
4747
"outputs": [],
4848
"source": [
49+
"import lightning as pl\n",
4950
"import lamindb as ln\n",
51+
"from lamindb.integrations import lightning as ll\n",
5052
"import wandb\n",
51-
"import lightning as pl\n",
5253
"from pathlib import Path\n",
5354
"\n",
5455
"from torch import utils\n",
@@ -276,8 +277,8 @@
276277
"source": [
277278
"# Create a LaminDB LightningCallback which also (optionally) annotates checkpoints by desired metrics\n",
278279
"wandb_logger.experiment.id\n",
279-
"lamindb_callback = ln.integrations.lightning.Callback(\n",
280-
" path=Path(\"model_checkpoints\") / \"{wanddblogger.version}_last_epoch.ckpt\",\n",
280+
"lamindb_callback = ll.Callback(\n",
281+
" path=Path(\"model_checkpoints\") / f\"{wandb_logger.version}_last_epoch.ckpt\",\n",
281282
" key=f\"testmodels/wandb/{wandb_logger.experiment.id}.ckpt\",\n",
282283
" features={\n",
283284
" \"wandb_run_id\": wandb_logger.experiment.id,\n",

0 commit comments

Comments
 (0)