diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 5d18b0d..a246997 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -40,10 +40,17 @@ jobs: use-public-rspm: true - uses: r-lib/actions/setup-r-dependencies@v2 + if: matrix.config.r == 'release' with: extra-packages: any::rcmdcheck needs: check + - uses: r-lib/actions/setup-r-dependencies@v2 + if: matrix.config.r != 'release' + with: + extra-packages: any::rcmdcheck, cran/ggrepel@0.9.6 + needs: check + - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true diff --git a/DESCRIPTION b/DESCRIPTION index 39fd89c..361ec4a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: CyteTypeR Title: CyteType for R -Version: 0.3.1 +Version: 0.3.2 Description: CyteTypeR is the R version of CyteType python package. Authors@R: person("Nygen Analytics AB", , ,"contact@nygen.io", role = c("aut", "cre")) diff --git a/R/artifacts.R b/R/artifacts.R index d0e3ec7..59c5aab 100644 --- a/R/artifacts.R +++ b/R/artifacts.R @@ -81,8 +81,8 @@ on.exit(rhdf5::H5Fclose(fid), add = TRUE) rhdf5::h5createGroup(fid, "vars") - rhdf5::h5writeAttribute(as.integer(n_obs), h5obj = out_file, name = "n_obs", h5loc = "vars") - rhdf5::h5writeAttribute(as.integer(n_vars), h5obj = out_file, name = "n_vars", h5loc = "vars") + rhdf5::h5writeAttribute(as.integer(n_obs), h5obj = out_file, name = "n_obs", h5loc = "vars", asScalar = TRUE) + rhdf5::h5writeAttribute(as.integer(n_vars), h5obj = out_file, name = "n_vars", h5loc = "vars", asScalar = TRUE) # Create extensible datasets (equivalent to maxshape=(None,) in h5py) max_nnz <- n_obs * n_vars # upper bound diff --git a/R/schema.R b/R/schema.R index 54d974f..ddc5d8d 100644 --- a/R/schema.R +++ b/R/schema.R @@ -108,6 +108,14 @@ LLMModelConfig <- function(provider, mask_job_details <- if (is.null(nm)) rep(TRUE, length(query_list$input_data)) else !endsWith(nm, "jobDetails") query_list$input_data <- query_list$input_data[mask_job_details] + # Ensure fields the server expects as JSON objects serialize to {} not [] + dict_fields <- c("clusterMetadata", "clusterLabels", "infoTags", "expressionData") + for (field in dict_fields) { + val <- query_list$input_data[[field]] + if (is.list(val) && length(val) == 0 && is.null(names(val))) { + query_list$input_data[[field]] <- setNames(list(), character(0)) + } + } return(query_list) }