Skip to content

Add per-location CSV splitting and reorganise csv directory#88

Merged
david-mears-2 merged 2 commits intomainfrom
mrc-6922-downloads-per-location
Apr 13, 2026
Merged

Add per-location CSV splitting and reorganise csv directory#88
david-mears-2 merged 2 commits intomainfrom
mrc-6922-downloads-per-location

Conversation

@david-mears-2
Copy link
Copy Markdown
Contributor

@david-mears-2 david-mears-2 commented Apr 1, 2026

Just a little 7000 liner ;) actually it's just one data-processing script being added.

We have an existing script for processing the data source into nice vaxviz-friendly jsons, which calls out to a few sub-scripts. It is for updating the static data, which will stop being necessary, one imagines, after paper publication; instructions for running the script are in the README.

In this PR I add another sub-script that splits up the summary table csvs into many small chunks, chunked by location value. This is to enable future work for downloading location-specific data.

AI use

We said it would be helpful to demarcate what code contributions were AI-generated.

I made this change before the easter break in a local session with claude code as an agent. I think CC wrote the code, but I of course had a hand in it (like when your baby cousin says 'I cooked the dinner and Mummy helped') and I've read each line.

Tests??

I haven't got tests on these scripts because they only have one job and it's easy to check if they do that. The proof is in the pudding - did it produce the csvs? Well, there you go then.

Add a Node script (splitCsvsByLocation.ts) to split summary table CSVs
into per-country and per-subregion files under a nested folder structure.
Move source CSVs into csv/source/ to separate them from generated output.
Hardcode paths in both Node scripts using import.meta.dirname, removing
the need for CLI arguments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@david-mears-2 david-mears-2 force-pushed the mrc-6922-downloads-per-location branch from fcb9987 to 01c8d82 Compare April 10, 2026 18:11
@david-mears-2 david-mears-2 changed the title wip: Add per-location CSV splitting and reorganise csv directory Add per-location CSV splitting and reorganise csv directory Apr 10, 2026
@david-mears-2 david-mears-2 marked this pull request as ready for review April 10, 2026 18:26
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.03%. Comparing base (f255ba7) to head (91dc7fc).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #88   +/-   ##
=======================================
  Coverage   98.03%   98.03%           
=======================================
  Files          36       36           
  Lines         813      813           
  Branches      230      230           
=======================================
  Hits          797      797           
  Misses         10       10           
  Partials        6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@M-Kusumgar M-Kusumgar left a comment

Choose a reason for hiding this comment

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

Looks pretty good! had a couple of small questions about the script and csvs but happy to approve after that!

const content = fs.readFileSync(filepath, "utf8");
const lines = content.split("\n");
const header = lines[0];
const headers = header.split(",").map((h) => h.replace(/"/g, ""));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

delimiters can be different for csvs from different regions, is this all static and guaranteed to have the , delimiter?

also im assuming the csvs we are given always have a header too right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, the csvs are static and will stop changing as soon as the paper gets published. So we can hard code the delimiter and the headers.

@david-mears-2 david-mears-2 merged commit cab5dac into main Apr 13, 2026
5 checks passed
@david-mears-2 david-mears-2 deleted the mrc-6922-downloads-per-location branch April 13, 2026 15:04
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.

2 participants