Repository navigation
Add a protocols.io users report, and fix three things on the figshare one - #543
Merged
Merged
Conversation
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 "CJ" 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 " and then the ampersand of that becomes &quot;, which the browser shows as ". 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
/protocolsio_usersunder DataCite ▸ protocols.io, the counterpart to/figshare_users. Also fixes three things on the figshare report, which isalready 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:
(measured). That is not a page load. This renders instantly.
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/familyratherthan the
givenName/familyNamea DataCite record uses.A wrong fuzzy match, found and fixed
The matcher paired
Liu Liu→Zhe J. Liuat 95. Different people —WRatiorewards containment, and the surname appears in both.Moved to
token_sort_ratio, which scores that pair 47 while still reachinga 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 RuettenandVirginie 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
#f97316is 3.6:1, too thin atthis size;
#1a1a1ais 6.2:1.Also fixed on /figshare_users
Courtney "CJ" Johnsonrendered asCourtney "CJ" Johnson.render_tableescapes any cell notwrapped in
safe(), so passingescape(name)escaped it twice. Fixed inthree 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.
status, then name. Protocol count remains a sortable column.
FIGSHARE_USER_KINDS/FIGSHARE_NAME_CUTOFFbecomeROSTER_*, sinceneither 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