def save(self): data = self.marshall() training_info_path = build_training_info_path(self.environment, self.species) with open(training_info_path, 'w') as f: f.write(json.dumps(data)) print("Saved training info to", training_info_path)
def load(cls, environment, species): training_info_path = build_training_info_path(environment, species) if not os.path.exists(training_info_path): return cls( environment=environment, species=species, batches=[], ) data = json.loads(open(training_info_path, 'r').read()) return cls.unmarshall(data)