From 9f6f54e4465c000916cc14ab6c826e61f2c555c5 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sun, 25 Aug 2024 14:34:18 +0200 Subject: [PATCH 1/4] rel(24.0.0): Update CHANGES [skip ci] --- CHANGES.rst | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index ab27a29f..fdf4f3ae 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,45 @@ +24.0.0 (August 25, 2024) +======================== +The new release series includes a fair share of maintenance, style, and documentation improvements. +It also includes some bugfixes, one very relevant as memory consumption may have been overseen for a +long while because many reporters were not closing their *matplotlib* figures. +Finally, several relevant features, such as new DWI plotting tools, have been included. + +CHANGES +------- + +* FIX: Set max height and overflow css for qcrating widget by @rwblair in https://github.com/nipreps/nireports/pull/117 +* FIX: Address memory issues and corruption in ``fMRIPlot`` by @oesteban in https://github.com/nipreps/nireports/pull/131 +* ENH: Add gradient plot method by @jhlegarreta in https://github.com/nipreps/nireports/pull/96 +* ENH: Set the ``seaborn`` barplot ``hue`` property value by @jhlegarreta in https://github.com/nipreps/nireports/pull/100 +* ENH: Add DWI volume plot method by @jhlegarreta in https://github.com/nipreps/nireports/pull/101 +* ENH: Add raincloud plot capabilities by @jhlegarreta in https://github.com/nipreps/nireports/pull/118 +* ENH: Higher-level carpetplot tooling for DWI by @teresamg in https://github.com/nipreps/nireports/pull/119 +* DOC: Update *Readthedocs* and package's docs dependencies by @oesteban in https://github.com/nipreps/nireports/pull/97 +* DOC: Misc documentation and style fixes by @jhlegarreta in https://github.com/nipreps/nireports/pull/102 +* DOC: Fix ``dwi`` module function cross ref in docstring by @jhlegarreta in https://github.com/nipreps/nireports/pull/103 +* MAINT: Fix ``matplotlib.cm.get_cmap`` deprecation by @DimitriPapadopoulos in https://github.com/nipreps/nireports/pull/98 +* MAINT: Consistently use ``matplotlib.colormaps`` in ``mpl`` namespace by @effigies in https://github.com/nipreps/nireports/pull/104 +* MAINT: Add CI badges to ``README`` by @jhlegarreta in https://github.com/nipreps/nireports/pull/111 +* MAINT: Add PyPI badge to ``README`` by @jhlegarreta in https://github.com/nipreps/nireports/pull/112 +* MAINT: Add license badge to ``README`` by @jhlegarreta in https://github.com/nipreps/nireports/pull/113 +* MAINT: Pacify *ruff* by @oesteban in https://github.com/nipreps/nireports/pull/123 +* MAINT: *Numpy* 2.0 compatibility by @effigies in https://github.com/nipreps/nireports/pull/127 +* STY: Apply ruff/flake8-implicit-str-concat rule ISC001 by @DimitriPapadopoulos in https://github.com/nipreps/nireports/pull/99 +* STY: Make coverage badge be last in ``README`` badge list by @jhlegarreta in https://github.com/nipreps/nireports/pull/116 +* STY: Transition to *ruff* for code formatting by @jhlegarreta in https://github.com/nipreps/nireports/pull/114 +* STY: Fix style in ``update_authors.py`` by @jhlegarreta in https://github.com/nipreps/nireports/pull/115 + +New Contributors +---------------- + +* @jhlegarreta made their first contribution in https://github.com/nipreps/nireports/pull/96 +* @teresamg made their first contribution in https://github.com/nipreps/nireports/pull/119 +* @rwblair made their first contribution in https://github.com/nipreps/nireports/pull/117 + +**Full Changelog**: https://github.com/nipreps/nireports/compare/23.2.2...24.0.0 + + 23.2.2 (August 19, 2024) ======================== Bug-fix release in the 23.2.x series. From 8682977de5d6a4399655b8431d58aa8bbbf46bd1 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sun, 25 Aug 2024 14:42:06 +0200 Subject: [PATCH 2/4] maint: add contributors to contributors file @teresamg, @jhlegarreta, @DimitriPapadopoulos, @arokem, and @tsalo -- I've taken the liberty of adding you to the contributors file (copied your data from MRIQC). Please let me know if that's okay and whether your data are current and correct. Thanks for your contributions!! --- .maint/CONTRIBUTORS.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.maint/CONTRIBUTORS.md b/.maint/CONTRIBUTORS.md index ef20a7cc..1398789a 100644 --- a/.maint/CONTRIBUTORS.md +++ b/.maint/CONTRIBUTORS.md @@ -10,6 +10,11 @@ Before every release, unlisted contributors will be invited again to add their n | --- | --- | --- | --- | --- | | Baratz | Zvi | @ZviBaratz | 0000-0001-7159-1387 | Sagol School of Neuroscience, Tel Aviv University, Tel Aviv, Israel | | Blair | Ross W. | @rwblair | 0000-0003-3007-1056 | Department of Psychology, Stanford University, CA, USA | +| Gomez | Teresa | @teresamg | | The University of Washington eScience Institute, WA, USA | | Goncalves | Mathias | @mgxd | 0000-0002-7252-7771 | Department of Psychology, Stanford University, CA, USA | +| Legarreta Gorroño | Jon Haitz | @jhlegarreta | 0000-0002-9661-1396 | Brigham and Women's Hospital, Mass General Brigham, Harvard Medical School, MA, USA | | Markiewicz | Christopher J. | @effigies | 0000-0002-6533-164X | Department of Psychology, Stanford University, CA, USA | | Nielson | Dylan | @Shotgunosine | 0000-0003-4613-6643 | Section on Clinical and Computational Psychiatry, National Institute of Mental Health, Bethesda, MD, USA | +| Papadopoulos Orfanos | Dimitri | @DimitriPapadopoulos | 0000-0002-1242-8990 | NeuroSpin, CEA, Université Paris-Saclay, NeuroSpin, Gif-sur-Yvette, France | +| Rokem | Ariel | @arokem | 0000-0003-0679-1985 | The University of Washington eScience Institute, WA, USA | +| Salo | Taylor | @tsalo | 0000-0001-9813-3167 | Department of Psychology, Florida International University, FL, USA | From 78db0ae685a5d17282a83f23bdb65691080cb8da Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sun, 25 Aug 2024 14:44:04 +0200 Subject: [PATCH 3/4] maint: update author-crediting script --- .maint/FORMER.md | 1 + .maint/update_authors.py | 110 ++++++++++++++++----------------------- 2 files changed, 45 insertions(+), 66 deletions(-) mode change 100644 => 100755 .maint/update_authors.py diff --git a/.maint/FORMER.md b/.maint/FORMER.md index bd0ccd8b..a45eed1a 100644 --- a/.maint/FORMER.md +++ b/.maint/FORMER.md @@ -9,3 +9,4 @@ Should you desire to be considered back as a contributor or maintainer, please r | Berleant | Shoshana | @shosber | | Bot | NiPreps | @nipreps-bot | | Gorgolewski | Krzysztof J. | @chrisgorgo | +| | dependabot[bot] | @dependabot | diff --git a/.maint/update_authors.py b/.maint/update_authors.py old mode 100644 new mode 100755 index a7191c1e..ff0f3190 --- a/.maint/update_authors.py +++ b/.maint/update_authors.py @@ -49,12 +49,19 @@ def read_md_table(md_text): break values = [v.strip() or None for v in line.split("|")][1:-1] - retval.append({k: v for k, v in zip(keys, values, strict=True) if v}) + retval.append({k: v for k, v in zip(keys, values) if v}) return retval -def _extract_git_contributor_matches(git_lines, sorted_authors, first_last, first_last_excl): +def sort_contributors(entries, git_lines, exclude=None, last=None): + """Return a list of author dictionaries, ordered by contribution.""" + last = last or [] + sorted_authors = sorted(entries, key=lambda i: i["name"]) + + first_last = [" ".join(val["name"].split(",")[::-1]).strip() for val in sorted_authors] + first_last_excl = [" ".join(val["name"].split(",")[::-1]).strip() for val in exclude or []] + unmatched = [] author_matches = [] for ele in git_lines: @@ -71,38 +78,17 @@ def _extract_git_contributor_matches(git_lines, sorted_authors, first_last, firs if val not in author_matches: author_matches.append(val) - return author_matches, unmatched - - -def _get_position_matches(author_matches): - position_matches = [] - for i, item in enumerate(author_matches): - pos = item.pop("position", None) - if pos is not None: - position_matches.append((i, int(pos))) - - return position_matches - - -def sort_contributors(entries, git_lines, exclude=None, last=None): - """Return a list of author dictionaries, ordered by contribution.""" - last = last or [] - sorted_authors = sorted(entries, key=lambda i: i["name"]) - - first_last = [" ".join(val["name"].split(",")[::-1]).strip() for val in sorted_authors] - first_last_excl = [" ".join(val["name"].split(",")[::-1]).strip() for val in exclude or []] - - author_matches, unmatched = _extract_git_contributor_matches( - git_lines, sorted_authors, first_last, first_last_excl - ) - names = {" ".join(val["name"].split(",")[::-1]).strip() for val in author_matches} for missing_name in first_last: if missing_name not in names: missing = sorted_authors[first_last.index(missing_name)] author_matches.append(missing) - position_matches = _get_position_matches(author_matches) + position_matches = [] + for i, item in enumerate(author_matches): + pos = item.pop("position", None) + if pos is not None: + position_matches.append((i, int(pos))) for i, pos in position_matches: if pos < 0: @@ -125,20 +111,22 @@ def get_git_lines(fname="line-contributors.txt"): lines = contrib_file.read_text().splitlines() git_line_summary_path = shutil.which("git-line-summary") + if not git_line_summary_path: + git_line_summary_path = "git summary --dedup-by-email".split(" ") + else: + git_line_summary_path = [git_line_summary_path] + if not lines and git_line_summary_path: print("Running git-line-summary on repo") - lines = sp.check_output([git_line_summary_path]).decode().splitlines() - lines = [ele for ele in lines if "Not Committed Yet" not in ele] + lines = sp.check_output(git_line_summary_path).decode().splitlines() + lines = [line for line in lines if "Not Committed Yet" not in line] contrib_file.write_text("\n".join(lines)) if not lines: - raise RuntimeError( - """\ -Could not find line-contributors from git repository.%s""" - % """ \ -git-line-summary not found, please install git-extras. """ - * (git_line_summary_path is None) + _msg = ": git-line-summary not found, please install git-extras " * ( + git_line_summary_path is None ) + raise RuntimeError(f"Could not find line-contributors from git repository{_msg}.") return [" ".join(line.strip().split()[1:-1]) for line in lines if "%" in line] @@ -146,6 +134,8 @@ def _namelast(inlist): retval = [] for i in inlist: i["name"] = (f"{i.pop('name', '')} {i.pop('lastname', '')}").strip() + if not i["name"]: + i["name"] = i.get("handle", "") retval.append(i) return retval @@ -160,10 +150,7 @@ def cli(): @click.option("-z", "--zenodo-file", type=click.Path(exists=True), default=".zenodo.json") @click.option("-m", "--maintainers", type=click.Path(exists=True), default=".maint/MAINTAINERS.md") @click.option( - "-c", - "--contributors", - type=click.Path(exists=True), - default=".maint/CONTRIBUTORS.md", + "-c", "--contributors", type=click.Path(exists=True), default=".maint/CONTRIBUTORS.md" ) @click.option("--pi", type=click.Path(exists=True), default=".maint/PIs.md") @click.option("-f", "--former-file", type=click.Path(exists=True), default=".maint/FORMER.md") @@ -190,15 +177,13 @@ def zenodo( _namelast(read_md_table(Path(contributors).read_text())), data, exclude=former ) - zen_pi = _namelast( - sorted( - read_md_table(Path(pi).read_text()), - key=lambda v: (int(v.get("position", -1)), v.get("lastname")), - ) - ) + zen_pi = _namelast(reversed(read_md_table(Path(pi).read_text()))) zenodo["creators"] = zen_creators - zenodo["contributors"] = zen_contributors + zen_pi + zenodo["contributors"] = zen_contributors + [pi for pi in zen_pi if pi not in zen_contributors] + creator_names = {c["name"] for c in zenodo["creators"] if c["name"] != ""} + + zenodo["contributors"] = [c for c in zenodo["contributors"] if c["name"] not in creator_names] misses = set(miss_creators).intersection(miss_contributors) if misses: @@ -211,7 +196,9 @@ def zenodo( for creator in zenodo["creators"]: creator.pop("position", None) creator.pop("handle", None) - if isinstance(creator["affiliation"], list): + if "affiliation" not in creator: + creator["affiliation"] = "Unknown affiliation" + elif isinstance(creator["affiliation"], list): creator["affiliation"] = creator["affiliation"][0] for creator in zenodo["contributors"]: @@ -219,7 +206,9 @@ def zenodo( creator["type"] = "Researcher" creator.pop("position", None) - if isinstance(creator["affiliation"], list): + if "affiliation" not in creator: + creator["affiliation"] = "Unknown affiliation" + elif isinstance(creator["affiliation"], list): creator["affiliation"] = creator["affiliation"][0] Path(zenodo_file).write_text("%s\n" % json.dumps(zenodo, indent=2)) @@ -228,10 +217,7 @@ def zenodo( @cli.command() @click.option("-m", "--maintainers", type=click.Path(exists=True), default=".maint/MAINTAINERS.md") @click.option( - "-c", - "--contributors", - type=click.Path(exists=True), - default=".maint/CONTRIBUTORS.md", + "-c", "--contributors", type=click.Path(exists=True), default=".maint/CONTRIBUTORS.md" ) @click.option("--pi", type=click.Path(exists=True), default=".maint/PIs.md") @click.option("-f", "--former-file", type=click.Path(exists=True), default=".maint/FORMER.md") @@ -245,20 +231,15 @@ def publication( members = _namelast(read_md_table(Path(maintainers).read_text())) + _namelast( read_md_table(Path(contributors).read_text()) ) + former_names = _namelast(read_md_table(Path(former_file).read_text())) hits, misses = sort_contributors( members, get_git_lines(), - exclude=_namelast(read_md_table(Path(former_file).read_text())), - ) - - pi_hits = _namelast( - sorted( - read_md_table(Path(pi).read_text()), - key=lambda v: (int(v.get("position", -1)), v.get("lastname")), - ) + exclude=former_names, ) + pi_hits = _namelast(reversed(read_md_table(Path(pi).read_text()))) pi_names = [pi["name"] for pi in pi_hits] hits = [hit for hit in hits if hit["name"] not in pi_names] + pi_hits @@ -295,16 +276,13 @@ def _aslist(value): print( "%s." % "; ".join( - [ - "%s \\ :sup:`%s`\\ " % (i["name"], idx) - for i, idx in zip(hits, aff_indexes, strict=True) - ] + ["{} \\ :sup:`{}`\\ ".format(i["name"], idx) for i, idx in zip(hits, aff_indexes)] ) ) print( "\n\nAffiliations:\n%s" - % "\n".join(["{0: >2}. {1}".format(i + 1, a) for i, a in enumerate(affiliations)]) + % "\n".join([f"{i + 1: >2}. {a}" for i, a in enumerate(affiliations)]) ) From 671aec51d05260ec8ae9314ca4c2290a57bb0e01 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sun, 25 Aug 2024 14:44:45 +0200 Subject: [PATCH 4/4] rel(24.0.0): Update zenodo [skip ci] --- .zenodo.json | 66 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 21 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index da6b10e5..bf1bc5f4 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,68 +1,92 @@ { "contributors": [ { + "orcid": "0000-0002-6533-164X", "affiliation": "Department of Psychology, Stanford University, CA, USA", "name": "Christopher J. Markiewicz", - "orcid": "0000-0002-6533-164X", "type": "Researcher" }, { + "orcid": "0000-0001-7159-1387", "affiliation": "Sagol School of Neuroscience, Tel Aviv University, Tel Aviv, Israel", "name": "Zvi Baratz", - "orcid": "0000-0001-7159-1387", "type": "Researcher" }, { + "orcid": "0000-0002-7252-7771", "affiliation": "Department of Psychology, Stanford University, CA, USA", "name": "Mathias Goncalves", - "orcid": "0000-0002-7252-7771", "type": "Researcher" }, { + "orcid": "0000-0002-9661-1396", + "affiliation": "Brigham and Women's Hospital, Mass General Brigham, Harvard Medical School, MA, USA", + "name": "Jon Haitz Legarreta Gorro\u00f1o", + "type": "Researcher" + }, + { + "affiliation": "The University of Washington eScience Institute, WA, USA", + "name": "Teresa Gomez", + "type": "Researcher" + }, + { + "orcid": "0000-0001-9813-3167", + "affiliation": "Department of Psychology, Florida International University, FL, USA", + "name": "Taylor Salo", + "type": "Researcher" + }, + { + "orcid": "0000-0003-3007-1056", "affiliation": "Department of Psychology, Stanford University, CA, USA", "name": "Ross W. Blair", - "orcid": "0000-0003-3007-1056", "type": "Researcher" }, { - "affiliation": "Section on Clinical and Computational Psychiatry, National Institute of Mental Health, Bethesda, MD, USA", - "name": "Dylan Nielson", - "orcid": "0000-0003-4613-6643", + "orcid": "0000-0002-1242-8990", + "affiliation": "NeuroSpin, CEA, Universit\u00e9 Paris-Saclay, NeuroSpin, Gif-sur-Yvette, France", + "name": "Dimitri Papadopoulos Orfanos", "type": "Researcher" }, { - "affiliation": "Department of Radiology, Lausanne University Hospital and University of Lausanne", - "name": "Oscar Esteban", - "orcid": "0000-0001-8435-6191", + "orcid": "0000-0003-0679-1985", + "affiliation": "The University of Washington eScience Institute, WA, USA", + "name": "Ariel Rokem", "type": "Researcher" }, { + "orcid": "0000-0003-4613-6643", + "affiliation": "Section on Clinical and Computational Psychiatry, National Institute of Mental Health, Bethesda, MD, USA", + "name": "Dylan Nielson", + "type": "Researcher" + }, + { + "orcid": "0000-0001-6755-0259", "affiliation": "Department of Psychology, Stanford University, CA, USA", "name": "Russell A. Poldrack", - "orcid": "0000-0001-6755-0259", "type": "Researcher" } ], "creators": [ { + "orcid": "0000-0001-8435-6191", "affiliation": "Lausanne University Hospital and University of Lausanne, Lausanne, Switzerland", - "name": "Oscar Esteban", - "orcid": "0000-0001-8435-6191" + "name": "Oscar Esteban" }, { + "orcid": "0000-0002-3896-6906", "affiliation": "Department of Radiology, Lausanne University Hospital and University of Lausanne, Switzerland", - "name": "Elodie Savary", - "orcid": "0000-0002-3896-6906" + "name": "Elodie Savary" }, { - "affiliation": "Department of Neuroimaging, Institute of Psychiatry, Psychology and Neuroscience, King's College London, London, UK", - "name": "Eilidh MacNicol", - "orcid": "0000-0003-3715-7012" + "orcid": "0000-0002-1668-9629", + "affiliation": "Department of Radiology, Lausanne University Hospital and University of Lausanne, Switzerland", + "name": "C\u00e9line Provins" }, { - "affiliation": "Department of Radiology, Lausanne University Hospital and University of Lausanne, Switzerland", - "name": "C\u00e9line Provins", - "orcid": "0000-0002-1668-9629" + "orcid": "0000-0003-3715-7012", + "affiliation": "Department of Neuroimaging, Institute of Psychiatry, Psychology and Neuroscience, King's College London, London, UK", + "role": "AM (Advisory Member)", + "name": "Eilidh MacNicol" } ], "description": "

The visual report system (VRS) of NiPreps.

",