help="Custom colors to replace the default with.") parser.add_argument("--custom_linestyles", nargs='+', help="Custom linestyles to replace the default with.") parser.add_argument("--legend_colors", nargs='+', help="Custom legend colors to replace the default with.") # Arguments #---------------------------------------------------------------------------- args = parser.parse_args() output_path = "." if args.output: output_path = str(pathlib.Path(args.output).resolve()) else: output_path = find_dir("predictions", 2) predictions_dir = output_path + "/" output_path += "/" + args.comparison_dir + args.name + "/" #output_path = get_uniqe_path(output_path) + "/" output_path += "levelset/" make_dir(output_path) print("Output path: {}".format(output_path)) with open(output_path + "arguments.json", 'w') as f: json.dump(vars(args), f, indent=4) graph_limits = args.y_limits if graph_limits == None or len(graph_limits) != 4: graph_limits = [None] * 4 else: for i, l in enumerate(graph_limits):
if "liquid" in args.type: scene = StaticDynamicScene(resolution=args.resolution, boundary=1, dimension=args.dimension, timestep=0.1, merge_ghost_fluid=True, show_gui=args.gui, pause_on_start=args.pause) elif "gas" in args.type: scene = SmokeScene(resolution=args.resolution, boundary=1, dimension=args.dimension, timestep=0.5, gravity=Vec3(0,-0.003,0), merge_ghost_fluid=True, show_gui=args.gui, pause_on_start=args.pause) grids = [] for grid_name in args.grids: try: getattr(scene, grid_name) except AttributeError as err: print("Scene has no grid named {}".format(grid_name)) else: grids.append(grid_name) args.grids = grids print("Selected grids: {}".format(grids)) if args.meshes: mesh_path = find_dir("meshes") assert os.path.exists(mesh_path), ("Mesh directory {} does not exist".format(mesh_path)) # zoom settings zoom_resolution = None if args.zoom != 1.0: zoom_resolution = int(float(args.resolution) * args.zoom) print("Using zoom resolution: {}".format(zoom_resolution)) # Output #-------------------------------- if not args.no_output: # get the datasets directory, in all datasets should reside if not args.datasets_path: output_path = find_dir("datasets", 2) else:
# Arguments #---------------------------------------------------------------------------- args = parser.parse_args() if args.benchmark != -1: if args.name == "": args.name = args.project + "_Bench{}".format(args.benchmark) else: args.name += "_Bench{}".format(args.benchmark) output_path = "." if args.output: output_path = str(pathlib.Path(args.output).resolve()) else: output_path = find_dir("predictions", 2) output_path += "/" + args.name output_path = get_uniqe_path(output_path) + "/" make_dir(output_path) print("Output path: {}".format(output_path)) if args.output_render_data or args.output_benchmark_data: make_dir(output_path + "uni/") if args.output_sequence: output_seq_path = output_path + "sequence/" make_dir(output_seq_path) description = {"args": vars(args)} #----------------------------------------------------------------------------
if os.path.isfile(directory + "description.json"): with open(directory + "description.json", 'r') as f: desc = json.load(f) assert desc is not None, ("Description '" + directory + "description.json" + "' not found") return desc # Arguments #-------------------------------- args = arguments.display_dataset() # Data Set #-------------------------------- if not args.datasets_path: dataset_path = find_dir("datasets", 2) else: dataset_path = args.datasets_path assert os.path.exists(dataset_path), ( "Datasets directory {} does not exist".format(dataset_path)) # set output parent directory name dataset_path += "/" + args.dataset dataset_path = dataset_path + "/" if args.video: dataset_video_path = dataset_path + "dataset_display/" make_dir(dataset_video_path) print("Reading data set from: {}".format(dataset_path)) # Description
help="Custom colors to replace the default with.") parser.add_argument("--custom_linestyles", nargs='+', help="Custom linestyles to replace the default with.") parser.add_argument("--legend_colors", nargs='+', help="Custom legend colors to replace the default with.") # Arguments #---------------------------------------------------------------------------- args = parser.parse_args() output_path = "." if args.output: output_path = str(pathlib.Path(args.output).resolve()) else: output_path = find_dir("predictions", 2) output_path += "/" + args.comparison_dir + args.name + "/" #output_path = get_uniqe_path(output_path) + "/" output_path += "pressure/" make_dir(output_path) print("Output path: {}".format(output_path)) with open(output_path + "arguments.json", 'w') as f: json.dump(vars(args), f, indent=4) graph_limits = args.y_limits if graph_limits == None or len(graph_limits) != 8: graph_limits = [None] * 8 else: for i, l in enumerate(graph_limits): graph_limits[i] = float(l)