Skip to content

Commit

Permalink
fix(export): ZIP outputs are now uncompressed before export (#1656)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle authored Jul 19, 2023
1 parent e88d4ee commit 6ac7d6c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 9 additions & 4 deletions antarest/study/storage/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,15 @@ def export_study_flat(
if output_list_filter is not None:
os.mkdir(output_dest_path)
for output in output_list_filter:
shutil.copytree(
src=output_src_path / output,
dst=output_dest_path / output,
)
zip_path = output_src_path / f"{output}.zip"
if zip_path.exists():
with ZipFile(zip_path) as zf:
zf.extractall(output_dest_path / output)
else:
shutil.copytree(
src=output_src_path / output,
dst=output_dest_path / output,
)
else:
shutil.copytree(
src=output_src_path,
Expand Down
4 changes: 3 additions & 1 deletion tests/storage/integration/test_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def test_exporter_file_no_output(


@pytest.mark.parametrize("outputs", [True, False, "prout"])
@pytest.mark.parametrize("output_list", [None, [], ["20201014-1427eco"]])
@pytest.mark.parametrize(
"output_list", [None, [], ["20201014-1427eco"], ["20201014-1430adq-2"]]
)
@pytest.mark.parametrize("denormalize", [True, False])
def test_export_flat(
tmp_path: Path,
Expand Down

0 comments on commit 6ac7d6c

Please sign in to comment.