def METHOD_NAME(
    model: calliope.Model,
    outfile: Union[str, Path],
    math: Optional[dict] = None,
    backend: Literal["pyomo"] = "pyomo",
) -> None:
    """
    Write a barebones LP file with which to compare in tests.
    All model parameters and variables will be loaded automatically, as well as a dummy objective if one isn't provided as part of `math`.
    Everything else to be added to the LP file must be defined in `math`.
    Args:
        model (calliope.Model): Calliope model.
        outfile (Union[str, Path]): Path to LP file.
        math (Optional[dict], optional): All constraint/global expression/objective math to apply. Defaults to None.
        backend (Literal["pyomo"], optional): Backend to use to create the LP file. Defaults to "pyomo".
    """
    backend_instance = model._BACKENDS[backend]()
    backend_instance.add_all_parameters(model.inputs, model.run_config)
    for name, dict_ in model.math["variables"].items():
        backend_instance.add_variable(model.inputs, name, dict_)
    if math is not None:
        for component_group, component_math in math.items():
            for name, dict_ in component_math.items():
                getattr(backend_instance, f"add_{component_group.removesuffix('s')}")(
                    model.inputs, name, dict_
                )
    # MUST have an objective for a valid LP file
    if math is None or "objectives" not in math.keys():
        backend_instance.add_objective(
            model.inputs,
            "dummy_obj",
            {"equations": [{"expression": "1 + 1"}], "sense": "minimize"},
        )
    backend_instance._instance.objectives[0].activate()
    backend_instance.verbose_strings()
    backend_instance.to_lp(str(outfile))
    # strip trailing whitespace from `outfile` after the fact,
    # so it can be reliably compared other files in future
    with Path(outfile).open("r") as f:
        stripped_lines = []
        while line := f.readline():
            stripped_lines.append(line.rstrip())
    # reintroduce the trailing newline since both Pyomo and file formatters love them.
    Path(outfile).write_text("\n".join(stripped_lines) + "\n")