diff --git a/menu_tools/caching/cache_objects.py b/menu_tools/caching/cache_objects.py index ee23a7d3..4c304755 100755 --- a/menu_tools/caching/cache_objects.py +++ b/menu_tools/caching/cache_objects.py @@ -323,7 +323,7 @@ def load(self): self._save_array_to_parquet() -if __name__ == "__main__": +def parse_args(): parser = argparse.ArgumentParser() parser.add_argument( "cfg", @@ -336,6 +336,11 @@ def load(self): help="Only do print-out of objects and branches to be loaded.", ) args = parser.parse_args() + return args + + +def main(): + args = parse_args() with open(args.cfg, "r") as f: cfg = yaml.safe_load(f) @@ -358,3 +363,7 @@ def load(self): dryrun=args.dry_run, ) loader.load() + + +if __name__ == "__main__": + main() diff --git a/pyproject.toml b/pyproject.toml index 8d56b34f..33356ede 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,6 +44,7 @@ flake8 = "^7.0.0" pytest = "7.4.3" [tool.poetry.scripts] +cache_objects = "menu_tools.caching.cache_objects:main" object_performance = "menu_tools.object_performance.plotter:main" rate_plots = "menu_tools.rate_plots.plotter:main"