Medical-Event-Data-Standard / Medical-Event-Data-Standard/MEDS-DEV

Promote web tooling (collate_entities, aggregate_results) into the package

Open
#280 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Code Cleanliness/Tech Debt priority:high Website / Branding
Dominant language
Python
Stars
43
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Background

The _web branch holds JSON manifests (entities/datasets.json, entities/tasks.json, entities/models.json) that the MEDS website fetches at runtime to render the dataset / task / model catalog pages. These files are currently manually maintained and have drifted significantly from the source code (see #186, #187, #188 for specifics).

A working prototype of the regeneration logic exists on the unmerged add_web_scripts branch:

  • src/MEDS_DEV/web/collate_entities.py — walks src/MEDS_DEV/{datasets,tasks,models}/ and produces the JSON manifests
  • src/MEDS_DEV/web/aggregate_results.py — improved version of the existing _web/scripts/aggregate_results.py (currently lives only on _web, not in the package, not under CI)

Both have docstring tests and are written as proper package modules.

What needs to be done

  1. Rebuild on current main: the branch is stale and the source layout has changed since it was written (e.g., _results task vs. nested category readmes, MIMIC-IV dataset.yaml updates, AUMCdb addition). Re-port the scripts cleanly rather than merging the branch as-is.
  2. Move under the package: place at src/MEDS_DEV/web/{collate_entities,aggregate_results}.py. Keep doctests.
  3. Expose CLI entry points in pyproject.toml:
    • meds-dev-collate-entities → writes datasets.json / tasks.json / models.json
    • meds-dev-aggregate-results → consolidates per-issue result.json blobs
  4. Replace the legacy script on _web: once the package version is shipped, update aggregate_benchmark_results.yaml to install MEDS-DEV from PyPI and invoke meds-dev-aggregate-results, then delete _web/scripts/aggregate_results.py.
  5. Delete or archive the add_web_scripts branch once content is incorporated (currently a dangling reference).

Acceptance criteria

  • meds-dev-collate-entities and meds-dev-aggregate-results are installable from PyPI as CLI commands.
  • Doctests for both run as part of the fast test lane.
  • aggregate_benchmark_results.yaml no longer depends on a script committed to _web.
  • Resolves #186, #187, #188 (collation), partially addresses #63.

Related

  • Blocks website integration work tracked in #148
  • Sibling: workflow-side automation tracked separately (see new issue for entity-regeneration workflow)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the add_web_scripts implementations with the current main layout under src/MEDS_DEV/{datasets,tasks,models}/ and review pyproject.toml. Run the existing doctests for collate_entities.py and aggregate_results.py, then verify the two CLI commands and the updated aggregate_benchmark_results.yaml. Done means both commands are installable from PyPI, doctests run in the fast lane, and the legacy _web script is removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, ci-cd, cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.