fix a typo (#62)

This commit is contained in:
Zhenghao Peng
2024-02-19 16:50:49 -08:00
committed by GitHub
parent d0d8224957
commit b95898e9f6
4 changed files with 9 additions and 9 deletions

View File

@@ -11,7 +11,7 @@ from typing import Callable, List
import tqdm
from metadrive.scenario.scenario_description import ScenarioDescription
from scenarionet.common_utils import save_summary_anda_mapping
from scenarionet.common_utils import save_summary_and_mapping
logger = logging.getLogger(__name__)
@@ -110,7 +110,7 @@ def merge_database(
summaries.pop(file)
mappings.pop(file)
if save:
save_summary_anda_mapping(summary_file, mapping_file, summaries, mappings)
save_summary_and_mapping(summary_file, mapping_file, summaries, mappings)
return summaries, mappings
@@ -144,7 +144,7 @@ def copy_database(from_path, to_path, exist_ok=False, overwrite=False, copy_raw_
rel_path = mappings[scenario_file]
shutil.copyfile(os.path.join(to_path, rel_path, scenario_file), os.path.join(to_path, scenario_file))
mappings = {key: "./" for key in summaries.keys()}
save_summary_anda_mapping(summary_file, mapping_file, summaries, mappings)
save_summary_and_mapping(summary_file, mapping_file, summaries, mappings)
if remove_source:
if ScenarioDescription.DATASET.MAPPING_FILE in files and ScenarioDescription.DATASET.SUMMARY_FILE in files \
@@ -204,6 +204,6 @@ def split_database(
selected_summary[scenario] = summaries[scenario]
selected_mapping[scenario] = os.path.relpath(osp.join(abs_dir_path, mappings[scenario]), output_abs_path)
save_summary_anda_mapping(summary_file, mapping_file, selected_summary, selected_mapping)
save_summary_and_mapping(summary_file, mapping_file, selected_summary, selected_mapping)
return summaries, mappings

View File

@@ -66,7 +66,7 @@ def dict_recursive_remove_array_and_set(d):
return d
def save_summary_anda_mapping(summary_file_path, mapping_file_path, summary, mapping):
def save_summary_and_mapping(summary_file_path, mapping_file_path, summary, mapping):
with open(summary_file_path, "wb") as file:
pickle.dump(dict_recursive_remove_array_and_set(summary), file)
with open(mapping_file_path, "wb") as file:

View File

@@ -15,7 +15,7 @@ import tqdm
from metadrive.scenario import ScenarioDescription as SD
from scenarionet.builder.utils import merge_database
from scenarionet.common_utils import save_summary_anda_mapping
from scenarionet.common_utils import save_summary_and_mapping
from scenarionet.converter.pg.utils import convert_pg_scenario, make_env
logger = logging.getLogger(__file__)
@@ -249,7 +249,7 @@ def write_to_directory_single_worker(
count += 1
# store summary file
save_summary_anda_mapping(summary_file_path, mapping_file_path, summary, mapping)
save_summary_and_mapping(summary_file_path, mapping_file_path, summary, mapping)
# rename and save
if delay_remove is not None:

View File

@@ -6,7 +6,7 @@ from typing import List
from metadrive.scenario.scenario_description import ScenarioDescription as SD
from scenarionet.common_utils import save_summary_anda_mapping, read_dataset_summary
from scenarionet.common_utils import save_summary_and_mapping, read_dataset_summary
logger = logging.getLogger(__name__)
@@ -98,5 +98,5 @@ class ErrorFile:
new_summary[scenario] = origin_summary[scenario]
scenario_dir = os.path.join(origin_dataset_path, origin_mapping[scenario])
new_mapping[scenario] = os.path.relpath(scenario_dir, new_dataset_path)
save_summary_anda_mapping(new_summary_file_path, new_mapping_file_path, new_summary, new_mapping)
save_summary_and_mapping(new_summary_file_path, new_mapping_file_path, new_summary, new_mapping)
return new_summary, new_mapping