Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASIM-5486] - Change GSA results file for consistency #365

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading