INNER CODE UNIT · Python
main
optiland/optiland · benchmarks/optimization/run.py:27
def main(argv: list[str] | None = None) -> int:
"""Run the selected benchmarks and report the results."""
parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
parser.add_argument("--problems", nargs="+", choices=sorted(PROBLEMS))
parser.add_argument("--methods", nargs="+", choices=sorted(METHODS))
parser.add_argument(
"--quick",
action="store_true",
help=f"Run only {', '.join(QUICK_PROBLEMS)} (ignored with --problems).",
)
parser.add_argument("--maxiter", type=int, default=DEFAULT_MAXITER)
parser.add_argument("--json", type=Path, help="Write raw results to this file.")
args = parser.parse_args(argv)
be.set_backend("numpy")
names = args.problems or (list(QUICK_PROBLEMS) if args.quick else list(PROBLEMS))
methods = args.methods or list(METHODS)