Skip to content

Commit

Permalink
Merge pull request #132 from nipreps/rel/24.0.0
Browse files Browse the repository at this point in the history
REL: 24.0.0
  • Loading branch information
oesteban authored Aug 25, 2024
2 parents a45e814 + 671aec5 commit 42e4552
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 87 deletions.
5 changes: 5 additions & 0 deletions .maint/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
1 change: 1 addition & 0 deletions .maint/FORMER.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
110 changes: 44 additions & 66 deletions .maint/update_authors.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -125,27 +111,31 @@ 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]


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", "<Unknown Name>")
retval.append(i)
return retval

Expand All @@ -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")
Expand All @@ -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"] != "<Unknown 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:
Expand All @@ -211,15 +196,19 @@ 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"]:
creator.pop("handle", None)
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))
Expand All @@ -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")
Expand All @@ -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

Expand Down Expand Up @@ -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)])
)


Expand Down
66 changes: 45 additions & 21 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -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": "<p>The visual report system (VRS) of <em>NiPreps</em>.</p>",
Expand Down
42 changes: 42 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 42e4552

Please sign in to comment.