Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema Refactor: Create tests for DataModelEdges #1306

Merged
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0036db0
add docstring for cases to test
GiaJordan Sep 25, 2023
a374f99
add self loop to validation test model
GiaJordan Sep 28, 2023
9c7bd06
add slots for other tests
GiaJordan Sep 28, 2023
247b63a
add test to ensure self loop edges are not added
GiaJordan Sep 28, 2023
269ca0f
change edge checking
GiaJordan Sep 28, 2023
dcf4872
make a deepcopy
GiaJordan Sep 28, 2023
bedda93
add test for adding edges
GiaJordan Sep 29, 2023
1be618d
WIP add test for edge weights
GiaJordan Sep 29, 2023
02b1c61
add comments
GiaJordan Oct 10, 2023
8e21b6c
add weight checks in test
GiaJordan Oct 10, 2023
368834a
change test case
GiaJordan Oct 10, 2023
5cc5a2c
update expected schema validator errors
GiaJordan Oct 10, 2023
50344b4
update example and test model with new component
GiaJordan Oct 10, 2023
6af0009
add test for property weights
GiaJordan Oct 10, 2023
1044c39
remove `cohorts` component from test models
GiaJordan Oct 11, 2023
026862e
create new model for component w/ properties
GiaJordan Oct 11, 2023
1c4b880
parametrize data model path
GiaJordan Oct 11, 2023
5c5991c
remove print statement
GiaJordan Oct 11, 2023
dfc5ca3
use DMR fixture, change name cap
GiaJordan Oct 11, 2023
2ab025e
add fixture for DataModelEdges object
GiaJordan Oct 11, 2023
af51f09
use dataModelParser helper fxn
GiaJordan Oct 11, 2023
a7a9e7c
change df column names
GiaJordan Oct 11, 2023
47a49fb
change assertion logic to explicitly check that nodes were added
GiaJordan Oct 11, 2023
f7f7e58
update comments and log message
GiaJordan Oct 11, 2023
641748f
clean spacing / update comments
GiaJordan Oct 11, 2023
ec06372
Revert "update expected schema validator errors"
GiaJordan Oct 11, 2023
0271f7f
Revert "Revert "update expected schema validator errors""
GiaJordan Oct 11, 2023
27cb86b
change fixture name
GiaJordan Oct 18, 2023
b58a185
remove returns
GiaJordan Oct 18, 2023
5321ff3
add comment on negative weight
GiaJordan Oct 18, 2023
d0287ef
change var cap
GiaJordan Oct 18, 2023
8b843ee
add note on self loop error
GiaJordan Oct 19, 2023
531d476
Merge branch 'develop-refactor-schemas' into develop-generate-edge-te…
mialy-defelice Oct 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/data/example.model.csv
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ Check Date,,,,,TRUE,DataProperty,,,date
Check NA,,,,,TRUE,DataProperty,,,int::IsNA
MockRDB,,,"Component, MockRDB_id, SourceManifest",,FALSE,DataType,,,
MockRDB_id,,,,,TRUE,DataProperty,,,int
SourceManifest,,,,,TRUE,DataProperty,,,
SourceManifest,,,,,TRUE,DataProperty,,,
34 changes: 34 additions & 0 deletions tests/data/example.model.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Patient",
"sms:required": "sms:sms:false",
"sms:requiresDependency": [
{
"@id": "bts:PatientID"
Expand Down Expand Up @@ -99,6 +100,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Year of Birth",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand Down Expand Up @@ -140,6 +142,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Component",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -156,6 +159,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "DataType",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -172,6 +176,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "DataProperty",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -188,6 +193,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Female",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -204,6 +210,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Male",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -220,6 +227,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Other",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -239,6 +247,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Healthy",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -258,6 +267,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Cancer",
"sms:required": "sms:sms:false",
"sms:requiresDependency": [
{
"@id": "bts:CancerType"
Expand Down Expand Up @@ -352,6 +362,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "ValidValue",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -371,6 +382,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Breast",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -390,6 +402,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Colorectal",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -409,6 +422,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Lung",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -428,6 +442,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Prostate",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -447,6 +462,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Skin",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -463,6 +479,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Biospecimen",
"sms:required": "sms:sms:false",
"sms:requiresComponent": [
{
"@id": "bts:Patient"
Expand Down Expand Up @@ -540,6 +557,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Malignant",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -556,6 +574,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Bulk RNA-seq Assay",
"sms:required": "sms:sms:false",
"sms:requiresComponent": [
{
"@id": "bts:Biospecimen"
Expand Down Expand Up @@ -639,6 +658,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "FASTQ",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -658,6 +678,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "BAM",
"sms:required": "sms:sms:false",
"sms:requiresDependency": [
{
"@id": "bts:GenomeBuild"
Expand All @@ -682,6 +703,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "CRAM",
"sms:required": "sms:sms:false",
"sms:requiresDependency": [
{
"@id": "bts:GenomeBuild"
Expand Down Expand Up @@ -709,6 +731,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "CSV/TSV",
"sms:required": "sms:sms:false",
"sms:requiresDependency": [
{
"@id": "bts:GenomeBuild"
Expand Down Expand Up @@ -778,6 +801,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "GRCh37",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -794,6 +818,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "GRCh38",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -810,6 +835,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "GRCm38",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -826,6 +852,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "GRCm39",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -842,6 +869,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "MockComponent",
"sms:required": "sms:sms:false",
"sms:requiresDependency": [
{
"@id": "bts:Component"
Expand Down Expand Up @@ -1204,6 +1232,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "Check Recommended",
"sms:required": "sms:sms:false",
"sms:validationRules": [
"recommended"
]
Expand Down Expand Up @@ -1318,6 +1347,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "ab",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -1334,6 +1364,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "cd",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -1350,6 +1381,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "ef",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -1366,6 +1398,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "gh",
"sms:required": "sms:sms:false",
"sms:validationRules": []
},
{
Expand All @@ -1382,6 +1415,7 @@
"@id": "http://schema.biothings.io"
},
"sms:displayName": "MockRDB",
"sms:required": "sms:sms:false",
"sms:requiresDependency": [
{
"@id": "bts:Component"
Expand Down
6 changes: 6 additions & 0 deletions tests/data/properties.test.model.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Attribute,Description,Valid Values,DependsOn,Properties,Required,Parent,DependsOn Component,Source,Validation Rules
cohorts,,,"Component, dataset_id, cohort_tag_id, id","name, dataset_id, cohort_tag_id, id",FALSE,,,,
cohort_tag_id,,,,,FALSE,,,,matchAtLeastOne tags.id set error
name,,,,,FALSE,,,,
dataset_id,,,,,FALSE,,,,
id,,,,,FALSE,,,,
4 changes: 2 additions & 2 deletions tests/data/validator_dag_test.model.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Patient,,,"Patient ID, Sex, Year of Birth, Diagnosis, Component",,FALSE,DataType
Patient ID,,,Patient,,TRUE,DataProperty,,,
Sex,,"Female, Male, Other",,,TRUE,DataProperty,,,
Year of Birth,,,,,FALSE,DataProperty,,,
Diagnosis,,"Healthy, Cancer",,,TRUE,DataProperty,,,
Diagnosis,,"Healthy, Cancer, Diagnosis",,,TRUE,DataProperty,,,
Cancer,,,"Cancer Type, Family History",,FALSE,ValidValue,,,
Cancer Type,,"Breast, Colorectal, Lung, Prostate, Skin",,,TRUE,DataProperty,,,
Family History,,"Breast, Colorectal, Lung, Prostate, Skin",Cancer Type,,TRUE,DataProperty,,,list strict
Expand Down Expand Up @@ -41,4 +41,4 @@ Check Date,,,,,TRUE,DataProperty,,,date
Check NA,,,,,TRUE,DataProperty,,,int::IsNA
MockRDB,,,"Component, MockRDB_id, SourceManifest",,FALSE,DataType,,,
MockRDB_id,,,,,TRUE,DataProperty,,,int
SourceManifest,,,,,TRUE,DataProperty,,,
SourceManifest,,,,,TRUE,DataProperty,,,
Loading