Skip to content

Commit

Permalink
Log
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonMarechal25 committed Nov 14, 2024
1 parent 0047af1 commit 05d1817
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/cpp/helpers/ArchiveReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ void ArchiveReader::Create() {
}

int32_t ArchiveReader::Open() {
if (!std::filesystem::exists(ArchivePath())) {
std::ostringstream errMsg;
errMsg << "Archive: " << ArchivePath().string() << " does not exist"
<< std::endl;
throw ArchiveIOGeneralException(MZ_EXIST_ERROR, errMsg.str(), LOGLOCATION);
}
auto err = mz_zip_reader_open_file(pmz_zip_reader_instance_,
ArchivePath().string().c_str());
if (err != MZ_OK) {
Expand Down
15 changes: 7 additions & 8 deletions tests/end_to_end/cucumber/features/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,13 @@ def run_antares_xpansion(context, method, memory=None, n: int = 1):

context.return_code = run_command(context.tmp_study, memory=memory, method=method, n_mpi=n,
allow_run_as_root=get_conf("allow_run_as_root"))

output_path = context.tmp_study / "output"
outputs = read_outputs(output_path, use_archive=not memory, lold=True, positive_unsupplied_energy=True)
context.outputs = outputs.out_json
context.options_data = outputs.options_json
context.lold = outputs.lold
context.positive_unsupplied_energy = outputs.positive_unsupplied_energy
print(f"output path is {output_path}")
if context.return_code == 0: # If the simulation failed we're not sur outputs have been generated properly
output_path = context.tmp_study / "output"
outputs = read_outputs(output_path, use_archive=not memory, lold=True, positive_unsupplied_energy=True)
context.outputs = outputs.out_json
context.options_data = outputs.options_json
context.lold = outputs.lold
context.positive_unsupplied_energy = outputs.positive_unsupplied_energy


def run_command(study_path, memory, method, n_mpi, allow_run_as_root=False):
Expand Down

0 comments on commit 05d1817

Please sign in to comment.