Consolidate fl-tutorials dataset tooling into a shared datasets/ tree - #1070
Merged
Conversation
Datasets are backend-agnostic (a tutorial's NVFLARE and Flower twins train on the same data) and many-to-one (spleen alone backs segmentation, evaluation and diffusion), but their tooling was scattered per backend and drifting: near-identical xray recipes in both backend Makefiles with different output names and separate .hf caches, and the spleen scripts living under one tutorial's utils/ with the Flower Makefile delegating cross-tree. - fl-tutorials/datasets/ now owns every download/derive/enrich target (single copy); the spleen scripts and their uv project move to datasets/spleen/. The root fl-tutorials Makefile forwards the dataset targets there, so the documented entrypoints are unchanged. - Outputs land in one shared gitignored fl-tutorials/data/ root — one download serves both backends. The xray CSV gets one canonical name (dataframe.csv); the two spleen variants (MSD build vs FLIP-format tree) coexist under data/spleen/, selected by FL_BACKEND as before. - All consumers re-pointed: nvflare .env.app files, flower run-tutorial.sh (which now also checks the dataframe exists), flip-api's e2e_smoke_spleen enrichment wiring, CLAUDE/AGENTS.md, READMEs and docs. Removes the accidentally committed self-referencing fl-tutorials/nvflare/data symlink. Verified: download-xray-data and download-spleen-data FL_BACKEND=flower run end-to-end into the shared root (git-clean afterwards); target dispatch, NUM_CASES forwarding and per-variant SPLEEN_LABELS_DIR checked via make -n; make -C fl-tutorials test green (lint + 107 passed). Closes #1069 Signed-off-by: at24_bioeng625-pc <alexandre.triay_bagur@kcl.ac.uk>
5 tasks
|
✅ Acceptance criteria have been automatically imported from the linked issue(s) and added to the PR description. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Move the inline `python -c` snapshot_download one-liners for xray and arkplus into per-dataset script folders (xrays_mini_300/, arkplus/), mirroring the spleen/ pattern. arkplus/download_arkplus_dataset.py is shared by both the finetuning and eval targets, parameterised by --sites. Signed-off-by: at24_bioeng625-pc <alexandre.triay_bagur@kcl.ac.uk>
…READMEs The tags/dataset/framework block is metadata for Flower's own examples website; in plain rendered markdown it shows up as a stray horizontal rule plus literal text. Signed-off-by: at24_bioeng625-pc <alexandre.triay_bagur@kcl.ac.uk>
garciadias
reviewed
Aug 28, 2026
garciadias
previously approved these changes
Aug 28, 2026
garciadias
left a comment
Collaborator
There was a problem hiding this comment.
Clean, mechanical, thoroughly self-verified refactor consolidating dataset tooling; all path rewrites across .env.app files, Makefiles, run-tutorial.sh, flip-api/Makefile, and the CLAUDE.md/AGENTS.md twin-file pair check out, no stale references remain, CI is green. One optional non-blocking nit left inline. Approving.
Move the last inline `python -c` snapshot_download one-liner — download-spleen-flip-format-data, which also copies the tree and the evaluation checkpoint into place — into datasets/spleen/download_spleen_flip_format_dataset.py, on the same pattern as the xray and arkplus scripts. It stays a `uv run --no-project --with huggingface_hub` call rather than adopting spleen/'s env, which exists for the MSD scripts' MONAI/torch stack. The script still replaces only its own outputs, so an MSD build beside them in data/spleen/ survives a re-download. Signed-off-by: at24_bioeng625-pc <alexandre.triay_bagur@kcl.ac.uk>
Signed-off-by: at24_bioeng625-pc <alexandre.triay_bagur@kcl.ac.uk>
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.
What
Consolidates the tutorial datasets' download/derive/enrich tooling into a shared
fl-tutorials/datasets/tree, with all outputs in one shared gitignoredfl-tutorials/data/root. Closes #1069.Datasets are backend-agnostic (a tutorial's NVFLARE and Flower twins train on the same data) and many-to-one (spleen alone backs segmentation, evaluation and diffusion), but the tooling was scattered per backend and drifting: near-identical xray recipes in both backend Makefiles (different output CSV names, separate
.hfcaches — testing both backends downloaded the same data twice), and the spleen scripts living under one tutorial'sutils/with the Flower Makefile delegating cross-tree behind an apologetic comment.How
fl-tutorials/datasets/Makefileowns every dataset target (single copy):download-xray-data,download-spleen-data(FL_BACKEND-dispatched to the explicitdownload-spleen-msd-data/download-spleen-flip-format-datavariants),download-arkplus-{finetuning,eval}-data,upload-spleen-labels. The fl-tutorials root Makefile forwards these there, so every documented entrypoint is unchanged (make -C fl-tutorials download-spleen-data NUM_CASES=41 [FL_BACKEND=flower], etc.).fl-tutorials/datasets/spleen/takes the three spleen scripts and their uv project (moved fromnvflare/image_segmentation/3d_spleen_segmentation/{utils/,pyproject.toml}; the project env existed solely for these utilities), plus a newdownload_spleen_flip_format_dataset.pyfor the FLIP-format variant.datasets/README.mddocuments each dataset's source, layout and consumers.python -c: the xray, arkplus and FLIP-format spleen fetches each live in their dataset folder (xrays_mini_300/,arkplus/,spleen/) and run viauv run --no-project --with huggingface_hub; the Makefile targets just invoke them.fl-tutorials/data/; one download serves both. The xray CSV gets one canonical name (dataframe.csv); the two spleen variants (MSD build:images/+dataframe.csv; FLIP-format:accession-resources/+sample_get_dataframe_response.csv+ checkpoint) coexist underdata/spleen/— the FLIP-format download now removes only its own outputs instead ofrm -rf data/spleen..env.appfiles,flower/run-tutorial.sh(which now also fail-fasts on a missing dataframe file, not just the images dir), flip-api'se2e_smoke_spleen*enrichment wiring (SPLEEN_ENRICHMENT_CWD/CMD/LABELS_DIR), rootCLAUDE.md/AGENTS.md, tutorial READMEs,fl-services/flower/README.md, the demo-video docs and the arkplus user guide. The upload script's remediation text now names the two variants instead of the two backends.fl-tutorials/nvflare/datasymlink.tags/dataset/framework) from the two Flower spleen tutorial READMEs — it is metadata for Flower's examples website and renders on GitHub as a stray horizontal rule plus literal text.create-flip-app-from-flower.rstlocal-testing example (../../data/spleen/...from the tutorial root) pointed at a path that didn't exist under the old layout — it is exactly right under the new one.Verification
make -C fl-tutorials download-xray-dataandmake -C fl-tutorials download-spleen-data FL_BACKEND=flowerrun end-to-end into the shared root, with the expected layouts, andgit statusstays clean afterwards (gitignore covers the new root).NUM_CASESforwarding, and the per-variantSPLEEN_LABELS_DIRdefaults verified viamake -ncommand expansion;bash -nonrun-tutorial.sh;list-tutorialsworks on both backends.make -C fl-tutorials testgreen (ruff + 112 passed, 12 expected skips — the count grew whendevelopwas merged in: its new FLIP#1060 spleen case-selection tests were re-pointed at the moveddatasets/spleen/downloader as part of the merge).scripts/check_tutorial_sync.shgreen; a repo-wide grep finds zero references to the old paths.upload-spleen-labelsagainst XNAT.Sequencing
Merge before #1068 — the EHR risk-prediction tutorial then rebases onto this and moves its
build_synthea_dataframe.pyintodatasets/synthea/, instead of adding a second cross-tree delegation.Acceptance Criteria
Imported from issue #1069
fl-tutorials/datasets/<name>/owns each dataset's scripts + Make targets; no dataset scripts remain under per-tutorialutils/and no duplicated download recipes remain in the per-backend Makefiles.make -C fl-tutorials download-xray-data|download-spleen-data|download-arkplus-*|upload-spleen-labels [FL_BACKEND=flower]..env.apppaths,flower/run-tutorial.shmappings, flip-apie2e_smoke_spleen*defaults, rootCLAUDE.md/AGENTS.md, READMEs, docs.make -C fl-tutorials testgreen; tutorial-sync CI green; downloads verified to land in the layout the tutorials expect.