Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceyan committed Feb 4, 2025
1 parent 11b0da2 commit 69ad6a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cellxgene_schema_cli/cellxgene_schema/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def is_valid_row(row):
"NCBITaxon:7227": ("FBbt", "UBERON"),
}
always_allowed_prefix = "UBERON"

if row[tissue_type_column] == "cell culture":
if row[tissue_column] == "unknown":
return True
Expand Down
14 changes: 9 additions & 5 deletions cellxgene_schema_cli/tests/test_schema_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2961,12 +2961,14 @@ def test_cell_culture_tissue_ontology_term_id(self, validator_with_zebrafish_ada
obs.loc[obs.index[0], "tissue_ontology_term_id"] = tissue_ontology_term_id
validator.validate_adata()
assert not validator.errors

def test_cell_culture_tissue_ontology_term_id_invalid(self, validator_with_zebrafish_adata):
validator = validator_with_zebrafish_adata
obs = validator.adata.obs
obs.loc[obs.index[0], "tissue_type"] = "cell culture"
obs.loc[obs.index[0], "tissue_ontology_term_id"] = "UBERON:0002048" # only valid UBERON term if not cell culture
obs.loc[obs.index[0], "tissue_ontology_term_id"] = (
"UBERON:0002048" # only valid UBERON term if not cell culture
)
validator.validate_adata()
assert len(validator.errors) > 0

Expand Down Expand Up @@ -3150,12 +3152,14 @@ def test_cell_culture_tissue_ontology_term_id(self, validator_with_fruitfly_adat
obs.loc[obs.index[0], "tissue_ontology_term_id"] = tissue_ontology_term_id
validator.validate_adata()
assert not validator.errors

def test_cell_culture_tissue_ontology_term_id_invalid(self, validator_with_fruitfly_adata):
validator = validator_with_fruitfly_adata
obs = validator.adata.obs
obs.loc[obs.index[0], "tissue_type"] = "cell culture"
obs.loc[obs.index[0], "tissue_ontology_term_id"] = "UBERON:0002048" # only valid UBERON term if not cell culture
obs.loc[obs.index[0], "tissue_ontology_term_id"] = (
"UBERON:0002048" # only valid UBERON term if not cell culture
)
validator.validate_adata()
assert len(validator.errors) > 0

Expand Down Expand Up @@ -3374,7 +3378,7 @@ def test_cell_culture_tissue_ontology_term_id(self, validator_with_roundworm_ada
obs.loc[obs.index[0], "tissue_ontology_term_id"] = tissue_ontology_term_id
validator.validate_adata()
assert not validator.errors

def test_cell_culture_tissue_ontology_term_id_invalid(self, validator_with_roundworm_adata):
validator = validator_with_roundworm_adata
obs = validator.adata.obs
Expand Down

0 comments on commit 69ad6a3

Please sign in to comment.