Skip to content

Add a protocols.io users report, and fix three things on the figshare one - #543

Merged
robsv merged 5 commits into
mainfrom
feature-protocolsio-users
Oct 9, 2026
Merged

robsv merged 5 commits into
mainfrom
feature-protocolsio-users

Conversation

@robsv

@robsv robsv commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Adds /protocolsio_users under DataCite ▸ protocols.io, the counterpart to
/figshare_users. Also fixes three things on the figshare report, which is
already on main, because this branch touches the same code.

Authors 90 Protocol DOIs 57
Current Janelian 36
Contingent worker 8
No longer at Janelia 25
Unknown 21

It is not quite the same report, and that is forced

protocols.io publishes no user list at all. There is no institution roster,
no user search, and no members endpoint — a workspace exposes a member count
and nothing else. Their only account endpoint returns the caller's own profile.

So where figshare lists its 144 institutional accounts, the available
population here is whoever is credited on a protocol. Some of the unmatched are
genuinely collaborators from elsewhere rather than roster gaps, and the page
says so rather than leaving it to be inferred.

Built from our own records, not their API

Two reasons, and the second was a surprise:

  • Fetching all 50 protocols for their affiliations takes 31.6 seconds
    (measured). That is not a page load. This renders instantly.
  • protocols.io returns no ORCID anywhere in its API, while our Crossref
    copy carries one for 22 authors, 21 of which match the roster outright. Our
    own data is the stronger key.

protocols.io arrives via Crossref, so author keys are given/family rather
than the givenName/familyName a DataCite record uses.

A wrong fuzzy match, found and fixed

The matcher paired Liu Liu → Zhe J. Liu at 95. Different people —
WRatio rewards containment, and the surname appears in both.

Moved to token_sort_ratio, which scores that pair 47 while still reaching
a name written surname-first. The cutoff drops 92 → 85 because the genuine
matches are not close: a dropped middle initial scores 90, an extra given name
88. Verified against both reports — the bad pair is gone, all four real matches
survive.

Names differing by one letter in the surname still score about 91, so every
fuzzy match is labelled with its score for a reader to judge.

Duplicate people are now marked

An orange badge beside the name, tooltip naming the other appearances.

Grouped on the roster record, not the displayed name — which is what
catches the interesting case. One person is credited on protocols.io as
Virginie M S Ruetten, Virginia M S Ruetten, Virginia Ruetten and
Virginie Ruetten, all the same ORCID, and no two of those strings are equal.
A row matching nobody falls back to its own name, so two accounts under one
spelling still pair up.

On figshare this finds two people with two accounts each (Vivek Jayaraman,
Johan Winnubst — one of whose second address is external).

Dark text on the orange, not white: white on #f97316 is 3.6:1, too thin at
this size; #1a1a1a is 6.2:1.

Also fixed on /figshare_users

  • Double-escaped names. Courtney "CJ" Johnson rendered as
    Courtney "CJ" Johnson. render_table escapes any cell not
    wrapped in safe(), so passing escape(name) escaped it twice. Fixed in
    three places — the third, in the acknowledgement metrics table, has the same
    bug and has simply never held a name with a character worth escaping.
    Escaping still happens; it just happens once.
  • Sort order. The two pages disagreed on landing order. Both now sort by
    status, then name. Protocol count remains a sortable column.
  • FIGSHARE_USER_KINDS / FIGSHARE_NAME_CUTOFF become ROSTER_*, since
    neither belongs to figshare now.

Testing

113 tests pass, no new lint messages. Both pages verified against a running
server — bucket counts, badge rendering, tooltip contents, landing order, and
the absence of double-escape markers.

🤖 Generated with Claude Code

@stuarteberg

robsv and others added 5 commits October 8, 2026 15:54
Adds /protocolsio_users under DataCite > protocols.io, the counterpart to
/figshare_users: 90 authors across 57 protocol DOIs - 36 current Janelians,
8 contingent workers, 25 no longer here, 21 unknown.

