fix: online-first articles were flagged as year mismatches - #26
Merged
Merged
Conversation
CrossRef carries up to four date fields and `published` holds the EARLIEST.
`_year()` returned the first field it found, so for any journal publishing online
before print the canonical year was the ONLINE one -- and a bibliography using the
print year, which is how those papers are universally cited, was reported Tier B.
Found by auditing a 25-entry bibliography, where 2 of 25 entries were flagged and
BOTH were correct:
featureCounts 10.1093/bioinformatics/btt656
online 2013-11-13, print 2014-04-01 -- cited everywhere as Liao et al. 2014
Yang et al. 10.1093/molbev/msu343
online 2014-12-21, print 2015-03-01 -- cited as Yang et al. 2015
Acting on either flag would have introduced a defect into a clean bibliography,
which is the opposite of what this tool is for. A false positive here is worse
than a miss: it costs the reader's trust in every other flag in the report, and
this class covers most journals rather than an edge case.
CanonicalRecord now carries `years` -- every distinct year CrossRef holds for the
DOI, earliest first -- and a claimed year is a mismatch only when it matches NONE
of them. `year` still holds the earliest and is unchanged for display. When a
mismatch IS reported for a multi-date record the message names them all
("CrossRef years are 2013/2014") instead of one.
Tests written before the fix and watched to fail (AttributeError: no attribute
'years'). Positive control included: a year matching neither date is still
Tier B, and single-date records behave exactly as before. Real-execution check:
the live CLI against the same 25-entry bibliography now reports 2 C / 1 U and no
Tier B, with the cosmetic and unverifiable findings correctly retained.
316 tests pass, ruff clean. Version bumped in all three places that pin it
(pyproject, __init__, CITATION.cff) -- `git grep` found the latter two, which a
pyproject-only bump would have left reporting 0.5.2.
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.
CrossRef carries up to four date fields and
publishedholds the earliest._year()returned the first field it found, so for any journal that publishes online before print the canonical year was the online one — and a bibliography using the print year, which is how those papers are universally cited, was reported Tier B.Found while auditing a 25-entry bibliography: 2 of 25 entries were flagged and both were correct.
10.1093/bioinformatics/btt65610.1093/molbev/msu343Acting on either flag would have introduced a defect into a clean bibliography — the opposite of what this tool is for. A false positive here is worse than a miss, because it costs the reader's trust in every other flag, and this class covers most journals rather than an edge case.
Change
CanonicalRecordnow carriesyears— every distinct year CrossRef holds for the DOI, earliest first — and a claimed year is a mismatch only when it matches none of them.yearstill holds the earliest and is unchanged for display. When a mismatch is reported for a multi-date record, the message names them all ("CrossRef years are 2013/2014").Verification
AttributeError: no attribute 'years').2 C · 1 Uand no Tier B, with cosmetic and unverifiable findings correctly retained.git grepcaught__init__.pyandCITATION.cff, which a pyproject-only bump would have left reporting 0.5.2.