Skip to content

Commit

Permalink
add shortcut entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhundhausen committed Feb 1, 2024
1 parent 98472c0 commit ca4084a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion menu_tools/caching/cache_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)
Expand All @@ -358,3 +363,7 @@ def load(self):
dryrun=args.dry_run,
)
loader.load()


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit ca4084a

Please sign in to comment.