Drawn from the authors of the protocols we hold rather than from a roll of
accounts, because protocols.io publishes no such roll. Its only account
endpoint returns the caller's own profile; there is no user search, no
institution roster, and no members list - a workspace exposes a member count
and nothing else. So unlike figshare, which lists its institutional accounts,
the available population here is whoever is credited on a protocol, and some
of the unmatched are expected to be collaborators from elsewhere.

Read from our own copy of the Crossref records rather than from protocols.io.
That is both faster and better: fetching each protocol for its affiliation is
fifty calls and half a minute, which is not a page load, and protocols.io
returns no ORCID at all while the Crossref records carry one for 22 authors,
21 of which match the roster outright.

protocols.io arrives from Crossref, so the author keys are given and family
rather than the givenName and familyName a DataCite record uses.

The fuzzy matcher moves from WRatio to token_sort_ratio, which fixes a wrong
match here and keeps the right ones on both reports. WRatio rewards
containment: it scored "Liu Liu" against "Zhe J. Liu" at 95 because the
surname appears in both, pairing two different people. Sorting the tokens
scores that 47. The cutoff drops from 92 to 85 to keep the genuine matches,
which are not close - a dropped middle initial scores 90 and an extra given
name 88. Two names differing by one letter still score about 91, so every
fuzzy match carries its score for a reader to judge.

FIGSHARE_USER_KINDS and FIGSHARE_NAME_CUTOFF become ROSTER_USER_KINDS and
ROSTER_NAME_CUTOFF, since neither is figshare's.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A figshare account holder called Courtney "CJ" Johnson rendered as
Courtney &quot;CJ&quot; Johnson.

render_table escapes any cell value that is not wrapped in safe(), as its
own docstring says, so passing escape(name) escapes it twice: the quote
becomes &quot; and then the ampersand of that becomes &amp;quot;, which the
browser shows as &quot;.

Removed from the plain cells on /figshare_users and /protocolsio_users, and
from the source column of the acknowledgement metrics table, which has the
same bug and has simply never held a name with a character worth escaping.

The escape() calls inside safe(...) stay. Those build raw HTML, where
escaping the interpolated parts is the caller's job.

Escaping still happens - render_table does it - so the quotes remain
entities in the source, just once.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Someone with two figshare accounts under different email addresses appeared
as two unrelated rows. The name now carries a small duplicate badge whose
tooltip names the other appearances.

Grouped on the roster record rather than the displayed name. That is what
catches the interesting cases: one person is credited on protocols.io as
"Virginie M S Ruetten", "Virginia M S Ruetten", "Virginia Ruetten" and
"Virginie Ruetten", all resolving to the same ORCID, and no two of those
strings are equal. A row matching nobody falls back to its own name, which
still pairs two accounts opened under the same spelling.

Current data: two people on /figshare_users (Vivek Jayaraman with vivek@ and
jayaramanv@, Johan Winnubst with an hhmi.org address and an external one),
and two on /protocolsio_users, where the badge doubles as a view of how
inconsistently a name is deposited.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The muted blue sat quietly beside the name, which is the opposite of what a
badge saying "this person is here twice" should do.

Dark text on the orange rather than white: white on #f97316 is 3.6:1, too
thin for text at 0.76em, while #1a1a1a is 6.2:1. That was the brightest of
the oranges tried that still carried its text legibly, which is the point.

Orange is also not already spoken for - the status badges are green, blue,
gold and dark red - so the two columns do not read as one scale.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
/protocolsio_users sorted by status, then protocol count, then name, while
/figshare_users sorted by status then name. Two pages that answer the same
question about two platforms should not disagree about what order the answer
comes in.

Both now land on status, then name. Protocol count remains a sortable
column, so that view is a click away.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@robsv robsv self-assigned this Oct 9, 2026
@robsv robsv added the enhancement New feature or request label Oct 9, 2026
@robsv
robsv merged commit 2b3f635 into main Oct 9, 2026
2 checks passed
@robsv
robsv deleted the feature-protocolsio-users branch October 9, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant