From 106f340c70d502319bdb47b9ae480730730c9600 Mon Sep 17 00:00:00 2001 From: Anne Beyer Date: Mon, 29 Jan 2024 17:23:14 +0100 Subject: [PATCH 1/2] add option to specify filename for instances in GameInstanceGenerator.generate(), default is set to instances.json to allow for backward compatibility --- clemgame/clemgame.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clemgame/clemgame.py b/clemgame/clemgame.py index 10b11d7207..215be677ad 100644 --- a/clemgame/clemgame.py +++ b/clemgame/clemgame.py @@ -838,12 +838,12 @@ def add_game_instance(self, experiment: Dict, game_id): def on_generate(self): raise NotImplementedError() - def generate(self): + def generate(self, filename="instances.json"): self.on_generate() - self.store() + self.store(filename) - def store(self): - self.store_file(self.instances, "instances.json", sub_dir="in") + def store(self, filename): + self.store_file(self.instances, filename, sub_dir="in") def load_benchmarks(do_setup: bool = True) -> List[GameBenchmark]: From 063c97cf01254bf0aaa6ffc8eed40622ce477e9e Mon Sep 17 00:00:00 2001 From: Anne Beyer Date: Tue, 6 Feb 2024 08:57:54 +0100 Subject: [PATCH 2/2] inline no where else used storing function --- clemgame/clemgame.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/clemgame/clemgame.py b/clemgame/clemgame.py index 215be677ad..52e7972ad7 100644 --- a/clemgame/clemgame.py +++ b/clemgame/clemgame.py @@ -840,9 +840,6 @@ def on_generate(self): def generate(self, filename="instances.json"): self.on_generate() - self.store(filename) - - def store(self, filename): self.store_file(self.instances, filename, sub_dir="in")