From 7d93c701aaab2a880d530058763d4258d39c75aa Mon Sep 17 00:00:00 2001 From: Robbi Bishop-Taylor Date: Thu, 21 Dec 2023 18:00:39 +1100 Subject: [PATCH] Try fixing CSV output --- tests/test_intertidal.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_intertidal.py b/tests/test_intertidal.py index 4743bbd..a4fdbdb 100644 --- a/tests/test_intertidal.py +++ b/tests/test_intertidal.py @@ -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", ): """ @@ -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") @@ -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")