Skip to content
Snippets Groups Projects

Resolve "Complete Cooperative Cousine Terminal Command"

Merged Florian Schröder requested to merge 113-complete-cooperative-cousine-terminal-command into dev
9 files
+ 284
211
Compare changes
  • Side-by-side
  • Inline
Files
9
  • Moved the creation of argparse.ArgumentParser objects used to parse command line arguments into a separate module, `argument_parser.py`. This includes organizing all the add_argument calls into specific functions within this new module, in order to increase code readability, reusability and organization within the argument parsing codebase. All existing usages have been updated accordingly.
@@ -13,6 +13,7 @@ import yaml
from scipy.spatial import KDTree
from cooperative_cuisine import ROOT_DIR
from cooperative_cuisine.argument_parser import create_screenshot_parser
from cooperative_cuisine.environment import Environment
from cooperative_cuisine.pygame_2d_vis.game_colors import colors, RGB
from cooperative_cuisine.state_representation import (
@@ -1039,24 +1040,7 @@ def main(args):
description="Generate images for a state in json.",
epilog="For further information, see https://scs.pages.ub.uni-bielefeld.de/cocosy/overcooked-simulator/overcooked_simulator.html",
)
parser.add_argument(
"-s",
"--state",
type=argparse.FileType("r", encoding="UTF-8"),
default=ROOT_DIR / "pygame_2d_vis" / "sample_state.json",
)
parser.add_argument(
"-v",
"--visualization_config",
type=argparse.FileType("r", encoding="UTF-8"),
default=ROOT_DIR / "pygame_2d_vis" / "visualization.yaml",
)
parser.add_argument(
"-o",
"--output_file",
type=str,
default=ROOT_DIR / "generated" / "screenshot.jpg",
)
create_screenshot_parser(parser)
args = parser.parse_args(args)
with open(args.visualization_config, "r") as f:
viz_config = yaml.safe_load(f)
Loading