Skip to content

Add measles and EPICC, CRAN download badges, and fix the dashboard metrics - #66

Merged
gvegayon merged 11 commits into
mainfrom
feat/cran-badges-measles-epicc
Aug 14, 2026
Merged

gvegayon merged 11 commits into
mainfrom
feat/cran-badges-measles-epicc

Conversation

@gvegayon

Copy link
Copy Markdown
Member

What this does

1. Two projects added to data/

Project Repo Notes
measles: Measles Epidemiological Models UofUEpiBio/measles Description, license, and authors taken from its DESCRIPTION. On CRAN.
EPICC: Epidemiological Cost Calculator EpiForeSITE/epicc Description assembled from the repo README and docs/stories.md.

Two things worth a second opinion from the maintainers:

  • epicc has no license file, so license is .na.character. Worth adding one to the repo.
  • Contacts are a guess from the commit history (measles: George; epicc: Edward Wang and George). Correct them if that is not who should be listed.

2. CRAN badges in the dashboard

New CRAN column with version, grand-total downloads, and downloads/month badges. Seven projects match today: epitraxr, epiworldR, linkeR, measles, pomp, quadkeyr, rbranding.

How a project is matched to a CRAN package:

  1. The optional cran_name field in the project's YAML wins. Use it when the names differ (epiworld now declares cran_name: epiworldR, since its CRAN artifact lives in another repo), or set it to no to skip the lookup entirely.
  2. Otherwise the repository name and the first word of tool_name are checked against the CRAN index, and a hit is only accepted when the package's CRAN metadata (URL or BugReports) points back at the same GitHub owner or repository.

Step 2 is what keeps a project from picking up the badges of an unrelated CRAN package that happens to share its name, and it still catches the cases where repo and package names have drifted apart (quadkeyr moved to rOpenSci, rbranding lives in branding-package).

3. Bugs fixed along the way

The numbers in the dashboard were wrong, in ways that were invisible because most of them were never printed:

  • Contributors and open PRs used length() on a parsed data frame, which returns the column count. Every repository was recorded as having 20 contributors and 36 open PRs. Only the avatars were displayed, so this stayed hidden.
  • Open issues came from open_issues_count, which GitHub defines as issues plus pull requests. PRs are now discounted, so the number agrees with the issues badge next to it.
  • Commit totals came from the search API, which is heavily rate limited and returns 0 for repositories it has not indexed. epiworld was reported as having 0 commits; it has 658. All collection sizes now come from the last page number in the Link header: one request, exact count, no fallback chain.
  • A failed request now reports N/A instead of 0.
  • Table rows had one more cell than the header.
  • commits_data <<- was writing to the global environment.

4. Presentation

  • Projects are sorted by most recent commit, each with an activity marker: 🟢 within 90 days, 🟡 within a year, ⚪ older or unknown.
  • A short summary above the table: how many projects are active / slow / dormant, how many are on CRAN, and the total open issues and PRs.

Notes for reviewers

  • README.md, profiles.md, and data/software.xlsx are not in this PR. They are generated by the Build README workflow, which will regenerate them on merge. README.qmd now uses rbindlist(fill = TRUE) so the optional cran_name field does not break that render.
  • No new R package dependencies. CRAN lookups use available.packages() (one call per run) plus crandb.r-pkg.org for the handful of candidate hits.

Suggestions not included here

  • PyPI badges for the Python tools (epiworldpy), which the CRAN code is shaped to accommodate.
  • vaccine-equity-model and multigroup-vaccine are duplicate entries for what looks like the same project, under the same name, with identical metrics. One of them should probably go.
  • Fernandez-Lab-WSU/geocovid_app returns 404 to the API, so GeoCovid shows no data. It looks like the repo was moved, renamed, or made private.
  • The data/*.yml files mostly lack a trailing newline, which makes the script emit ~40 "incomplete final line" warnings per run.

🤖 Generated with Claude Code

gvegayon and others added 7 commits August 14, 2026 10:27
- data/measles.yml: R package with measles ABMs built on epiworldR
  (UofUEpiBio/measles), published on CRAN.
- data/epicc.yml: EPidemiological Cost Calculator, a Streamlit app for
  comparing the cost of outbreak scenarios (EpiForeSITE/epicc).

README.qmd now binds the project files with fill = TRUE so that optional
fields (such as the cran_name introduced in the next commit) do not break
the render.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CRAN:
- New CRAN column with version and download badges (grand total and last
  month) for projects published on CRAN.
- A project is matched to a CRAN package through the optional cran_name
  field in its YAML file, or, when absent, by trying the repository name
  and the first word of tool_name against the CRAN index and accepting a
  hit only when the package metadata links back to the same GitHub owner
  or repository. Seven projects match today.
- epiworld declares cran_name: epiworldR, since its CRAN artifact lives
  in a different repository.

Metrics:
- Contributors and open PRs were counted with length() on a parsed data
  frame, which returns the number of columns: every repository reported
  20 contributors and 36 open PRs.
- Open issues came from open_issues_count, which includes pull requests.
  PRs are now discounted so the number matches the issues badge.
- Commit totals came from the search API, which is heavily rate limited
  and reports 0 for unindexed repositories (epiworld showed 0 commits,
  now 658). All collection sizes now come from the last page number of
  the Link header: one request, exact count.
- A failed request reports N/A instead of 0.
- Rows had one more cell than the header.
- commits_data was assigned to the global environment with <<-.

Presentation:
- Projects are sorted by most recent commit and carry an activity marker
  (green: 90 days, yellow: a year, white: older or unknown).
- A summary of activity, CRAN releases, and open issues/PRs sits above
  the table.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…AN badges

- data/epiworldrcalibrate.yml: pre-trained ML calibration for epiworldR
  ABMs (sima-njf/epiworldRcalibrate), published on CRAN.
- rbranding pointed at EpiForeSITE/branding-package, which has since been
  renamed to EpiForeSITE/rbranding; its docs link moved with it. The
  package name is now declared explicitly rather than inferred.
- The CRAN badges move out of their own column and sit under the
  repository link, on a single line.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gvegayon

Copy link
Copy Markdown
Member Author

Follow-up pushed in 78b3d09:

  • CRAN badges moved into the Repository column, on one line under the repository link. The separate CRAN column is gone.
  • epiworldRcalibrate added (data/epiworldrcalibrate.yml) — repo is sima-njf/epiworldRcalibrate, classified as Parameter estimation, contact taken from the DESCRIPTION (Sima Najafzadehkhoei).
  • rbranding was already listed, but pointed at EpiForeSITE/branding-package, which has since been renamed to EpiForeSITE/rbranding; its docs link moved with it. Both are updated, and the package name is now declared explicitly instead of inferred.

The dashboard now tracks 24 projects, 8 of them on CRAN.

@gvegayon
gvegayon merged commit f5b639c into main Aug 14, 2026
@gvegayon
gvegayon deleted the feat/cran-badges-measles-epicc branch August 14, 2026 19:51
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.

1 participant