From c6335fc5b4a4be60846377021b6c405e3701186e Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Mon, 2 Dec 2024 14:32:40 +0100 Subject: [PATCH 01/25] fix lamindb installation instructions --- .github/workflows/R-CMD-check.yaml | 2 +- .github/workflows/pkgdown.yaml | 2 +- README.md | 2 +- vignettes/concepts_features.Rmd | 2 +- vignettes/laminr.Rmd | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index c661f25..928b21b 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -71,7 +71,7 @@ jobs: - name: Install lamindb run: | - pip install 'lamindb[aws]>=0.77.2' huggingface_hub + pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' huggingface_hub - name: Log in to Lamin run: | diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 5a9aaca..a28d45c 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -49,7 +49,7 @@ jobs: - name: Install lamindb run: | - pip install 'lamindb[aws]>=0.77.2' huggingface_hub + pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' huggingface_hub - name: Log in to Lamin run: | diff --git a/README.md b/README.md index ccb84a8..37e988a 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ install.packages("laminr") You will also need to install the `lamindb` Python package: ```bash -pip install 'lamindb[aws]>=0.77.2' +pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' ``` ### Additional packages diff --git a/vignettes/concepts_features.Rmd b/vignettes/concepts_features.Rmd index 5cb0047..ee1a2b2 100644 --- a/vignettes/concepts_features.Rmd +++ b/vignettes/concepts_features.Rmd @@ -37,7 +37,7 @@ Now, let's set up your environment to use **{laminr}**. 1. Install the `lamindb` Python package. ```bash - pip install 'lamindb[aws]>=0.77.2' + pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' ``` 2. Connect to a LaminDB instance: diff --git a/vignettes/laminr.Rmd b/vignettes/laminr.Rmd index 3712b1b..d37dfeb 100644 --- a/vignettes/laminr.Rmd +++ b/vignettes/laminr.Rmd @@ -31,7 +31,7 @@ install.packages("laminr", dependencies = TRUE) Install `lamindb` from PyPI: ```bash -pip install 'lamindb[aws]>=0.77.2' +pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' ``` Connect to a LaminDB instance on the command line: From ecc61a6ce207ad80ac78dce662fe9274d88ce01c Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Mon, 2 Dec 2024 14:36:46 +0100 Subject: [PATCH 02/25] remove huggingface_hub --- .github/workflows/R-CMD-check.yaml | 2 +- .github/workflows/pkgdown.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 928b21b..5145463 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -71,7 +71,7 @@ jobs: - name: Install lamindb run: | - pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' huggingface_hub + pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' - name: Log in to Lamin run: | diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index a28d45c..5bb8a4b 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -49,7 +49,7 @@ jobs: - name: Install lamindb run: | - pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' huggingface_hub + pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' - name: Log in to Lamin run: | From 8e89b8153ca55723a1e8f967878f787fd83c5cca Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Mon, 2 Dec 2024 14:51:19 +0100 Subject: [PATCH 03/25] simplify installation instructions --- README.md | 2 +- vignettes/concepts_features.Rmd | 2 +- vignettes/laminr.Rmd | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 37e988a..ccb84a8 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ install.packages("laminr") You will also need to install the `lamindb` Python package: ```bash -pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' +pip install 'lamindb[aws]>=0.77.2' ``` ### Additional packages diff --git a/vignettes/concepts_features.Rmd b/vignettes/concepts_features.Rmd index ee1a2b2..5cb0047 100644 --- a/vignettes/concepts_features.Rmd +++ b/vignettes/concepts_features.Rmd @@ -37,7 +37,7 @@ Now, let's set up your environment to use **{laminr}**. 1. Install the `lamindb` Python package. ```bash - pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' + pip install 'lamindb[aws]>=0.77.2' ``` 2. Connect to a LaminDB instance: diff --git a/vignettes/laminr.Rmd b/vignettes/laminr.Rmd index d37dfeb..3712b1b 100644 --- a/vignettes/laminr.Rmd +++ b/vignettes/laminr.Rmd @@ -31,7 +31,7 @@ install.packages("laminr", dependencies = TRUE) Install `lamindb` from PyPI: ```bash -pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' +pip install 'lamindb[aws]>=0.77.2' ``` Connect to a LaminDB instance on the command line: From 2a3da127d01a59f67beea04287042631a23d1537 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Mon, 2 Dec 2024 14:53:59 +0100 Subject: [PATCH 04/25] manually set python --- .github/workflows/pkgdown.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 5bb8a4b..5b29498 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -62,6 +62,8 @@ jobs: - name: Build site run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} + env: + RETICULATE_PYTHON: /usr/bin/python - name: Create built site artifact uses: actions/upload-artifact@v4 From 46c83911017f242f672d3ce4d11f6c91b532313f Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Mon, 2 Dec 2024 15:54:47 +0100 Subject: [PATCH 05/25] install python first --- .github/workflows/pkgdown.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 5b29498..647da8a 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -31,6 +31,15 @@ jobs: - uses: r-lib/actions/setup-pandoc@v2 + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + cache: pip + + - name: Install lamindb + run: | + pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true @@ -47,10 +56,6 @@ jobs: install.packages("tiledbsoma") shell: Rscript {0} - - name: Install lamindb - run: | - pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' - - name: Log in to Lamin run: | lamin login From 4de6164aefdf733075d96d0a52c8ade2b434959a Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Mon, 2 Dec 2024 15:59:11 +0100 Subject: [PATCH 06/25] fix ga --- .github/workflows/pkgdown.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 647da8a..140c39a 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -33,8 +33,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: '3.x' - cache: pip + python-version: "3.x" - name: Install lamindb run: | From ee63598bd00e1e4a861adb8a555d752286266083 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Mon, 2 Dec 2024 16:08:35 +0100 Subject: [PATCH 07/25] remove env --- .github/workflows/pkgdown.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 140c39a..6c0e081 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -66,8 +66,6 @@ jobs: - name: Build site run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} - env: - RETICULATE_PYTHON: /usr/bin/python - name: Create built site artifact uses: actions/upload-artifact@v4 From 6d27f21243e198c1d6eb292eebab01aeaf40129d Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Mon, 2 Dec 2024 17:45:52 +0100 Subject: [PATCH 08/25] no need to install bionty and wetlab during r cmd check --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 5145463..c686c0a 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -71,7 +71,7 @@ jobs: - name: Install lamindb run: | - pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' + pip install 'lamindb[aws]>=0.77.2' - name: Log in to Lamin run: | From 2254908440d6bf6eb184bdac80e4bef5dda6b343 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 09:06:56 +0100 Subject: [PATCH 09/25] add which --- .github/workflows/pkgdown.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 6c0e081..79ee6cd 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -34,6 +34,10 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.x" + + - run: | + which python + which python3 - name: Install lamindb run: | From 54acb25808065da94f24c18e664d28578382ea94 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 09:31:54 +0100 Subject: [PATCH 10/25] set reticulate_python --- .github/workflows/pkgdown.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 79ee6cd..62329c8 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -31,13 +31,14 @@ jobs: - uses: r-lib/actions/setup-pandoc@v2 - - uses: actions/setup-python@v5 + - id: setup-python + uses: actions/setup-python@v5 with: python-version: "3.x" - run: | which python - which python3 + which pip - name: Install lamindb run: | @@ -70,6 +71,8 @@ jobs: - name: Build site run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} + env: + RETICULATE_PYTHON: ${{ steps.setup-python.outputs.python-path }} - name: Create built site artifact uses: actions/upload-artifact@v4 From d3feaedeb03bac5a95ee3aa71bee06247afcfe71 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 09:47:53 +0100 Subject: [PATCH 11/25] check r installation dependencies --- .github/workflows/pkgdown.yaml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 62329c8..7d6c4ac 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -35,10 +35,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.x" - - - run: | - which python - which pip - name: Install lamindb run: | @@ -56,10 +52,19 @@ jobs: - name: Install {tiledbsoma} run: | + install.packages("pak") options(repos = c("https://chanzuckerberg.r-universe.dev", getOption("repos"))) - install.packages("tiledbsoma") + pak::pkg_install("tiledbsoma") shell: Rscript {0} + - name: Check dependencies + run: | + reticulate::py_config() + reticulate::import("lamindb") + shell: Rscript {0} + env: + RETICULATE_PYTHON: ${{ steps.setup-python.outputs.python-path }} + - name: Log in to Lamin run: | lamin login From 229dab6f244c46c31db79d6be103c61705f7bf2a Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 10:42:27 +0100 Subject: [PATCH 12/25] update error message --- R/Instance.R | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/R/Instance.R b/R/Instance.R index d5f2284..6ca930d 100644 --- a/R/Instance.R +++ b/R/Instance.R @@ -59,23 +59,20 @@ create_instance <- function(instance_settings, is_default = FALSE) { active = active ) - py_lamin <- NULL check_requires("Connecting to Python", "reticulate", alert = "warning") py_lamin <- tryCatch( reticulate::import("lamindb"), error = function(err) { + cli::cli_warn(c( + paste( + "Failed to connect to the Python {.pkg lamindb} package,", + "some functionality may be limited." + ), + "i" = "Run {.run reticulate::py_last_error()} or {reticulate::py_last_error()} for details", + )) NULL } ) - if (isTRUE(is_default) && is.null(py_lamin)) { - cli::cli_warn(c( - paste( - "Default instance failed to connect to the Python {.pkg lamindb} package,", - "you will not be able to create records" - ), - "i" = "See {.run reticulate::py_config()} for more information" - )) - } # create the instance RichInstance$new( From 0a0fc3cd5f2ee21f0ecb99104e6ace92136c8ab7 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 10:42:35 +0100 Subject: [PATCH 13/25] add debug vignette --- vignettes/debug.Rmd | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 vignettes/debug.Rmd diff --git a/vignettes/debug.Rmd b/vignettes/debug.Rmd new file mode 100644 index 0000000..e1a2386 --- /dev/null +++ b/vignettes/debug.Rmd @@ -0,0 +1,59 @@ +--- +title: "Debug" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Debug} + %\VignetteEncoding{UTF-8} + %\VignetteEngine{knitr::rmarkdown} +--- + +Python config: + +```{r} +reticulate::py_config() +``` + +Detect lamindb: + +```{r} +reticulate::import("lamindb") +``` + +```{r} +reticulate::py_last_error() +``` + +Load laminr: + +```{r} +library(laminr) +``` + +View handle + +```{r} +laminr:::.get_user_settings()$handle +``` + +Connect to default instance: + +```{r} +db <- connect() +db +``` + +```{r} +reticulate::py_last_error() +``` + +Show python lamin: + +```{r} +db$get_py_lamin() +``` + +Print session info: + +```{r} +sessionInfo() +``` From 7c3773f5e65ad73b7f2b78627a8a68b4b6cfa963 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 10:46:56 +0100 Subject: [PATCH 14/25] fix style --- R/Artifact.R | 1 - R/Instance.R | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/R/Artifact.R b/R/Artifact.R index 396c411..3df7b0a 100644 --- a/R/Artifact.R +++ b/R/Artifact.R @@ -27,7 +27,6 @@ ArtifactRecord <- R6::R6Class( # nolint object_name_linter #' #' @return The path to the cached artifact cache = function() { - py_lamin <- private$.instance$get_py_lamin() if (!is.null(py_lamin)) { if (isTRUE(private$.instance$is_default)) { diff --git a/R/Instance.R b/R/Instance.R index 6ca930d..cb20399 100644 --- a/R/Instance.R +++ b/R/Instance.R @@ -68,7 +68,7 @@ create_instance <- function(instance_settings, is_default = FALSE) { "Failed to connect to the Python {.pkg lamindb} package,", "some functionality may be limited." ), - "i" = "Run {.run reticulate::py_last_error()} or {reticulate::py_last_error()} for details", + "i" = "Run {.run reticulate::py_last_error()} or {reticulate::py_last_error()} for details" )) NULL } From 25fe27c2264d8b403a49de6ba00a32d522e08a6c Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 10:55:28 +0100 Subject: [PATCH 15/25] do not reinstall tiledbsoma if already installed --- .github/workflows/pkgdown.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 7d6c4ac..588a4fb 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -52,9 +52,11 @@ jobs: - name: Install {tiledbsoma} run: | - install.packages("pak") - options(repos = c("https://chanzuckerberg.r-universe.dev", getOption("repos"))) - pak::pkg_install("tiledbsoma") + # Install {tiledbsoma} if not already installed + if (!requireNamespace("tiledbsoma", quietly = TRUE)) { + options(repos = c("https://chanzuckerberg.r-universe.dev", getOption("repos"))) + install.packages("tiledbsoma") + } shell: Rscript {0} - name: Check dependencies From 6cda61ee28e4b0f7f830c940eb7ffdc3ed23cc51 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 10:59:42 +0100 Subject: [PATCH 16/25] add workaround --- .github/workflows/pkgdown.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 588a4fb..4d9aac0 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -39,6 +39,9 @@ jobs: - name: Install lamindb run: | pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' + + # Avoid 'No module named 'IPython' when loading lamindb + pip install ipython - uses: r-lib/actions/setup-r@v2 with: From 6ba7eb645282f99bb364394d6a23653d52fbf16f Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 11:06:41 +0100 Subject: [PATCH 17/25] fix warning message --- R/Instance.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Instance.R b/R/Instance.R index cb20399..96347ea 100644 --- a/R/Instance.R +++ b/R/Instance.R @@ -68,7 +68,7 @@ create_instance <- function(instance_settings, is_default = FALSE) { "Failed to connect to the Python {.pkg lamindb} package,", "some functionality may be limited." ), - "i" = "Run {.run reticulate::py_last_error()} or {reticulate::py_last_error()} for details" + "i" = "Run {.run reticulate::py_last_error()} for details" )) NULL } From 2b37d90a9e179e631a885aeb2bc672c169ad869d Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 11:15:11 +0100 Subject: [PATCH 18/25] fix warning --- R/Instance.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Instance.R b/R/Instance.R index 96347ea..6c9300c 100644 --- a/R/Instance.R +++ b/R/Instance.R @@ -68,7 +68,7 @@ create_instance <- function(instance_settings, is_default = FALSE) { "Failed to connect to the Python {.pkg lamindb} package,", "some functionality may be limited." ), - "i" = "Run {.run reticulate::py_last_error()} for details" + "i" = "Run {.run reticulate::py_config()} and {.run reticulate::py_last_error()} for details" )) NULL } From a5c03bd7ba2c9b8a5d6714f78ec90c37f2a44791 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 11:15:16 +0100 Subject: [PATCH 19/25] add message --- .github/workflows/pkgdown.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 4d9aac0..062d06f 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -59,6 +59,8 @@ jobs: if (!requireNamespace("tiledbsoma", quietly = TRUE)) { options(repos = c("https://chanzuckerberg.r-universe.dev", getOption("repos"))) install.packages("tiledbsoma") + } else { + message("Package 'tiledbsoma' already installed") } shell: Rscript {0} From 56c4cc8a2b3598cf5a6ed4f31ee19d9d59ef7f62 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 11:58:05 +0100 Subject: [PATCH 20/25] use smaller example dataset --- R/Instance.R | 2 +- man/Instance.Rd | 2 +- vignettes/architecture.qmd | 4 ++-- vignettes/concepts_features.Rmd | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/Instance.R b/R/Instance.R index 6c9300c..4b46bc2 100644 --- a/R/Instance.R +++ b/R/Instance.R @@ -104,7 +104,7 @@ create_instance <- function(instance_settings, is_default = FALSE) { #' db <- connect("laminlabs/cellxgene") #' #' # fetch an artifact -#' artifact <- db$Artifact$get("KBW89Mf7IGcekja2hADu") +#' artifact <- db$Artifact$get("MkRm3eUKPwfnAyZMWD9v") #' #' # describe the artifact #' artifact$describe() diff --git a/man/Instance.Rd b/man/Instance.Rd index 9adff42..7df3787 100644 --- a/man/Instance.Rd +++ b/man/Instance.Rd @@ -21,7 +21,7 @@ See the vignette on "Package Architecture" for more information: db <- connect("laminlabs/cellxgene") # fetch an artifact -artifact <- db$Artifact$get("KBW89Mf7IGcekja2hADu") +artifact <- db$Artifact$get("MkRm3eUKPwfnAyZMWD9v") # describe the artifact artifact$describe() diff --git a/vignettes/architecture.qmd b/vignettes/architecture.qmd index 613deac..db444b1 100644 --- a/vignettes/architecture.qmd +++ b/vignettes/architecture.qmd @@ -230,7 +230,7 @@ For example, to get an artifact with a specific ID using **only** base classes, ```r db <- connect("laminlabs/cellxgene") -artifact <- db$get_module("core")$get_registry("artifact")$get("KBW89Mf7IGcekja2hADu") +artifact <- db$get_module("core")$get_registry("artifact")$get("MkRm3eUKPwfnAyZMWD9v") artifact$get_value("id") ``` @@ -240,7 +240,7 @@ With the sugar syntax classes, you can achieve the same result more concisely: ```r db <- connect("laminlabs/cellxgene") -artifact <- db$Artifact$get("KBW89Mf7IGcekja2hADu") +artifact <- db$Artifact$get("MkRm3eUKPwfnAyZMWD9v") artifact$id ``` diff --git a/vignettes/concepts_features.Rmd b/vignettes/concepts_features.Rmd index 5cb0047..fb8aaf4 100644 --- a/vignettes/concepts_features.Rmd +++ b/vignettes/concepts_features.Rmd @@ -109,10 +109,10 @@ db$Artifact$df(limit = 5) ## Working with records -You can fetch a specific record from a registry using its ID or UID. For instance, to get the artifact with UID [KBW89Mf7IGcekja2hADu](https://lamin.ai/laminlabs/cellxgene/artifact/KBW89Mf7IGcekja2hADu): +You can fetch a specific record from a registry using its ID or UID. For instance, to get the artifact with UID [MkRm3eUKPwfnAyZMWD9v](https://lamin.ai/laminlabs/cellxgene/artifact/MkRm3eUKPwfnAyZMWD9v): ```{r get_artifact} -artifact <- db$Artifact$get("KBW89Mf7IGcekja2hADu") +artifact <- db$Artifact$get("MkRm3eUKPwfnAyZMWD9v") ``` This artifact contains an `AnnData` object with myeloid cell data. You can view its metadata: From 94d1244afef57b011f9c530902428e8d8cf9f658 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 12:42:11 +0100 Subject: [PATCH 21/25] revert debugging code --- .github/workflows/R-CMD-check.yaml | 11 ++++++ .github/workflows/pkgdown.yaml | 23 +++++------- vignettes/debug.Rmd | 59 ------------------------------ 3 files changed, 21 insertions(+), 72 deletions(-) delete mode 100644 vignettes/debug.Rmd diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index c686c0a..4daf500 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -72,6 +72,10 @@ jobs: - name: Install lamindb run: | pip install 'lamindb[aws]>=0.77.2' + + # Make sure IPython is installed -- + # Workaround for laminlabs/laminhub-public/issues/29 + pip install ipython - name: Log in to Lamin run: | @@ -81,6 +85,13 @@ jobs: run: | lamin connect laminlabs/lamindata + - name: Check whether we can import lamindb and connect to the default instance + run: | + reticulate::py_config() + reticulate::import("lamindb") + laminr::connect() + shell: Rscript {0} + - uses: r-lib/actions/setup-r-dependencies@v2 with: extra-packages: any::rcmdcheck diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 062d06f..7bb40bd 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -40,7 +40,8 @@ jobs: run: | pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' - # Avoid 'No module named 'IPython' when loading lamindb + # Make sure IPython is installed -- + # Workaround for laminlabs/laminhub-public#29 pip install ipython - uses: r-lib/actions/setup-r@v2 @@ -53,9 +54,8 @@ jobs: needs: website quarto-version: pre-release - - name: Install {tiledbsoma} + - name: Install {tiledbsoma} if not already installed run: | - # Install {tiledbsoma} if not already installed if (!requireNamespace("tiledbsoma", quietly = TRUE)) { options(repos = c("https://chanzuckerberg.r-universe.dev", getOption("repos"))) install.packages("tiledbsoma") @@ -64,14 +64,6 @@ jobs: } shell: Rscript {0} - - name: Check dependencies - run: | - reticulate::py_config() - reticulate::import("lamindb") - shell: Rscript {0} - env: - RETICULATE_PYTHON: ${{ steps.setup-python.outputs.python-path }} - - name: Log in to Lamin run: | lamin login @@ -80,11 +72,16 @@ jobs: run: | lamin connect laminlabs/lamindata + - name: Check whether we can import lamindb and connect to the default instance + run: | + reticulate::py_config() + reticulate::import("lamindb") + laminr::connect() + shell: Rscript {0} + - name: Build site run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} - env: - RETICULATE_PYTHON: ${{ steps.setup-python.outputs.python-path }} - name: Create built site artifact uses: actions/upload-artifact@v4 diff --git a/vignettes/debug.Rmd b/vignettes/debug.Rmd deleted file mode 100644 index e1a2386..0000000 --- a/vignettes/debug.Rmd +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: "Debug" -output: rmarkdown::html_vignette -vignette: > - %\VignetteIndexEntry{Debug} - %\VignetteEncoding{UTF-8} - %\VignetteEngine{knitr::rmarkdown} ---- - -Python config: - -```{r} -reticulate::py_config() -``` - -Detect lamindb: - -```{r} -reticulate::import("lamindb") -``` - -```{r} -reticulate::py_last_error() -``` - -Load laminr: - -```{r} -library(laminr) -``` - -View handle - -```{r} -laminr:::.get_user_settings()$handle -``` - -Connect to default instance: - -```{r} -db <- connect() -db -``` - -```{r} -reticulate::py_last_error() -``` - -Show python lamin: - -```{r} -db$get_py_lamin() -``` - -Print session info: - -```{r} -sessionInfo() -``` From 3e337c1dcf66567c966ef11d20766debbfd13576 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 12:45:28 +0100 Subject: [PATCH 22/25] move lamindb installation to where it was before --- .github/workflows/pkgdown.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 7bb40bd..1fff388 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -36,14 +36,6 @@ jobs: with: python-version: "3.x" - - name: Install lamindb - run: | - pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' - - # Make sure IPython is installed -- - # Workaround for laminlabs/laminhub-public#29 - pip install ipython - - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true @@ -64,6 +56,14 @@ jobs: } shell: Rscript {0} + - name: Install lamindb + run: | + pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' + + # Make sure IPython is installed -- + # Workaround for laminlabs/laminhub-public#29 + pip install ipython + - name: Log in to Lamin run: | lamin login From 99f0b193a35d5e6ed2cffcf839d72753e6e832d1 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 12:53:00 +0100 Subject: [PATCH 23/25] align ci yamls --- .github/workflows/R-CMD-check.yaml | 23 ++++++++++++++--------- .github/workflows/pkgdown.yaml | 4 ++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 4daf500..b45ef3c 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -40,8 +40,6 @@ jobs: - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-tinytex@v2 - - uses: actions/setup-python@v5 with: python-version: ${{ matrix.config.python }} @@ -62,6 +60,11 @@ jobs: echo "LDFLAGS=-L$OPENBLAS/lib" >> $GITHUB_ENV echo "CPPFLAGS=-I$OPENBLAS/include" >> $GITHUB_ENV + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + - name: Install {tiledbsoma} if: runner.os == 'Linux' run: | @@ -74,7 +77,7 @@ jobs: pip install 'lamindb[aws]>=0.77.2' # Make sure IPython is installed -- - # Workaround for laminlabs/laminhub-public/issues/29 + # Workaround for laminlabs/laminhub-public#29 pip install ipython - name: Log in to Lamin @@ -92,12 +95,14 @@ jobs: laminr::connect() shell: Rscript {0} - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::rcmdcheck - needs: check - - - uses: r-lib/actions/check-r-package@v2 + - name: Check package + uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' + + + - name: Upload check results + uses: actions/upload-artifact@v4 + with: + name: ${{ runner.os }}-r${{ matrix.config.r }}-check-results diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 1fff388..a5be418 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -31,8 +31,7 @@ jobs: - uses: r-lib/actions/setup-pandoc@v2 - - id: setup-python - uses: actions/setup-python@v5 + - uses: actions/setup-python@v5 with: python-version: "3.x" @@ -58,6 +57,7 @@ jobs: - name: Install lamindb run: | + # install bionty and wetlab to avoid warnings about missing dependencies pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' # Make sure IPython is installed -- From fd4881f06a61c9c5b2f81fe6740f35da490b76eb Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 12:56:51 +0100 Subject: [PATCH 24/25] laminr is not installed yet at this stage --- .github/workflows/R-CMD-check.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index b45ef3c..02ab91b 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -75,7 +75,7 @@ jobs: - name: Install lamindb run: | pip install 'lamindb[aws]>=0.77.2' - + # Make sure IPython is installed -- # Workaround for laminlabs/laminhub-public#29 pip install ipython @@ -92,7 +92,6 @@ jobs: run: | reticulate::py_config() reticulate::import("lamindb") - laminr::connect() shell: Rscript {0} - name: Check package @@ -101,7 +100,6 @@ jobs: upload-snapshots: true build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' - - name: Upload check results uses: actions/upload-artifact@v4 with: From 3257626d804b37d67917a50fb32d94d0627f6cc4 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 3 Dec 2024 13:03:09 +0100 Subject: [PATCH 25/25] fix ci --- .github/workflows/R-CMD-check.yaml | 16 +++++++++------- .github/workflows/pkgdown.yaml | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 02ab91b..bcbb739 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -94,13 +94,15 @@ jobs: reticulate::import("lamindb") shell: Rscript {0} - - name: Check package - uses: r-lib/actions/check-r-package@v2 - with: - upload-snapshots: true - build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' + - name: Check + env: + _R_CHECK_CRAN_INCOMING_REMOTE_: false + run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") + shell: Rscript {0} - name: Upload check results - uses: actions/upload-artifact@v4 + if: failure() + uses: actions/upload-artifact@main with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-check-results + name: ${{ runner.os }}-r${{ matrix.config.r }}-results + path: check diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index a5be418..43393ba 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -59,7 +59,7 @@ jobs: run: | # install bionty and wetlab to avoid warnings about missing dependencies pip install 'lamindb[aws,bionty,wetlab]>=0.77.2' - + # Make sure IPython is installed -- # Workaround for laminlabs/laminhub-public#29 pip install ipython