Skip to content

Commit

Permalink
Merge pull request #46 from hubmapconsortium/phillips/multi_assay_ref…
Browse files Browse the repository at this point in the history
…actor

Update to accommodate multi-assay
  • Loading branch information
gesinaphillips authored Feb 26, 2024
2 parents 39be208 + ee0ebc7 commit 93a301c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/ingest_validation_tests/codex_common_errors_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ class CodexCommonErrorsValidator(Validator):

description = "Test for common problems found in CODEX"
cost = 1.0
required = "codex"

def collect_errors(self, **kwargs) -> List[str]:
"""
Return the errors found by this validator
"""
del kwargs
if self.assay_type != "CODEX":
if self.required not in self.contains and self.assay_type.lower() != self.required:
return [] # We only test CODEX data
rslts = []
for path in self.paths:
Expand Down
5 changes: 3 additions & 2 deletions src/ingest_validation_tests/codex_json_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
class CodexJsonValidator(Validator):
description = "Check CODEX JSON against schema"
cost = 1.0
required = "codex"

def collect_errors(self, **kwargs) -> List[str]:
del kwargs
if "codex" not in self.assay_type.lower():
return []
if self.required not in self.contains and self.assay_type.lower() != self.required:
return [] # We only test CODEX data

schema_path = Path(__file__).parent / "codex_schema.json"
schema = json.loads(schema_path.read_text())
Expand Down
3 changes: 2 additions & 1 deletion src/ingest_validation_tests/publication_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ class PublicationValidator(Validator):
cost = 1.0
base_url_re = r"(\s*\{\{\s*base_url\s*\}\})/(.*)"
url_re = r"[Uu][Rr][Ll]"
required = "publication"

def collect_errors(self, **kwargs) -> List[str]:
"""
Return the errors found by this validator
"""
del kwargs
if self.assay_type != "Publication":
if self.required not in self.contains and self.assay_type.lower() != self.required:
return [] # We only test Publication data
rslt = []
for path in self.paths:
Expand Down

0 comments on commit 93a301c

Please sign in to comment.