From 15801d51df6b67137c85c2dd1510bfc089ba9128 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 9 Nov 2024 10:53:53 +0100 Subject: [PATCH 1/7] [DATALAD] Recorded changes --- .zenodo.json | 13 +------------ CITATION.cff | 29 +++++++++++++++++++++++++++++ tmp.py | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 12 deletions(-) create mode 100644 CITATION.cff create mode 100644 tmp.py diff --git a/.zenodo.json b/.zenodo.json index 0621ab94..5156883e 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,13 +1,4 @@ { - "title": "bids-validator", - "description": "The bids-validator is a software tool to check neuroimaging datasets for adherence to the Brain Imaging Data Structure (BIDS) format. More information about BIDS can be found at bids.neuroimaging.io.", - "keywords": [ - "BIDS", - "brain imaging data structure", - "neuroscience", - "neuroimaging", - "neuroinformatics" - ], "creators": [ { "affiliation": "Stanford University", @@ -170,7 +161,5 @@ { "name": "Zulfikar, Wazeer" } - ], - "license": "mit-license", - "upload_type": "software" + ] } diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 00000000..815fa50b --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,29 @@ +# schema: https://github.com/citation-file-format/citation-file-format/blob/main/schema-guide.md + +cff-version: 1.2.0 + +title: bids-validator + +license: mit-license + +type: software + +repository-code: https://github.com/bids-standard/bids-validator + +message: The bids-validator is a software tool to check neuroimaging datasets for adherence to the Brain Imaging Data Structure (BIDS) format. More information about BIDS can be found at bids.neuroimaging.io. + +identifiers: + - description: releases on zenodo + type: doi + value: 10.5281/zenodo.3688707 + +keywords: + - brain imaging data structure + - BIDS + - neuroscience + - neuroimaging + - neuroinformatics + +authors: + - given-names: Aaron + family-names: Oliver-Taylor \ No newline at end of file diff --git a/tmp.py b/tmp.py new file mode 100644 index 00000000..6c1bb611 --- /dev/null +++ b/tmp.py @@ -0,0 +1,35 @@ +import json +from pathlib import Path +import ruamel.yaml +from rich import print + +yaml = ruamel.yaml.YAML() +yaml.indent(mapping=2, sequence=4, offset=2) + + +def load_citation(citation_file: Path) -> dict: + """Load `CITATION.cff` file.""" + with open(citation_file, "r", encoding="utf8") as input_file: + return yaml.load(input_file) + + +def write_citation(citation_file: Path, citation: dict) -> None: + """Write `CITATION.cff` file.""" + with open(citation_file, "w", encoding="utf8") as output_file: + return yaml.dump(citation, output_file) + +with Path(".zenodo.json").open() as f: + zenodo = json.load(f) + +citation = load_citation(Path("CITATION.cff")) +citation["authors"] = [] + +for author in zenodo['creators']: + name = author["name"].split(", ") + author["given-names"] = name[0] + author["family-names"] = name[1] + author.pop("name") + print(author) + + +write_citation(citation[]) \ No newline at end of file From c04429c8695d8995b69fb1a8fb7fa391336b3c98 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 9 Nov 2024 11:07:42 +0100 Subject: [PATCH 2/7] convert zenodo.json --- CITATION.cff | 126 +++++++++++++++++++++++++++++++++++++++++++++++++-- tmp.py | 17 +++++-- 2 files changed, 136 insertions(+), 7 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 815fa50b..f7899286 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -4,7 +4,7 @@ cff-version: 1.2.0 title: bids-validator -license: mit-license +license: MIT type: software @@ -25,5 +25,125 @@ keywords: - neuroinformatics authors: - - given-names: Aaron - family-names: Oliver-Taylor \ No newline at end of file + - family-names: Appelhoff + given-names: Stefan + orcid: 0000-0001-8002-0877 + affiliation: Center for Adaptive Rationality, Max Planck Institute for Human Development, Berlin, Germany + - family-names: Bhogawar + given-names: Suyash + affiliation: Northern California Institute for Research and Education, San Francisco CA + - family-names: Blair + given-names: Ross + orcid: 0000-0003-3007-1056 + affiliation: Stanford University + - family-names: Christian + given-names: Horea + orcid: 0000-0001-7037-2449 + affiliation: MIT + - family-names: Durnez + given-names: Joke + - family-names: Feingold + given-names: Franklin + orcid: 0000-0002-6533-2909 + affiliation: Department of Psychology, Stanford University + - family-names: Gorgolewski + given-names: Krzysztof J. + orcid: 0000-0003-3321-7583 + affiliation: Google + - family-names: Goyal + given-names: Rohan + - family-names: Grass + given-names: Brian + - family-names: Halchenko + given-names: Yaroslav O. + orcid: 0000-0003-3456-2493 + affiliation: Dartmouth College + - family-names: Hanke + given-names: Michael + orcid: 0000-0001-6398-6370 + affiliation: Research Center Jülich; Heinrich-Heine University Düsseldorf + - family-names: Hardcastle + given-names: Nell + orcid: 0000-0002-3837-0707 + affiliation: Squishymedia + - family-names: Hayashi + given-names: Soichi + orcid: 0000-0003-3641-3491 + affiliation: Indiana University + - family-names: Hobson-Lowther + given-names: Teal + - family-names: Holdgraf + given-names: Chris + orcid: 0000-0002-2391-0678 + affiliation: Berkeley Institute for Data Science; University of California at Berkeley + - family-names: Jas + given-names: Mainak + orcid: 0000-0002-3199-9027 + affiliation: AA Martinos Center for Biomedical Imaging, USA + - family-names: Jones + given-names: Alexander + orcid: 0000-0003-2067-3862 + affiliation: University of Texas at San Antonio + - family-names: Kaczmarzyk + given-names: Jakub + orcid: 0000-0002-5544-7577 + affiliation: Stony Brook University School of Medicine + - family-names: Macleod + given-names: Duncan + - family-names: Markiewicz + given-names: Christopher J. + orcid: 0000-0002-6533-164X + affiliation: Stanford University + - family-names: Michael + given-names: Zack + - family-names: Naveau + given-names: Mikaël + orcid: https://orcid.org/0000-0002-4685-0057 + affiliation: CYCERON imaging plateform, Caen, France + - family-names: Nishikawa + given-names: David + - family-names: Noack + given-names: Gregory + - family-names: Oostenveld + given-names: Robert + orcid: 0000-0002-1974-1293 + affiliation: Radboud University + - family-names: Ort + given-names: Eduard + orcid: 0000-0001-5546-3561 + affiliation: Heinrich-Heine University Düsseldorf + - family-names: Papadopoulos + given-names: Dimitri + - family-names: Patterson + given-names: Dianne + - family-names: Poldrack + given-names: Russell + orcid: 0000-0001-6755-0259 + affiliation: Stanford University + - family-names: Riddle + given-names: Travis + orcid: 0000-0001-8160-3986 + affiliation: National Institutes of Health + - family-names: Salo + given-names: Taylor + orcid: 0000-0001-9813-3167 + affiliation: Florida International University + - family-names: Sethi + given-names: Parul + - family-names: Thomas + given-names: Adam + - family-names: Traut + given-names: Nicolas + orcid: 0000-0003-3277-6316 + affiliation: Pasteur Institute + - family-names: Triplett + given-names: William + - family-names: Warren + given-names: David E. + - family-names: Wexler + given-names: Joseph + - family-names: Zito + given-names: Matthew + orcid: 0000-0003-2704-0742 + - family-names: Zulfikar + given-names: Wazeer diff --git a/tmp.py b/tmp.py index 6c1bb611..be6afd87 100644 --- a/tmp.py +++ b/tmp.py @@ -2,9 +2,11 @@ from pathlib import Path import ruamel.yaml from rich import print +import collections yaml = ruamel.yaml.YAML() yaml.indent(mapping=2, sequence=4, offset=2) +yaml.width = 4096 def load_citation(citation_file: Path) -> dict: @@ -24,12 +26,19 @@ def write_citation(citation_file: Path, citation: dict) -> None: citation = load_citation(Path("CITATION.cff")) citation["authors"] = [] +key_order = ["family-names", "given-names", "orcid", "affiliation"] + for author in zenodo['creators']: name = author["name"].split(", ") - author["given-names"] = name[0] - author["family-names"] = name[1] + author["given-names"] = name[1] + author["family-names"] = name[0] author.pop("name") - print(author) + author = {k : author[k] for k in key_order if k in author} + + + citation["authors"].append(author) + +citation["authors"] = sorted(citation["authors"], key=lambda d: d['family-names']) -write_citation(citation[]) \ No newline at end of file +write_citation(Path("CITATION.cff"), citation) \ No newline at end of file From 0edbc6c301bee67a5c325dd503f8fbb8875fd1cb Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 9 Nov 2024 11:07:53 +0100 Subject: [PATCH 3/7] rm files --- .zenodo.json | 165 --------------------------------------------------- tmp.py | 44 -------------- 2 files changed, 209 deletions(-) delete mode 100644 .zenodo.json delete mode 100644 tmp.py diff --git a/.zenodo.json b/.zenodo.json deleted file mode 100644 index 5156883e..00000000 --- a/.zenodo.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "creators": [ - { - "affiliation": "Stanford University", - "name": "Blair, Ross", - "orcid": "0000-0003-3007-1056" - }, - { - "name": "Michael, Zack" - }, - { - "affiliation": "Google", - "name": "Gorgolewski, Krzysztof J.", - "orcid": "0000-0003-3321-7583" - }, - { - "affiliation": "Squishymedia", - "name": "Hardcastle, Nell", - "orcid": "0000-0002-3837-0707" - }, - { - "name": "Hobson-Lowther, Teal" - }, - { - "name": "Nishikawa, David" - }, - { - "name": "Bhogawar, Suyash", - "affiliation": "Northern California Institute for Research and Education, San Francisco CA" - }, - { - "affiliation": "Center for Adaptive Rationality, Max Planck Institute for Human Development, Berlin, Germany", - "name": "Appelhoff, Stefan", - "orcid": "0000-0001-8002-0877" - }, - { - "affiliation": "AA Martinos Center for Biomedical Imaging, USA", - "name": "Jas, Mainak", - "orcid": "0000-0002-3199-9027" - }, - { - "name": "Grass, Brian" - }, - { - "affiliation": "Stanford University", - "name": "Markiewicz, Christopher J.", - "orcid": "0000-0002-6533-164X" - }, - { - "affiliation": "Berkeley Institute for Data Science; University of California at Berkeley", - "name": "Holdgraf, Chris", - "orcid": "0000-0002-2391-0678" - }, - { - "name": "Jones, Alexander", - "affiliation": "University of Texas at San Antonio", - "orcid": "0000-0003-2067-3862" - }, - { - "name": "Goyal, Rohan" - }, - { - "name": "Oostenveld, Robert", - "affiliation": "Radboud University", - "orcid": "0000-0002-1974-1293" - }, - { - "name": "Noack, Gregory" - }, - { - "name": "Triplett, William" - }, - { - "name": "Naveau, Mikaël", - "affiliation": "CYCERON imaging plateform, Caen, France", - "orcid": "https://orcid.org/0000-0002-4685-0057" - }, - { - "name": "Zito, Matthew", - "orcid": "0000-0003-2704-0742" - }, - { - "name": "Durnez, Joke" - }, - { - "affiliation": "Pasteur Institute", - "name": "Traut, Nicolas", - "orcid": "0000-0003-3277-6316" - }, - { - "name": "Sethi, Parul" - }, - { - "affiliation": "Dartmouth College", - "name": "Halchenko, Yaroslav O.", - "orcid": "0000-0003-3456-2493" - }, - { - "name": "Papadopoulos, Dimitri" - }, - { - "name": "Wexler, Joseph" - }, - { - "affiliation": "Florida International University", - "name": "Salo, Taylor", - "orcid": "0000-0001-9813-3167" - }, - { - "name": "Thomas, Adam" - }, - { - "affiliation": "Research Center Jülich; Heinrich-Heine University Düsseldorf", - "name": "Hanke, Michael", - "orcid": "0000-0001-6398-6370" - }, - { - "affiliation": "Indiana University", - "name": "Hayashi, Soichi", - "orcid": "0000-0003-3641-3491" - }, - { - "name": "Warren, David E." - }, - { - "name": "Patterson, Dianne" - }, - { - "name": "Macleod, Duncan" - }, - { - "affiliation": "Heinrich-Heine University Düsseldorf", - "name": "Ort, Eduard", - "orcid": "0000-0001-5546-3561" - }, - { - "name": "Feingold, Franklin", - "affiliation": "Department of Psychology, Stanford University", - "orcid": "0000-0002-6533-2909" - }, - { - "affiliation": "MIT", - "name": "Christian, Horea", - "orcid": "0000-0001-7037-2449" - }, - { - "affiliation": "Stony Brook University School of Medicine", - "name": "Kaczmarzyk, Jakub", - "orcid": "0000-0002-5544-7577" - }, - { - "affiliation": "Stanford University", - "name": "Poldrack, Russell", - "orcid": "0000-0001-6755-0259" - }, - { - "affiliation": "National Institutes of Health", - "name": "Riddle, Travis", - "orcid": "0000-0001-8160-3986" - }, - { - "name": "Zulfikar, Wazeer" - } - ] -} diff --git a/tmp.py b/tmp.py deleted file mode 100644 index be6afd87..00000000 --- a/tmp.py +++ /dev/null @@ -1,44 +0,0 @@ -import json -from pathlib import Path -import ruamel.yaml -from rich import print -import collections - -yaml = ruamel.yaml.YAML() -yaml.indent(mapping=2, sequence=4, offset=2) -yaml.width = 4096 - - -def load_citation(citation_file: Path) -> dict: - """Load `CITATION.cff` file.""" - with open(citation_file, "r", encoding="utf8") as input_file: - return yaml.load(input_file) - - -def write_citation(citation_file: Path, citation: dict) -> None: - """Write `CITATION.cff` file.""" - with open(citation_file, "w", encoding="utf8") as output_file: - return yaml.dump(citation, output_file) - -with Path(".zenodo.json").open() as f: - zenodo = json.load(f) - -citation = load_citation(Path("CITATION.cff")) -citation["authors"] = [] - -key_order = ["family-names", "given-names", "orcid", "affiliation"] - -for author in zenodo['creators']: - name = author["name"].split(", ") - author["given-names"] = name[1] - author["family-names"] = name[0] - author.pop("name") - author = {k : author[k] for k in key_order if k in author} - - - citation["authors"].append(author) - - -citation["authors"] = sorted(citation["authors"], key=lambda d: d['family-names']) - -write_citation(Path("CITATION.cff"), citation) \ No newline at end of file From d4f553c70a59fb9033886d31ce2d46f0ccfd2756 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 9 Nov 2024 11:15:13 +0100 Subject: [PATCH 4/7] validate --- .github/workflows/validation.yml | 28 +++++++++++++++++++ CITATION.cff | 48 +++++++++++++++----------------- 2 files changed, 51 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/validation.yml diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml new file mode 100644 index 00000000..272661bf --- /dev/null +++ b/.github/workflows/validation.yml @@ -0,0 +1,28 @@ +--- +name: Validation + +on: + push: + branches: [main] + pull_request: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + # Validate CITATION.cff + validate_cff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3 + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools + pip3 install cffconvert + - name: Validate CITATION.cff + run: cffconvert --validate diff --git a/CITATION.cff b/CITATION.cff index f7899286..1c015a64 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -27,28 +27,27 @@ keywords: authors: - family-names: Appelhoff given-names: Stefan - orcid: 0000-0001-8002-0877 - affiliation: Center for Adaptive Rationality, Max Planck Institute for Human Development, Berlin, Germany + orcid: https://orcid.org/0000-0001-8002-0877 - family-names: Bhogawar given-names: Suyash affiliation: Northern California Institute for Research and Education, San Francisco CA - family-names: Blair given-names: Ross - orcid: 0000-0003-3007-1056 + orcid: https://orcid.org/0000-0003-3007-1056 affiliation: Stanford University - - family-names: Christian - given-names: Horea - orcid: 0000-0001-7037-2449 + - family-names: Horea + given-names: Christian + orcid: https://orcid.org/0000-0001-7037-2449 affiliation: MIT - family-names: Durnez given-names: Joke - family-names: Feingold given-names: Franklin - orcid: 0000-0002-6533-2909 + orcid: https://orcid.org/0000-0002-6533-2909 affiliation: Department of Psychology, Stanford University - family-names: Gorgolewski given-names: Krzysztof J. - orcid: 0000-0003-3321-7583 + orcid: https://orcid.org/0000-0003-3321-7583 affiliation: Google - family-names: Goyal given-names: Rohan @@ -56,43 +55,42 @@ authors: given-names: Brian - family-names: Halchenko given-names: Yaroslav O. - orcid: 0000-0003-3456-2493 + orcid: https://orcid.org/0000-0003-3456-2493 affiliation: Dartmouth College - family-names: Hanke given-names: Michael - orcid: 0000-0001-6398-6370 + orcid: https://orcid.org/0000-0001-6398-6370 affiliation: Research Center Jülich; Heinrich-Heine University Düsseldorf - family-names: Hardcastle given-names: Nell - orcid: 0000-0002-3837-0707 - affiliation: Squishymedia + orcid: https://orcid.org/0000-0002-3837-0707 - family-names: Hayashi given-names: Soichi - orcid: 0000-0003-3641-3491 + orcid: https://orcid.org/0000-0003-3641-3491 affiliation: Indiana University - family-names: Hobson-Lowther given-names: Teal - family-names: Holdgraf given-names: Chris - orcid: 0000-0002-2391-0678 + orcid: https://orcid.org/0000-0002-2391-0678 affiliation: Berkeley Institute for Data Science; University of California at Berkeley - family-names: Jas given-names: Mainak - orcid: 0000-0002-3199-9027 + orcid: https://orcid.org/0000-0002-3199-9027 affiliation: AA Martinos Center for Biomedical Imaging, USA - family-names: Jones given-names: Alexander - orcid: 0000-0003-2067-3862 + orcid: https://orcid.org/0000-0003-2067-3862 affiliation: University of Texas at San Antonio - family-names: Kaczmarzyk given-names: Jakub - orcid: 0000-0002-5544-7577 + orcid: https://orcid.org/0000-0002-5544-7577 affiliation: Stony Brook University School of Medicine - family-names: Macleod given-names: Duncan - family-names: Markiewicz given-names: Christopher J. - orcid: 0000-0002-6533-164X + orcid: https://orcid.org/0000-0002-6533-164X affiliation: Stanford University - family-names: Michael given-names: Zack @@ -106,11 +104,11 @@ authors: given-names: Gregory - family-names: Oostenveld given-names: Robert - orcid: 0000-0002-1974-1293 + orcid: https://orcid.org/0000-0002-1974-1293 affiliation: Radboud University - family-names: Ort given-names: Eduard - orcid: 0000-0001-5546-3561 + orcid: https://orcid.org/0000-0001-5546-3561 affiliation: Heinrich-Heine University Düsseldorf - family-names: Papadopoulos given-names: Dimitri @@ -118,15 +116,15 @@ authors: given-names: Dianne - family-names: Poldrack given-names: Russell - orcid: 0000-0001-6755-0259 + orcid: https://orcid.org/0000-0001-6755-0259 affiliation: Stanford University - family-names: Riddle given-names: Travis - orcid: 0000-0001-8160-3986 + orcid: https://orcid.org/0000-0001-8160-3986 affiliation: National Institutes of Health - family-names: Salo given-names: Taylor - orcid: 0000-0001-9813-3167 + orcid: https://orcid.org/0000-0001-9813-3167 affiliation: Florida International University - family-names: Sethi given-names: Parul @@ -134,7 +132,7 @@ authors: given-names: Adam - family-names: Traut given-names: Nicolas - orcid: 0000-0003-3277-6316 + orcid: https://orcid.org/0000-0003-3277-6316 affiliation: Pasteur Institute - family-names: Triplett given-names: William @@ -144,6 +142,6 @@ authors: given-names: Joseph - family-names: Zito given-names: Matthew - orcid: 0000-0003-2704-0742 + orcid: https://orcid.org/0000-0003-2704-0742 - family-names: Zulfikar given-names: Wazeer From cab36bfc4ebecf59535217ffc1ab92370aa18fb8 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 9 Nov 2024 11:16:37 +0100 Subject: [PATCH 5/7] add myself --- CITATION.cff | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CITATION.cff b/CITATION.cff index 1c015a64..31595c1d 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -44,7 +44,9 @@ authors: - family-names: Feingold given-names: Franklin orcid: https://orcid.org/0000-0002-6533-2909 - affiliation: Department of Psychology, Stanford University + - family-names: Gau + given-names: Rémi + orcid: https://orcid.org/0000-0002-1535-9767 - family-names: Gorgolewski given-names: Krzysztof J. orcid: https://orcid.org/0000-0003-3321-7583 From d4f38b11c95da1291eac9733111f916f0c9c3615 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 9 Nov 2024 13:05:49 +0100 Subject: [PATCH 6/7] Update .github/workflows/validation.yml Co-authored-by: Chris Markiewicz --- .github/workflows/validation.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 272661bf..565989c6 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -20,9 +20,5 @@ jobs: - uses: actions/setup-python@v5 with: python-version: 3 - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools - pip3 install cffconvert - name: Validate CITATION.cff - run: cffconvert --validate + run: pipx run cffconvert --validate From d1fb2a55efdd4825f75cf943f5d594beb1291f5e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 9 Nov 2024 13:05:56 +0100 Subject: [PATCH 7/7] Update CITATION.cff Co-authored-by: Chris Markiewicz --- CITATION.cff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CITATION.cff b/CITATION.cff index 31595c1d..7282fd9c 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -13,7 +13,7 @@ repository-code: https://github.com/bids-standard/bids-validator message: The bids-validator is a software tool to check neuroimaging datasets for adherence to the Brain Imaging Data Structure (BIDS) format. More information about BIDS can be found at bids.neuroimaging.io. identifiers: - - description: releases on zenodo + - description: Releases on Zenodo type: doi value: 10.5281/zenodo.3688707