fix a typo (#62)
This commit is contained in:
@@ -11,7 +11,7 @@ from typing import Callable, List
|
|||||||
import tqdm
|
import tqdm
|
||||||
from metadrive.scenario.scenario_description import ScenarioDescription
|
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__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ def merge_database(
|
|||||||
summaries.pop(file)
|
summaries.pop(file)
|
||||||
mappings.pop(file)
|
mappings.pop(file)
|
||||||
if save:
|
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
|
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]
|
rel_path = mappings[scenario_file]
|
||||||
shutil.copyfile(os.path.join(to_path, rel_path, scenario_file), os.path.join(to_path, 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()}
|
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 remove_source:
|
||||||
if ScenarioDescription.DATASET.MAPPING_FILE in files and ScenarioDescription.DATASET.SUMMARY_FILE in files \
|
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_summary[scenario] = summaries[scenario]
|
||||||
selected_mapping[scenario] = os.path.relpath(osp.join(abs_dir_path, mappings[scenario]), output_abs_path)
|
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
|
return summaries, mappings
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ def dict_recursive_remove_array_and_set(d):
|
|||||||
return 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:
|
with open(summary_file_path, "wb") as file:
|
||||||
pickle.dump(dict_recursive_remove_array_and_set(summary), file)
|
pickle.dump(dict_recursive_remove_array_and_set(summary), file)
|
||||||
with open(mapping_file_path, "wb") as file:
|
with open(mapping_file_path, "wb") as file:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import tqdm
|
|||||||
from metadrive.scenario import ScenarioDescription as SD
|
from metadrive.scenario import ScenarioDescription as SD
|
||||||
|
|
||||||
from scenarionet.builder.utils import merge_database
|
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
|
from scenarionet.converter.pg.utils import convert_pg_scenario, make_env
|
||||||
|
|
||||||
logger = logging.getLogger(__file__)
|
logger = logging.getLogger(__file__)
|
||||||
@@ -249,7 +249,7 @@ def write_to_directory_single_worker(
|
|||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
# store summary file
|
# 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
|
# rename and save
|
||||||
if delay_remove is not None:
|
if delay_remove is not None:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from typing import List
|
|||||||
|
|
||||||
from metadrive.scenario.scenario_description import ScenarioDescription as SD
|
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__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -98,5 +98,5 @@ class ErrorFile:
|
|||||||
new_summary[scenario] = origin_summary[scenario]
|
new_summary[scenario] = origin_summary[scenario]
|
||||||
scenario_dir = os.path.join(origin_dataset_path, origin_mapping[scenario])
|
scenario_dir = os.path.join(origin_dataset_path, origin_mapping[scenario])
|
||||||
new_mapping[scenario] = os.path.relpath(scenario_dir, new_dataset_path)
|
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
|
return new_summary, new_mapping
|
||||||
|
|||||||
Reference in New Issue
Block a user