![]() |
ATLAS Offline Software
|
Functions | |
| Dict[str, List[Dict[str, Any]]] | load_output_variables (str yaml_filepath) |
| Dict[str, Any] | extract_block_options (Type block_class) |
| Optional[str] | interpret_physical_unit (str info) |
| str | process_info_links (str info) |
| str | link_jira_tickets (str info) |
| List[Dict[str, Any]] | extract_from_classes (List[Type] block_classes, Optional[Union[str, List[str]]] output_vars_yaml=None) |
| None | save_as_yaml (List[Dict[str, Any]] data, str filepath) |
| str | generate_block_markdown (Dict[str, Any] block_info) |
| None | process_markdown_with_autogen (str input_filepath, str output_filepath, List[Dict[str, Any]] block_data) |
Variables | |
| logger = logging.getLogger("AutogenDocumentation") | |
Core methods to extract options information from ConfigBlock classes and merge with output variables metadata from a YAML file.
Extract options information from a ConfigBlock subclass.
Args:
block_class: A class that inherits from ConfigBlock
Returns:
A dictionary containing the class name and its options
Definition at line 40 of file AutogenDocumentation.py.
| List[Dict[str, Any]] python.AutogenDocumentation.extract_from_classes | ( | List[Type] | block_classes, |
| Optional[Union[str, List[str]]] | output_vars_yaml = None ) |
Extract options information from a list of ConfigBlock classes and merge
with output variables metadata.
Args:
block_classes: List of classes that inherit from ConfigBlock
output_vars_yaml: Optional path to YAML file or list of paths to YAML files
containing output variables. If multiple files provided,
their contents will be merged. Files are located using
find_datafile.
Returns:
List of dictionaries, each containing information about a block class
Definition at line 190 of file AutogenDocumentation.py.
Generate Markdown documentation for a single block.
Args:
block_info: Dictionary containing block information with keys:
- class: Block class name
- module: Module containing the block
- options: List of option dictionaries
- output_variables: List of output variable dictionaries
Returns:
Markdown string for this block
Definition at line 252 of file AutogenDocumentation.py.
Extract a physical unit from an info string.
Currently looks for energy units like MeV or GeV.
Args:
info: The information string from an option.
Returns:
The detected unit as a string ("MeV", "GeV", etc.) or None if no unit is found.
Definition at line 92 of file AutogenDocumentation.py.
Convert JIRA ticket references in a string to Markdown links.
- JIRA tickets are of the form: all-caps letters, a dash, then digits (e.g., ATLASG-2358)
- Converted to Markdown links: [ATLASG-2358](https://its.cern.ch/jira/browse/ATLASG-2358)
Args:
info: Input string that may contain JIRA tickets.
Returns:
The string with JIRA tickets converted to Markdown links.
Definition at line 163 of file AutogenDocumentation.py.
| Dict[str, List[Dict[str, Any]]] python.AutogenDocumentation.load_output_variables | ( | str | yaml_filepath | ) |
Load output variables metadata from YAML file.
Expected YAML format:
BlockClassName:
- name: variable_name
description: Variable description
toggled_by: Optional condition description
Args:
yaml_filepath: Path to the YAML file
Returns:
Dictionary mapping block class names to their output variables
Definition at line 19 of file AutogenDocumentation.py.
Scan an info string for backtick-enclosed substrings of the form `A::B`.
Turn them into a link to the appropriate module/files.
Args:
info: The input info string.
Returns:
The processed string with Markdown links where applicable.
Definition at line 132 of file AutogenDocumentation.py.
| None python.AutogenDocumentation.process_markdown_with_autogen | ( | str | input_filepath, |
| str | output_filepath, | ||
| List[Dict[str, Any]] | block_data ) |
Process an input markdown file, replacing AUTOGEN<BlockName> markers
with generated block documentation.
Looks for lines of the form "AUTOGEN<BlockName>" and replaces them
with the generated markdown for that block. All other content is
left untouched.
Args:
input_filepath: Path to the input markdown file
output_filepath: Path to write the processed output
block_data: List of extracted block information dictionaries
Raises:
FileNotFoundError: If input file does not exist
ValueError: If a referenced block is not found in block_data
Definition at line 369 of file AutogenDocumentation.py.
Save extracted data as YAML.
Definition at line 245 of file AutogenDocumentation.py.
| python.AutogenDocumentation.logger = logging.getLogger("AutogenDocumentation") |
Definition at line 17 of file AutogenDocumentation.py.