Skip to content

Commit

Permalink
feat: gzip compress json file in search best actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin18 committed Nov 23, 2024
1 parent c1d14ee commit 289c522
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/search_best_actions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import gzip
import json

import gymnasium as gym
Expand Down Expand Up @@ -63,7 +64,7 @@ def write_best_actions(
path: str,
actions: dict[int, list[list[int]]],
) -> None:
with open(path, "w", encoding="utf-8") as json_file:
with gzip.open(path, "wt", encoding="utf-8") as json_file:
json.dump(actions, json_file)


Expand All @@ -90,7 +91,7 @@ def write_best_actions(
)
parser.add_argument(
"--output-path",
help="path to output JSON file",
help="path to output GZIP compressed JSON file",
)
args = parser.parse_args()
best_actions = search_best_actions(
Expand Down

0 comments on commit 289c522

Please sign in to comment.