Only open pickle file if planner was successfully generated

This commit is contained in:
Joe Knapper 2025-04-17 08:48:14 +00:00
parent 1248c2b7c8
commit 041106ebea

View file

@ -175,8 +175,8 @@ def update_example_smart_spiral_pickle(sample_name: str):
pickle for each sample type
"""
pkl_fname = os.path.join(THIS_DIR, f"example_smart_spiral_{sample_name}.pkl")
_, planner = example_smart_spiral(sample_name)
with open(pkl_fname, "wb") as pkl_file_obj:
_, planner = example_smart_spiral(sample_name)
pickle.dump(planner, pkl_file_obj, pickle.HIGHEST_PROTOCOL)