Skip to content

Commit

Permalink
Change GSA results file for consistency
Browse files Browse the repository at this point in the history
Change the GSA results filename to result to keep
the consistency with other results file in the ALFAsim.

ASIM-5486
  • Loading branch information
BeneBr committed Mar 24, 2024
1 parent 0e5ef12 commit 165fdf6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/alfasim_sdk/result_reader/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def map_data(
}

with open_result_file(
result_directory, result_filename="uq_result"
result_directory, result_filename="result"
) as result_file:
if not result_file:
return cls.empty(result_directory=result_directory)
Expand Down Expand Up @@ -1687,7 +1687,7 @@ def read_global_sensitivity_analysis_time_set(
"""
Get the time set for sensitivity analysis results.
"""
with open_result_file(result_directory, result_filename="uq_result") as result_file:
with open_result_file(result_directory, result_filename="result") as result_file:
if not result_file:
return
return result_file[GLOBAL_SENSITIVITY_ANALYSIS_GROUP_NAME]["time_set"][:]
Expand All @@ -1705,7 +1705,7 @@ def read_global_sensitivity_coefficients(
return None
meta = metadata.gsa_items[coefficients_key]
with open_result_file(
metadata.result_directory, result_filename="uq_result"
metadata.result_directory, result_filename="result"
) as result_file:
gsa_group = result_file[GLOBAL_SENSITIVITY_ANALYSIS_GROUP_NAME]
coefficients_dset = gsa_group["global_sensitivity_analysis"]
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def global_sa_results_dir(datadir: Path) -> Path:
for qoi in [10]
]
)
file_name = result_dir / "uq_result"
file_name = result_dir / "result"

file = h5py.File(file_name, "x", libver="latest", locking=False)
meta_group = file.create_group(META_GROUP_NAME, track_order=True)
Expand Down
2 changes: 1 addition & 1 deletion tests/results/test_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def test_read_incomplete_gsa_metadata(global_sa_results_dir: Path) -> None:
When a .creating result file exists in the results folder,
the metadata is incomplete, so they will be not read.
"""
creating_file = global_sa_results_dir / "uq_result.creating"
creating_file = global_sa_results_dir / "result.creating"
creating_file.touch()
gsa_time_set = read_global_sensitivity_analysis_time_set(global_sa_results_dir)
assert gsa_time_set is None
Expand Down

0 comments on commit 165fdf6

Please sign in to comment.