Skip to content

fixed dois, and changed create_pup_listing.r function to render dates… - #107

Open
kaiemjoy wants to merge 4 commits into
mainfrom
doi-update
Open

fixed dois, and changed create_pup_listing.r function to render dates…#107
kaiemjoy wants to merge 4 commits into
mainfrom
doi-update

Conversation

@kaiemjoy

Copy link
Copy Markdown
Contributor

… in quotations. this fixed the issue where some dates were being rendered as "January 1970"

… in quotations. this fixed the issue where some dates were being rendered as "January 1970"
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1-2-g6ad689f

QR code for preview link

🚀 View preview at
https://ucd-serg.github.io/pr-preview/pr-107/

Built to branch gh-pages at 2026-08-25 06:59 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@kaiemjoy
kaiemjoy requested a review from d-morrison August 20, 2026 05:20
@github-actions
github-actions Bot removed the request for review from d-morrison August 25, 2026 04:45
@github-actions

This comment has been minimized.

@github-actions
github-actions Bot requested a review from d-morrison August 25, 2026 04:52
@dem-extra1

Copy link
Copy Markdown

@claude review

@dem-extra1

Copy link
Copy Markdown

/review

@dem-extra1 dem-extra1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review as fallback for unreachable Claude.

@dem-extra1

Copy link
Copy Markdown

@agy review

@dem-extra1

Copy link
Copy Markdown

Closing in favor of #117 to re-trigger CI

@d-morrison d-morrison closed this Aug 25, 2026
@d-morrison d-morrison reopened this Aug 25, 2026
@github-actions
github-actions Bot removed the request for review from d-morrison August 25, 2026 06:58
@github-actions

Copy link
Copy Markdown
Contributor

Claude finished reviewView run


Review: PR #107 — "fixed dois, and changed create_pub_listing.r function to render dates … in quotations"

Summary of changes

  • R/create_pub_listing.R: adds a stringr::str_replace() step that wraps the issued: field in double quotes when it's a bare year or YYYY-MM(-DD) value, so YAML/Quarto doesn't parse it as a number (root cause of the reported "January 1970" bug).
  • papers/DOIs.csv: swaps 2 stale preprint DOIs for their published versions, adds 6 new preprint entries, and prefixes nearly all nicknames with YYYY Author.
  • publications.bib / publications.yml: regenerated from the updated DOI list; issued/date fields are now quoted strings.
  • people/kaiemjoy/.gitignore: new, ignores .httr-oauth (sensible — avoids committing an OAuth token cache).

No CLAUDE.md files exist anywhere in this repo (root or any touched directory), so there's nothing to check for CLAUDE.md compliance on this axis. I evaluated the R change against the SERG lab manual coding style instead — the fix uses the native pipe, namespaced stringr::str_replace(), and a single justified comment explaining the non-obvious YAML-numeric-coercion reason; no violations found there.

Verified finding: the fix silently drops the month for 8 publications (regression, not cosmetic)

I reproduced the actual create_pub_listing.R pipeline (installed pandoc 3.1.3 and ran it against extracted bib entries) rather than just reading the diff, because the regenerated publications.yml contained a suspicious pattern: several pre-existing entries that had date: YYYY-MM in the base branch now only have date: "YYYY" after this PR, e.g.:

  • publications.yml (Kamau_2025): base had issued: 2025 / date: 2025-07; this PR produces issued: "2025" / date: "2025" — the month is gone.
  • Same pattern for Teunis_2023, Garrett_2022, Aiemjoy_2020, Morrison_2018 (all pre-existing entries, publications.bib source unchanged for these — confirmed via git show against the merge-base), plus it will also affect the new entries Lai_2025, Shrestha_2026, Tedijanto_2023.

Root cause: data-raw/papers.R fetches BibTeX from Crossref via rcrossref::cr_cn(..., format = "bibtex"), and for some entries Crossref exports the month as a full/nonstandard word (month=July, month=June, month=Sept) instead of the standard 3-letter BibTeX macro (jul, jun, sep). I verified directly with pandoc that this is exactly where it breaks:

