Skip to content

fix: surface required CpG sites for models without a coefficients file - #213

Closed
0x5t4l1n wants to merge 1 commit into
bio-learn:masterfrom
0x5t4l1n:fix/surface-cpg-sites-no-coeff-file
Closed

0x5t4l1n wants to merge 1 commit into
bio-learn:masterfrom
0x5t4l1n:fix/surface-cpg-sites-no-coeff-file

Conversation

@0x5t4l1n

@0x5t4l1n 0x5t4l1n commented Aug 2, 2026 •

Copy link
Copy Markdown

Summary

Fixes #200 — models like HurdleInflammAge showed N/A in docs because the generator only read static definition dicts.

Fix in doc/generate.py: Try instantiating the model and calling methylation_sites() when model_file is absent.

Test plan

  • python doc/generate.py — HurdleInflammAge row shows a site count instead of N/A

…ents file

Resolves bio-learn#200. Models like HurdleInflammAge expose their required sites
through methylation_sites() but have no model_file entry. The doc
generator showed N/A for these models because it only read static
definition dicts, not instantiated objects.

Update get_model_cpg_sites() in doc/generate.py to try instantiating the
model and calling methylation_sites() when model_file is absent, falling
back to N/A with the exception message only if instantiation fails.
@marcbal77

Copy link
Copy Markdown
Member

Thanks Stalin, will take a look and see if this gets the fix in. Appreciate the contribution.

@marcbal77

Copy link
Copy Markdown
Member

Closing this one. The diff replaces all of doc/generate.py instead of patching it, so the model, data and usage CSVs that clocks.rst, data.rst and model-usage.rst include never get written and the docs build breaks.

The new code also never reaches the Hurdle model. The registry is model_definitions in biolearn/model.py (there is no MODEL_DEFINITIONS), the file key is model.file rather than model_file, and the class is HurdleAPIModel, which needs an API key to instantiate anyway. So the row would still show N/A.

We'll put up a small fix for #200 that points the docs at the CpG list already shipped in biolearn/data.

@marcbal77 marcbal77 closed this Sep 23, 2026
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.

enhancement: surface required CpG sites in docs for models without a coefficients file

2 participants