module documentation

Utility functions for data exploration and visualization.

Function bring_consensus_col_to_left Make sure the consensus column is the third top-level column.
Function get_institution_shortname Replace the institution names with their abbreviations.
Function get_nested_fields Recursively get all fields of a Pydantic model, including nested models.
Function map_to_cell_classes Return a class for each cell of the patients table.
Function replace_nan Replace NaN values with replacement in the table view.
Function smart_capitalize Only capitalize words that are not all caps (e.g. abbreviations).
Function split_and_capitalize Split the string on underscores and capitalize each word.
Function style_table Style the pandas.DataFrame HTML for better readability.
Variable logger Undocumented
def bring_consensus_col_to_left(patients: pd.DataFrame) -> pd.DataFrame:

Make sure the consensus column is the third top-level column.

def get_institution_shortname(value: str) -> str:

Replace the institution names with their abbreviations.

def get_nested_fields(model: type[BaseModel]) -> dict[str, Any]:

Recursively get all fields of a Pydantic model, including nested models.

def map_to_cell_classes(patients: pd.DataFrame) -> pd.DataFrame:

Return a class for each cell of the patients table.

def replace_nan(value: Any, replacement: str = '-') -> str:

Replace NaN values with replacement in the table view.

def smart_capitalize(value: str) -> str:

Only capitalize words that are not all caps (e.g. abbreviations).

def split_and_capitalize(value: str) -> str:

Split the string on underscores and capitalize each word.

This is used to format the index of the pandas.DataFrame in the table view.

def style_table(patients: pd.DataFrame) -> Styler:

Style the pandas.DataFrame HTML for better readability.

logger =

Undocumented