3434
3535
3636def write_benchmark_result_to_disk (
37- name : str ,
37+ benchmark_name : str ,
3838 result : BenchmarkResult ,
3939 output_dir : str | os .PathLike ,
4040) -> None :
4141 """Writes a benchmark result to disk.
4242
4343 Args:
44- name : The benchmark name.
44+ benchmark_name : The benchmark name.
4545 result: The benchmark result.
4646 output_dir: Directory to which to write the result.
4747 """
4848 _output_dir = Path (output_dir )
4949 _output_dir .mkdir (exist_ok = True , parents = True )
50- (_output_dir / name ).mkdir (exist_ok = True )
50+ (_output_dir / benchmark_name ).mkdir (exist_ok = True )
5151
52- with (_output_dir / name / RESULT_FILENAME ).open ("w" ) as json_file :
52+ with (_output_dir / benchmark_name / RESULT_FILENAME ).open ("w" ) as json_file :
5353 json_as_str = json .loads (result .model_dump_json ()) # type: ignore
5454 json .dump (json_as_str , json_file , indent = 2 )
5555
@@ -192,20 +192,20 @@ def load_scores_from_disk(
192192
193193
194194def write_model_output_to_disk (
195- name : str , model_output : ModelOutput , output_dir : str | os .PathLike
195+ benchmark_name : str , model_output : ModelOutput , output_dir : str | os .PathLike
196196) -> None :
197197 """Writes a model output to disk.
198198
199199 Each model output is written to disk as a zip archive.
200200
201201 Args:
202- name : The benchmark name.
202+ benchmark_name : The benchmark name.
203203 model_output: The model output to save.
204204 output_dir: Directory to which to write the model output.
205205 """
206206 _output_dir = Path (output_dir )
207207 _output_dir .mkdir (exist_ok = True , parents = True )
208- (_output_dir / name ).mkdir (exist_ok = True )
208+ (_output_dir / benchmark_name ).mkdir (exist_ok = True )
209209
210210 data , arrays = dataclass_to_dict_with_arrays (model_output )
211211
@@ -218,7 +218,9 @@ def write_model_output_to_disk(
218218
219219 np .savez (arrays_path , ** arrays )
220220
221- with ZipFile (_output_dir / name / MODEL_OUTPUT_ZIP_FILENAME , "w" ) as zip_object :
221+ with ZipFile (
222+ _output_dir / benchmark_name / MODEL_OUTPUT_ZIP_FILENAME , "w"
223+ ) as zip_object :
222224 zip_object .write (json_path , os .path .basename (json_path ))
223225 zip_object .write (arrays_path , os .path .basename (arrays_path ))
224226
0 commit comments