Skip to content

fix(docs): tolerate library entries without a samples count - #219

Open
marcbal77 wants to merge 2 commits into
bio-learn:masterfrom
marcbal77:fix/doc-data-table-missing-samples
Open

marcbal77 wants to merge 2 commits into
bio-learn:masterfrom
marcbal77:fix/doc-data-table-missing-samples

Conversation

@marcbal77

Copy link
Copy Markdown
Member

What

doc/generate.py crashes on master while writing generated/data_table.csv:

KeyError: 'samples'

The NHANES_2010, NHANES_2012 and FHS entries added in #203 have no samples field, and the generator indexed it directly. make html runs this script first, so the docs build fails.

How

samples is only read by the doc generator and nothing in the loader requires it, so it is treated as optional: missing counts render as N/A, the same placeholder the model table uses. Sample counts were not added to library.yaml because the clinical cohorts don't have one fixed number that would be accurate to publish.

Verification

  • python doc/generate.py exits 1 on master and 0 here. data_table.csv has all 48 library entries.
  • make check-format clean. make test: 202 passed, 5 skipped, 0 failed.

Depends on #218

This branch is stacked on #218, which fixes the CI failure every PR currently hits. Merge #218 first and this diff reduces to the one-line change in doc/generate.py.

Follow-up (not in this PR)

The new NHANES and FHS rows show Age Present: No and Sex Present: No. That is wrong: both loaders provide age and sex (biolearn/load.py). The generator only looks at GEO-style parser.metadata, which clinical entries don't use. Fixing that needs a way for non-GEO entries to declare their metadata and is better as its own change.

geo2r now returns a CAPTCHA page to scripted requests, which broke CI on
master. The test stubs the metadata call, and _create_metadata raises a
clear error when the response is not JSON.
NHANES_2010, NHANES_2012 and FHS have no samples field, so the data table
step of doc/generate.py raised KeyError and broke make html.
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