From 68faed8aebbb3f6f47f627bbd61042d461f26665 Mon Sep 17 00:00:00 2001 From: Biel Stela Date: Mon, 8 Apr 2024 12:49:09 +0200 Subject: [PATCH] Improve tif fixture documentation --- api/tests/test_main.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/api/tests/test_main.py b/api/tests/test_main.py index 75ec2e3f..cbdbf40b 100644 --- a/api/tests/test_main.py +++ b/api/tests/test_main.py @@ -45,8 +45,17 @@ def setup_data_folder(): @pytest.fixture() def tif_file(setup_data_folder): + """Create a test raster file. + + [[0, 1, 0], + [1, 9, 1], + [0, 1, 0]] + + The raster is a 3x3 grid with the upper left corner at 0E, 10N and 1 degree pixel size. + The bbox is BoundingBox(left=0.0, bottom=7.0, right=3.0, top=10.0) + """ data = np.array([[0, 1, 0], [1, 9, 1], [0, 1, 0]]) - transform = rasterio.transform.from_origin(0, 10, 1, 1) # upper left corner at 0E, 10N and 1 degree pixel size + transform = rasterio.transform.from_origin(0, 10, 1, 1) with rasterio.open( f"{get_settings().tif_path}/raster.tif", "w",