Repository navigation
Conversation
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.
Add an optional sites_file key to model definitions. HurdleAPIModel now loads its CpG list from it, and the doc generator links it in place of N/A. Closes bio-learn#200.
marcbal77
force-pushed
the
fix/doc-sites-file-for-api-models
branch
from
September 23, 2026 20:07
7235f1b to
546e9e5
Compare
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
Closes #200.
HurdleInflammAgeshowedN/Ain the Coefficients column of the model table because it has nomodel.file. Its required CpGs already ship inbiolearn/data/Hurdle_CpGs.csv, so the docs now link to that file instead.How
sites_filekey in a model definition'smodelblock, for models that have no coefficients file but do have a fixed list of required sites.HurdleAPIModelreads its CpG list fromsites_filerather than a hardcoded filename, so the definition is the single source for both the model and the docs. The default is unchanged (Hurdle_CpGs.csv), so direct construction behaves as before.doc/generate.pylinksrequired siteswhen there is asites_fileand nofile. Everything else in the generator is untouched.Instantiating the model in the doc build (the approach floated in the issue) was avoided:
HurdleAPIModelrequiresHURDLE_API_KEYto construct, which the docs build shouldn't depend on. Any future API-backed model can setsites_fileand get the same treatment.Output
Only one row of
generated/model_table.csvchanges:model_usage.csvis identical.Tests
test_sites_loaded_from_definition_sites_file: sites come from the definition's file.test_missing_sites_file_falls_back_to_all_sites: the parameter is actually used, and an unknown file keeps the existing warn-and-fallback behavior.test_sites_file_exists: everysites_fileinmodel_definitionsexists inbiolearn/data, so the docs link can't point at a missing file.The two Hurdle tests fail against master and pass here.
make check-formatclean.make test: 205 passed, 5 skipped, 0 failed.Depends on #218
Stacked on #218, which fixes the CI failure every PR currently hits (geo2r now returns a CAPTCHA page). Merge #218 first and this diff reduces to the commit above.
Note
doc/generate.pyalso crashes on master ingenerate_data_csv_from_yamlbecause the NHANES and FHS entries from #203 have nosamplesfield. That is fixed separately in #219.