Skip to content

Commit

Permalink
🔧 Update arranger config and add exit condition in compareStudiesDupe…
Browse files Browse the repository at this point in the history
…sIfExist script (#228)
  • Loading branch information
evans-g-crsj authored Jan 6, 2025
1 parent 299650b commit f243355
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
34 changes: 24 additions & 10 deletions admin/arrangerProjectConf.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
"isArray": true
}
},
{
"field": "dataset_names",
"graphqlField": "file",
"extendedFieldMappingInput": {
"isArray": true
}
},
{
"field": "files",
"graphqlField": "file",
Expand Down Expand Up @@ -204,42 +211,49 @@
}
},
{
"field": "dataset",
"field": "datasets",
"graphqlField": "study",
"extendedFieldMappingInput": {
"isArray": true
}
},
{
"field": "datasets.access_limitations",
"graphqlField": "study",
"extendedFieldMappingInput": {
"isArray": true
}
},
{
"field": "dataset.access_limitations",
"field": "datasets.access_requirements",
"graphqlField": "study",
"extendedFieldMappingInput": {
"isArray": true
}
},
{
"field": "dataset.access_requirements",
"field": "datasets.data_categories",
"graphqlField": "study",
"extendedFieldMappingInput": {
"isArray": true
}
},
{
"field": "dataset.data_types",
"field": "datasets.data_types",
"graphqlField": "study",
"extendedFieldMappingInput": {
"isArray": true
}
},
{
"field": "dataset.expected_data_categories",
"field": "datasets.expected_data_categories",
"graphqlField": "study",
"extendedFieldMappingInput": {
"isArray": true
}
},
{
"field": "dataset.publications",
"field": "datasets.publications",
"graphqlField": "study",
"extendedFieldMappingInput": {
"isArray": true
Expand Down Expand Up @@ -295,14 +309,14 @@
}
},
{
"field": "publications_details",
"field": "publications",
"graphqlField": "study",
"extendedFieldMappingInput": {
"isArray": true
}
},
{
"field": "publications_details.authors",
"field": "publications_details",
"graphqlField": "study",
"extendedFieldMappingInput": {
"isArray": true
Expand All @@ -316,14 +330,14 @@
}
},
{
"field": "publications_details.issued_date_parts",
"field": "publications_details.authors",
"graphqlField": "study",
"extendedFieldMappingInput": {
"isArray": true
}
},
{
"field": "publications",
"field": "publications_details.issued_date_parts",
"graphqlField": "study",
"extendedFieldMappingInput": {
"isArray": true
Expand Down
7 changes: 7 additions & 0 deletions admin/compareStudiesDupesIfExist.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ const dupes = all
};
}, {});

if (Object.keys(dupes).length === 0) {
console.log(`No duplicates found`);
process.exit(0);
}

console.log('Duplicated Studies: ', Object.keys(dupes).join(', '));

const numberComparisons = Object.entries(dupes).reduce((xs, x) => {
const n = x[1].length;
return xs + binomialCoefficient(n, 2);
Expand Down

0 comments on commit f243355

Please sign in to comment.