Skip to content
Closed
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
2 changes: 1 addition & 1 deletion pywr_utils/model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def run_incremental_sizes(max_zones=100, zone_increment=10, max_transfers=None,
# Save results to CSV
if results:
df = pd.DataFrame(results)
output_path = os.path.join(output_dir, output_csv)
output_path = output_csv
try:
df.to_csv(output_path, index=False)
print(f"\nResults saved to {os.path.abspath(output_path)}")
Expand Down
4 changes: 0 additions & 4 deletions tests/integration/test_incremental_sweep_failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ def test_the_confirmed_summary_reports_its_size_on_disk(workdir, capsys):
assert f"File size: {(workdir / 'timings.csv').stat().st_size} bytes" in output


@pytest.mark.xfail(
strict=True,
reason="run_incremental_sizes joins the output directory onto a path that already contains it, so an output_csv with any directory component is written to <dir>/<dir>/<name> and the whole sweep's results are lost to an OSError after every model has already been run.",
)
def test_an_output_path_with_a_directory_component_is_written_where_it_was_asked_for(workdir):
run_incremental_sizes(max_zones=2, zone_increment=2, transfer_increment=2, output_csv="results/timings.csv")

Expand Down
Loading