Skip to content

Commit

Permalink
add more corner cases to the write_file_name that i didnt thought abo…
Browse files Browse the repository at this point in the history
…ut earlier
  • Loading branch information
Jgmedina95 committed Mar 13, 2024
1 parent ad4777d commit 9875641
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mdagent/utils/path_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,12 @@ def write_file_name(self, type: FileType, **kwargs):
else:
file_name += f"FIG_{fig_analysis}_{time_stamp}.{file_format}"
else:
file_name += f"FIG_{time_stamp}.{file_format}"
if Sim_id:
file_name += f"FIG_{Sim_id}_{time_stamp}.{file_format}"
elif Log_id:
file_name += f"FIG_{Log_id}_{time_stamp}.{file_format}"
else:
file_name += f"FIG_{time_stamp}.{file_format}"

if file_name == "":
file_name += "ErrorDuringNaming_error.py"
Expand Down
1 change: 1 addition & 0 deletions tests/test_util_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def test_write_file_name_figure_1(path_registry, todays_date):
protein_file_id="123",
Sim_id="SIM456",
time_stamp=todays_date,
file_format="png",
irrelevant="irrelevant",
)
assert "FIG_SIM456_123_" in file_name
Expand Down

0 comments on commit 9875641

Please sign in to comment.