Functions | |
| dict | load_registry () |
| Load the capability family registry. | |
| literal (ast.AST node) | |
Evaluate a literal AST node, additionally accepting the bare set() call that appears in the boundary-handler specs for empty parameter sets. | |
| ast.Module | module_syntax (str module) |
| Parse a dotted module into one syntax tree, whether file or package. | |
| dict[str, dict] | python_dict_values (str module, str symbol) |
| Read a public-surface dictionary from the CLI package without importing PETSc. | |
| dict[str, dict] | python_normalizer_values (str module, str symbol) |
| Read the canonical selector strings accepted by a normalizer function. | |
| str | function_body (str path, str function) |
| Return the source text of one C function, so extraction never spans the file. | |
| dict | python_membership_values (str module, str symbol) |
| Read the accepted values from a normalizer that validates by set membership. | |
| dict | python_equality_chain_values (str module, str symbol) |
| Read accepted values from a normalizer that compares against string literals. | |
| dict[str, str] | c_string_map_values (str path, str function) |
| Extract the case-insensitive selector strings a C parser accepts. | |
| dict[str, str] | c_token_map_values (str path, str function, str variable, str field) |
| Extract an exact-match token chain that assigns an enum to a context field. | |
| set[str] | c_switch_values (str path, str function, str prefix) |
| Extract the enum constants a C factory switch dispatches on. | |
| set[str] | c_dispatch_values (str path, str function, str prefix) |
| Extract the enum constants an if/else dispatch chain compares against. | |
| set[str] | c_enum_values (str path, str symbol) |
| Extract the members of a C enum. | |
| dict | python_constant_values (str module, str symbol) |
| Read the accepted values from a named module-level choice set. | |
| dict | collect (dict family) |
| Build one family's inventory record from its declared sources. | |
| None | apply_metadata (list[dict] inventory, dict registry) |
| Merge declared per-value metadata (status, alias target) into the inventory. | |
| dict[str, int] | classify (list[dict] inventory) |
| Count selectable, alias, and latent values separately. | |
| None | apply_reachability (list[dict] inventory, dict registry) |
| Mark declared values that no other family can actually satisfy as latent. | |
| str | entry_anchor (dict registry_entry, str value) |
| Anchor name of the Tier-2 entry for one selector value. | |
| str | html_escape (str text) |
| Escape text for inclusion in generated HTML. | |
| set | documented_entries (dict family, dict registry_entry) |
| Values whose Tier-2 entry anchor is actually present on the family page. | |
| str | render_family (dict family, dict registry_entry) |
| Render one family's value table as a Doxygen-includable HTML fragment. | |
| Path | family_fragment_path (str family_id) |
| Path of the per-family includable fragment. | |
| str | render_evidence_matrix (list[dict] inventory, dict registry) |
| Render the project-wide capability-by-evidence matrix as an HTML fragment. | |
| str | render_markdown (list[dict] inventory) |
| Render the inventory as a Doxygen-includable Markdown fragment. | |
| int | main () |
| Generate the capability inventory artifacts. | |
Variables | |
| REPO_ROOT = Path(__file__).resolve().parents[2] | |
| str | REGISTRY_PATH = REPO_ROOT / "tests" / "tooling" / "capability_families.json" |
| str | GENERATED_DIR = REPO_ROOT / "docs" / "generated" |
Extract the public capability inventory from executable sources and render it for the docs.
| dict generate_capability_inventory.load_registry | ( | ) |
Load the capability family registry.
Definition at line 19 of file generate_capability_inventory.py.
| generate_capability_inventory.literal | ( | ast.AST | node | ) |
Evaluate a literal AST node, additionally accepting the bare set() call that appears in the boundary-handler specs for empty parameter sets.
| [in] | node | Parsed AST node. |
Definition at line 27 of file generate_capability_inventory.py.
| ast.Module generate_capability_inventory.module_syntax | ( | str | module | ) |
Parse a dotted module into one syntax tree, whether file or package.
A public surface may be a package: picurv_cli.storage exposes its constants through its __init__, but they are defined across its modules. Concatenating their bodies lets the readers below stay written against a single tree, which is what they mean by "the module".
| [in] | module | Dotted module name. |
Definition at line 45 of file generate_capability_inventory.py.
| dict[str, dict] generate_capability_inventory.python_dict_values | ( | str | module, |
| str | symbol | ||
| ) |
Read a public-surface dictionary from the CLI package without importing PETSc.
| [in] | module | Dotted module name. |
| [in] | symbol | Module-level dictionary name. |
Definition at line 68 of file generate_capability_inventory.py.
| dict[str, dict] generate_capability_inventory.python_normalizer_values | ( | str | module, |
| str | symbol | ||
| ) |
Read the canonical selector strings accepted by a normalizer function.
| [in] | module | Dotted module name. |
| [in] | symbol | Normalizer function name. |
Definition at line 97 of file generate_capability_inventory.py.
| str generate_capability_inventory.function_body | ( | str | path, |
| str | function | ||
| ) |
Return the source text of one C function, so extraction never spans the file.
| [in] | path | Repository-relative C source path. |
| [in] | function | Function name to isolate. |
| RuntimeError | when the function cannot be located. |
Definition at line 118 of file generate_capability_inventory.py.
| dict generate_capability_inventory.python_membership_values | ( | str | module, |
| str | symbol | ||
| ) |
Read the accepted values from a normalizer that validates by set membership.
Some normalizers check if value not in {...} rather than mapping through a dict. The accepted set is still the public surface, so it is extracted the same way rather than being hand-listed.
| [in] | module | Dotted module name. |
| [in] | symbol | Normalizer function name. |
Definition at line 142 of file generate_capability_inventory.py.
| dict generate_capability_inventory.python_equality_chain_values | ( | str | module, |
| str | symbol | ||
| ) |
Read accepted values from a normalizer that compares against string literals.
A third normalizer shape: if normalized == "ucat": ... elif ... == "ucont". The compared literals are the public surface, so they are extracted rather than hand-listed, keeping the inventory tied to the code.
| [in] | module | Dotted module name. |
| [in] | symbol | Normalizer function name. |
Definition at line 172 of file generate_capability_inventory.py.
| dict[str, str] generate_capability_inventory.c_string_map_values | ( | str | path, |
| str | function | ||
| ) |
Extract the case-insensitive selector strings a C parser accepts.
| [in] | path | Repository-relative C source path. |
| [in] | function | Parser function name. |
Definition at line 202 of file generate_capability_inventory.py.
| dict[str, str] generate_capability_inventory.c_token_map_values | ( | str | path, |
| str | function, | ||
| str | variable, | ||
| str | field | ||
| ) |
Extract an exact-match token chain that assigns an enum to a context field.
Handles the strcmp(buf, "TOKEN") == 0 ... field = ENUM; shape used for generated PETSc option tokens, including chains where several tokens share one assignment (an alias arm).
| [in] | path | Repository-relative C source path. |
| [in] | function | Enclosing function name. |
| [in] | variable | Name of the char buffer holding the option value. |
| [in] | field | Assigned context field, for example mom_solver_type. |
Definition at line 217 of file generate_capability_inventory.py.
| set[str] generate_capability_inventory.c_switch_values | ( | str | path, |
| str | function, | ||
| str | prefix | ||
| ) |
Extract the enum constants a C factory switch dispatches on.
| [in] | path | Repository-relative C source path. |
| [in] | function | Enclosing function name. |
| [in] | prefix | Enum constant prefix. |
Definition at line 243 of file generate_capability_inventory.py.
| set[str] generate_capability_inventory.c_dispatch_values | ( | str | path, |
| str | function, | ||
| str | prefix | ||
| ) |
Extract the enum constants an if/else dispatch chain compares against.
| [in] | path | Repository-relative C source path. |
| [in] | function | Enclosing function name. |
| [in] | prefix | Enum constant prefix. |
Definition at line 255 of file generate_capability_inventory.py.
| set[str] generate_capability_inventory.c_enum_values | ( | str | path, |
| str | symbol | ||
| ) |
Extract the members of a C enum.
| [in] | path | Repository-relative header path. |
| [in] | symbol | Enum type name. |
Definition at line 267 of file generate_capability_inventory.py.
| dict generate_capability_inventory.python_constant_values | ( | str | module, |
| str | symbol | ||
| ) |
Read the accepted values from a named module-level choice set.
The preferred shape. A choice set written as an inline literal at its point of use is invisible to the census, so the rule is that it must be a named module-level constant - a tuple, list, set, or dict of strings. A dict maps each accepted spelling to what it resolves to; a sequence maps each value to itself.
| [in] | module | Dotted module name. |
| [in] | symbol | Constant name. |
Definition at line 291 of file generate_capability_inventory.py.
| dict generate_capability_inventory.collect | ( | dict | family | ) |
Build one family's inventory record from its declared sources.
| [in] | family | Family registry entry. |
Definition at line 330 of file generate_capability_inventory.py.
| None generate_capability_inventory.apply_metadata | ( | list[dict] | inventory, |
| dict | registry | ||
| ) |
Merge declared per-value metadata (status, alias target) into the inventory.
| [in,out] | inventory | Collected family records. |
| [in] | registry | Parsed registry mapping. |
Definition at line 382 of file generate_capability_inventory.py.
| dict[str, int] generate_capability_inventory.classify | ( | list[dict] | inventory | ) |
Count selectable, alias, and latent values separately.
A single total conflates three different things: what a user can choose, what is only kept readable for old configs, and what is declared but unreachable.
| [in] | inventory | Collected family records. |
Definition at line 409 of file generate_capability_inventory.py.
| None generate_capability_inventory.apply_reachability | ( | list[dict] | inventory, |
| dict | registry | ||
| ) |
Mark declared values that no other family can actually satisfy as latent.
A boundary type is only selectable if some public handler accepts it. Listing a type no handler supports advertises a capability every complete configuration would be rejected for.
| [in,out] | inventory | Collected family records. |
| [in] | registry | Parsed registry mapping. |
Definition at line 432 of file generate_capability_inventory.py.
| str generate_capability_inventory.entry_anchor | ( | dict | registry_entry, |
| str | value | ||
| ) |
Anchor name of the Tier-2 entry for one selector value.
| [in] | registry_entry | Registry entry carrying the anchor prefix. |
| [in] | value | Public selector value. |
Definition at line 465 of file generate_capability_inventory.py.
| str generate_capability_inventory.html_escape | ( | str | text | ) |
Escape text for inclusion in generated HTML.
| [in] | text | Raw text. |
Definition at line 475 of file generate_capability_inventory.py.
| set generate_capability_inventory.documented_entries | ( | dict | family, |
| dict | registry_entry | ||
| ) |
Values whose Tier-2 entry anchor is actually present on the family page.
Generated tables must not link to an entry that does not exist: a deferred or latent value has no anchor, and a dead in-page link is worse than plain text.
| [in] | family | Collected family record. |
| [in] | registry_entry | Registry entry naming the family page. |
Definition at line 484 of file generate_capability_inventory.py.
| str generate_capability_inventory.render_family | ( | dict | family, |
| dict | registry_entry | ||
| ) |
Render one family's value table as a Doxygen-includable HTML fragment.
HTML rather than Markdown because Doxygen's plain include command inserts Markdown verbatim as a code block, while its HTML include command inserts real markup. Each value links to its Tier-2 entry so the inventory is a route into the documentation, not a dead list.
| [in] | family | Collected family record. |
| [in] | registry_entry | Registry entry for the same family. |
Definition at line 506 of file generate_capability_inventory.py.
| Path generate_capability_inventory.family_fragment_path | ( | str | family_id | ) |
Path of the per-family includable fragment.
| [in] | family_id | Family identifier. |
Definition at line 591 of file generate_capability_inventory.py.
| str generate_capability_inventory.render_evidence_matrix | ( | list[dict] | inventory, |
| dict | registry | ||
| ) |
Render the project-wide capability-by-evidence matrix as an HTML fragment.
A scientist deciding whether a result is credible needs to see, in one place, what confidence the project claims for each capability. An empty row is a real answer - it says "implemented only".
| [in] | inventory | Collected family records. |
| [in] | registry | Parsed registry mapping. |
Definition at line 600 of file generate_capability_inventory.py.
| str generate_capability_inventory.render_markdown | ( | list[dict] | inventory | ) |
Render the inventory as a Doxygen-includable Markdown fragment.
| [in] | inventory | Collected family records. |
Definition at line 649 of file generate_capability_inventory.py.
| int generate_capability_inventory.main | ( | ) |
Generate the capability inventory artifacts.
Definition at line 684 of file generate_capability_inventory.py.
| generate_capability_inventory.REPO_ROOT = Path(__file__).resolve().parents[2] |
Definition at line 14 of file generate_capability_inventory.py.
| str generate_capability_inventory.REGISTRY_PATH = REPO_ROOT / "tests" / "tooling" / "capability_families.json" |
Definition at line 15 of file generate_capability_inventory.py.
| str generate_capability_inventory.GENERATED_DIR = REPO_ROOT / "docs" / "generated" |
Definition at line 16 of file generate_capability_inventory.py.