Closed matt-graham closed 2 months ago
I've made an edit to make the pagination more manageable (by excluding two parameters, which are really just datasets). Also, excluded the Wasting
module that has no parameters.
Subject: [PATCH] exclude wasting and exclude certain parameters
---
Index: docs/tlo_parameters.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/docs/tlo_parameters.py b/docs/tlo_parameters.py
--- a/docs/tlo_parameters.py (revision de44e443565ff02dfd836db4a40e101a792866e2)
+++ b/docs/tlo_parameters.py (revision 8b315ded68f4bd4bcdaa8f1c6a152f1cfb696886)
@@ -73,6 +73,7 @@
modules: Iterable[Module],
overriden_parameters: dict[str, dict[str, ParameterValue]],
excluded_modules: set[str],
+ excluded_parameters: dict[str, str],
max_inline_parameter_length: int = 10,
) -> tuple[ModuleParameterTablesDict, ModuleStructuredParametersDict]:
module_parameter_tables = {}
@@ -83,6 +84,8 @@
parameter_records = []
module_structured_parameters[module.name] = {}
for parameter_name, parameter in module.PARAMETERS.items():
+ if parameter_name in excluded_parameters.get(module.name, set()):
+ continue
if (
module.name in overriden_parameters
and parameter_name in overriden_parameters[module.name]
@@ -225,7 +228,9 @@
status_quo_parameters = get_parameters_for_status_quo()
simulation.register(*fullmodel.fullmodel(args.resource_file_path))
module_parameter_tables, module_structured_parameters = get_parameter_tables(
- simulation.modules.values(), status_quo_parameters, {"HealthBurden"}
+ simulation.modules.values(), status_quo_parameters, {"HealthBurden", "Wasting"},
+ {"Demography": "gbd_causes_of_death_data",
+ "Tb": "who_incidence_estimates"}
)
write_parameters_markdown_file(
args.output_file_path, module_parameter_tables, module_structured_parameters
Thanks @tbhallett - I've applied the patch you suggested and also now updated to allow outputting a reStructuredText file as well as Markdown to allow inclusion in our docs, and updated the docs build to automatically generate this page.
Thanks @matt-graham -- that's brilliant and very timely. It will be great to have this on the website.
@tbhallett just to check are you happy for this to be merged in? Know that you already approved but as I made a few subsequent changes after that wanted to make sure!
Yes please do merge in. Thanks again. And, if you can, please could you also regenerate the website so that it appears there?
Work in progress but should resolve #1419
Script can be run from root of respository with
with this generating a Markdown output
parameters.md
which can be converted to HTML withusing CSS from https://gist.github.com/killercup/5917178
I'll hopefully be able to get this to also output reStructuredText to allow running as part of the documentation build and including on the website.