$ echo '@article{T,title={T},author={A,B},year=2025,month=Jul}'  | pandoc --from=bibtex --to=markdown   # → issued: 2025-07  (correct)
$ echo '@article{T,title={T},author={A,B},year=2025,month=July}' | pandoc --from=bibtex --to=markdown   # → issued: 2025      (month silently dropped)

grep -oE "month=[A-Za-z]+" publications.bib shows exactly the affected macros: July (4), June (2), Sept (2) — all non-standard. Because create_pub_listing.R's date: field is derived directly from pandoc's issued: line (grep(" issued:", ...) |> str_replace(" issued: ", " date: ")), pandoc's silent parsing failure propagates straight into publications.yml.

This matters because publications.qmd uses date-format: 'MMMM,<br>YYYY' and sorts by issued desc — i.e., the very rendering path this PR is trying to fix. A bare "2025" (no month) being fed into a month/year date-format is likely to render with a wrong or default month (commonly January), which is functionally the same class of bug this PR sets out to resolve, just for a different subset of entries (and now newly introduced for 3 of the entries this PR adds). I could not run an actual Quarto render to confirm the exact rendered output (no R/Quarto toolchain available in this sandbox), but the underlying data loss is directly reproduced and unambiguous — these entries have measurably less date precision after this PR than before it, despite their source .bib year/month fields being unchanged.

Suggested fix: normalize non-standard month names in data-raw/papers.R (or the CSL-fetch step) to the 12 standard 3-letter BibTeX macros before writing publications.bib — e.g. a small case_when/lookup mapping full month names → 3-letter abbreviations — so pandoc's BibTeX date parser can pick up the month for every entry, not just Crossref's "well-behaved" ones.

Other checks performed (no issues found)

  • All new/changed DOIs (10.12688/verixiv.3487.2, the four 10.64898/... openRxiv preprints, 10.1016/j.lanmic.2026.101450, 10.3201/eid3208.250753, 10.3201/eid3203.250469, 10.1038/s41467-023-38940-5) resolve via doi.org/Crossref content negotiation and their titles match the corresponding publications.bib entries — no hallucinated citations.
  • Entry counts are consistent across papers/DOIs.csv (27 rows), publications.bib, and publications.yml (27 - author: blocks, up from 20).
  • The regex in create_pub_listing.R is correctly anchored (^...$) and scoped to the issued: field only — it can't accidentally match issue:, and doesn't affect other numeric CSL fields (volume, page, etc.) that are supposed to stay unquoted.
  • Aiemjoy_2022 appears twice as a bibtex citation key — pre-existing in the base branch, not introduced by this PR, so not flagged as a new issue.
  • .gitignore addition is a reasonable, low-risk credential-hygiene fix.

Verdict

Needs more work — the issued:/date: quoting fix in R/create_pub_listing.R is correct and does resolve the numeric-YAML-coercion bug for entries with well-formed months, but the PR as a whole regresses date precision for 8 publications (5 pre-existing, 3 newly added) because Crossref's BibTeX export uses non-standard month spellings (July, June, Sept) that pandoc's citeproc parser silently fails to parse, dropping straight to year-only. Since this is the exact rendering path (publications.qmd, date-format: 'MMMM,<br>YYYY') the PR is meant to fix, I'd recommend normalizing month abbreviations in data-raw/papers.R before merging, or at minimum spot-checking the rendered /publications page for Kamau, Teunis, Garrett, Aiemjoy 2020, and Morrison 2018 to confirm the displayed dates are still correct.

Reviewed commit: ffc4c5a

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $2.7469 (review) — run

@github-actions
github-actions Bot requested a review from d-morrison August 25, 2026 07:06
@d-morrison
d-morrison removed their request for review August 25, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants