Skip to content

Commit

Permalink
removing update config id, adding update config name
Browse files Browse the repository at this point in the history
  • Loading branch information
tsuchiyama-araya committed Dec 17, 2024
1 parent 5ee0da9 commit ae48fb2
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions studio/app/common/core/experiment/experiment_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,8 @@ def copy_data(self, new_unique_id: str) -> bool:
# Copy directory
shutil.copytree(output_filepath, new_output_filepath)

# Update experiment.yml
if not self.__update_experiment_config_unique_id(
new_output_filepath, new_unique_id
):
# Update experiment.yml experiment name
if not self.__update_experiment_config_name(new_output_filepath):
logger.error("Failed to update experiment.yml after copying.")
return False

Expand Down Expand Up @@ -229,9 +227,7 @@ def __replace_unique_id_in_files(
logger.error(f"Error replacing unique_id in files: {e}")
return False

def __update_experiment_config_unique_id(
self, new_output_filepath: str, new_unique_id: str
) -> bool:
def __update_experiment_config_name(self, new_output_filepath: str) -> bool:
logger = AppLogger.get_logger()
expt_filepath = join_filepath([new_output_filepath, DIRPATH.EXPERIMENT_YML])

Expand All @@ -243,8 +239,6 @@ def __update_experiment_config_unique_id(
logger.error(f"Empty or invalid YAML in {expt_filepath}.")
return False

# Update config fields
config["unique_id"] = new_unique_id
config["name"] = f"{config.get('name', 'experiment')}_copy"

# Write back to the file
Expand Down

0 comments on commit ae48fb2

Please sign in to comment.