Skip to content

Commit

Permalink
Try fixing CSV output
Browse files Browse the repository at this point in the history
  • Loading branch information
robbibt authored Dec 21, 2023
1 parent 2613636 commit 7d93c70
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_intertidal.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def test_dem_accuracy(
val_path="tests/data/lidar_10m_tests.tif",
mod_path="data/interim/testing/2020-2022/testing_2020_2022_elevation.tif",
output_plot="artifacts/validation.jpg",
input_csv="tests/validation.csv",
output_csv="artifacts/validation.csv",
):
"""
Expand Down Expand Up @@ -90,11 +91,11 @@ def test_dem_accuracy(
# Append results to file, and re-read stats from disk to ensure we get
# older results
accuracy_df.to_csv(
output_csv,
input_csv,
mode="a",
header=(not os.path.exists(output_csv)),
header=(not os.path.exists(input_csv)),
)
accuracy_df = pd.read_csv(output_csv, index_col=0, parse_dates=True)
accuracy_df = pd.read_csv(input_csv, index_col=0, parse_dates=True)

# Extract integration test run times and convert to local time
times_local = accuracy_df.index.tz_convert(tz="Australia/Canberra")
Expand Down Expand Up @@ -176,6 +177,7 @@ def test_dem_accuracy(
ax2.set_xlabel(None)

# Write into mounted artifacts directory
accuracy_df.to_csv(output_csv)
plt.savefig(output_plot, dpi=100, bbox_inches="tight")


Expand Down

0 comments on commit 7d93c70

Please sign in to comment.