Skip to content

Commit

Permalink
fix: Do not require schema_version field in h5ad uns for validation (#…
Browse files Browse the repository at this point in the history
…601)

* fix: do not require schema_version in uns for validating h5ads

* Bump version: 3.1.1 → 3.1.2-rc.0

* Bump version: 3.1.2-rc.0 → 3.1.2
  • Loading branch information
nayib-jose-gloria authored Aug 15, 2023
1 parent 92b27f5 commit 7fc0971
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.1.1
current_version = 3.1.2
commit = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?:-(?P<prerel>rc)\.(?P<prerelversion>\d+))?
serialize =
Expand Down
2 changes: 1 addition & 1 deletion cellxgene_schema_cli/cellxgene_schema/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.1.1"
__version__ = "3.1.2"
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ components:
keys:
schema_version:
type: string
# If "required" is present, then the key/value are required
required: null
title:
type: string
required: null
Expand Down
2 changes: 1 addition & 1 deletion cellxgene_schema_cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="cellxgene-schema",
version="3.1.1",
version="3.1.2",
url="https://github.com/chanzuckerberg/single-cell-curation",
license="MIT",
author="Chan Zuckerberg Initiative",
Expand Down
11 changes: 9 additions & 2 deletions cellxgene_schema_cli/tests/fixtures/examples_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@
# ---
# 3. Creating individual uns component
good_uns = {
"title": "A title",
"default_embedding": "X_umap",
"X_approximate_distribution": "normal",
"batch_condition": ["is_primary_data"],
}

good_uns_with_labels = {
"schema_version": SCHEMA_VERSION,
"title": "A title",
"default_embedding": "X_umap",
Expand Down Expand Up @@ -213,7 +220,7 @@
X=sparse.csr_matrix(X),
obs=pd.concat([good_obs, obs_expected], axis=1),
var=var_expected,
uns=good_uns,
uns=good_uns_with_labels,
obsm=good_obsm,
)

Expand Down Expand Up @@ -270,7 +277,7 @@
adata_with_lables_unmigrated = anndata.AnnData(
X=sparse.csr_matrix(unmigrated_X),
obs=umigrated_obs,
uns=good_uns,
uns=good_uns_with_labels,
var=var_unmigrated,
obsm={"X_umap": numpy.zeros([unmigrated_X.shape[0], 2])},
)
Expand Down
1 change: 0 additions & 1 deletion cellxgene_schema_cli/tests/test_schema_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,6 @@ def test_optional_fields_schema_version_is_old(self):
def test_optional_fields_schema_version_is_missing(self):
latest_version = "1.0.0"
self.validator.schema_version = None
del self.validator.adata.uns["schema_version"]
with patch(
"cellxgene_schema.validate.schema.get_schema_versions_supported", return_value=[latest_version]
) as mock_supported_versions, patch(
Expand Down

0 comments on commit 7fc0971

Please sign in to comment.