Repository: fractal-analytics-platform/fractal-client (language: python)

Issue:
Remove obsolete folders from `tests/data`



Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0397f29b2..4c70daca0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
 **Note**: Numbers like (\#123) point to closed Pull Requests on the fractal repository.
 
 * Exclude `common/tests` and other files from build (\#523).
+* Remove obsolete folders from `tests/data` (\#526).
 
 # 1.3.2
 


Test patch:
diff --git a/tests/data/generate_zarr_ones.py b/tests/data/generate_zarr_ones.py
deleted file mode 100644
index 49062f67e..000000000
--- a/tests/data/generate_zarr_ones.py
+++ /dev/null
@@ -1,115 +0,0 @@
-import json
-import os
-import shutil
-
-import dask.array as da
-import numpy as np
-import pandas as pd
-import zarr
-from anndata.experimental import write_elem
-from fractal_tasks_core.lib_regions_of_interest import prepare_FOV_ROI_table
-
-
-num_C = 2
-num_Z = 2
-num_Y = 2
-num_X = 1
-num_levels = 5
-cxy = 2
-
-
-x = da.ones(
-    (num_C, num_Z, num_Y * 2160, num_X * 2560), chunks=(1, 1, 2160, 2560)
-).astype(np.uint16)
-
-
-zarrurl = "plate_ones.zarr/"
-
-if os.path.isdir(zarrurl):
-    shutil.rmtree(zarrurl)
-component = "B/03/0/"
-
-for ind_level in range(num_levels):
-    scale = 2**ind_level
-    y = da.coarsen(np.min, x, {2: scale, 3: scale}).rechunk(
-        (1, 1, 2160, 2560), balance=True
-    )
-    y.to_zarr(
-        zarrurl, component=f"{component}{ind_level}", dimension_separator="/"
-    )
-
-pxl_x = 0.1625
-pxl_y = 0.1625
-pxl_z = 1.0
-
-axes = [
-    {"name": "c", "type": "channel"},
-    {"name": "z", "type": "space", "unit": "micrometer"},
-    {"name": "y", "type": "space", "unit": "micrometer"},
-    {"name": "x", "type": "space", "unit": "micrometer"},
-]
-
-cT = "coordinateTransformations"
-zattrs = {
-    "multiscales": [
-        {
-            "axes": axes,
-            "datasets": [
-                {
-                    "path": level,
-                    cT: [
-                        {
-                            "type": "scale",
-                            "scale": [
-                                pxl_z,
-                                pxl_y * cxy**level,
-                                pxl_x * cxy**level,
-                            ],
-                        }
-                    ],
-                }
-                for level in range(num_levels)
-            ],
-            "version": "0.3",
-        }
-    ]
-}
-with open(f"{zarrurl}{component}.zattrs", "w") as jsonfile:
-    json.dump(zattrs, jsonfile)
-
-
-pixel_size_z = 1.0
-pixel_size_y = 0.1625
-pixel_size_x = 0.1625
-
-df = pd.DataFrame(np.zeros((2, 10)), dtype=int)
-df.index = ["FOV1", "FOV2"]
-df.columns = [
-    "x_micrometer",
-    "y_micrometer",
-    "z_micrometer",
-    "x_pixel",
-    "y_pixel",
-    "z_pixel",
-    "pixel_size_x",
-    "pixel_size_y",
-    "pixel_size_z",
-    "bit_depth",
-]
-df["x_micrometer"] = [0.0, 0.0]
-df["y_micrometer"] = [0.0, 351.0]
-df["z_micrometer"] = [0.0, 0.0]
-df["x_pixel"] = [2560] * 2
-df["y_pixel"] = [2160] * 2
-df["z_pixel"] = [num_Z] * 2
-df["pixel_size_x"] = [pxl_x] * 2
-df["pixel_size_y"] = [pxl_y] * 2
-df["pixel_size_z"] = [pxl_z] * 2
-df["bit_depth"] = [16.0, 16.0]
-
-
-FOV_ROI_table = prepare_FOV_ROI_table(df)
-print(FOV_ROI_table.to_df())
-
-group_tables = zarr.group(f"{zarrurl}{component}/tables")
-write_elem(group_tables, "FOV_ROI_table", FOV_ROI_table)
diff --git a/tests/data/illumination_correction/generate_correction_matrix.py b/tests/data/illumination_correction/generate_correction_matrix.py
deleted file mode 100644
index d14e0830c..000000000
--- a/tests/data/illumination_correction/generate_correction_matrix.py
+++ /dev/null
@@ -1,5 +0,0 @@
-import numpy as np
-from PIL import Image
-
-im1 = np.ones(2160 * 2560, dtype=np.uint16).reshape(2160, 2560)
-Image.fromarray(im1).save("illum_corr_matrix.png", optimize=True)
diff --git a/tests/data/illumination_correction/illum.json b/tests/data/illumination_correction/illum.json
deleted file mode 100644
index 46ac8a21f..000000000
--- a/tests/data/illumination_correction/illum.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-"root_path_corr": "tests/data/illumination_correction",
-"A01_C01": "illum_corr_matrix.png",
-"A02_C02": "illum_corr_matrix.png"
-}
diff --git a/tests/data/illumination_correction/illum_corr_matrix.png b/tests/data/illumination_correction/illum_corr_matrix.png
deleted file mode 100644
index 88fe56626..000000000
Binary files a/tests/data/illumination_correction/illum_corr_matrix.png and /dev/null differ
diff --git a/tests/data/png/MeasurementData.mlf b/tests/data/png/MeasurementData.mlf
deleted file mode 100755
index e2161f04d..000000000
--- a/tests/data/png/MeasurementData.mlf
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<bts:MeasurementData bts:Version="1.0" xmlns:bts="http://www.yokogawa.co.jp/BTS/BTSSchema/1.0">
-<bts:MeasurementRecord bts:Type="IMG" bts:Time="2020-08-12T17:36:36.234+02:00" bts:Column="3" bts:Row="2" bts:TimePoint="2" bts:FieldIndex="1" bts:ZIndex="1" bts:TimelineIndex="1" bts:ActionIndex="1" bts:Action="3D" bts:X="-1448.3" bts:Y="1517.7" bts:Z="-2.0" bts:Ch="1">myplate_B03_T0002F001L01A01Z01C01.png</bts:MeasurementRecord>
-<bts:MeasurementRecord bts:Type="IMG" bts:Time="2020-08-12T17:36:36.234+02:00" bts:Column="3" bts:Row="2" bts:TimePoint="2" bts:FieldIndex="1" bts:ZIndex="2" bts:TimelineIndex="1" bts:ActionIndex="1" bts:Action="3D" bts:X="-1448.3" bts:Y="1517.7" bts:Z="-1.0" bts:Ch="1">myplate_B03_T0002F001L01A01Z02C01.png</bts:MeasurementRecord>
-<bts:MeasurementRecord bts:Type="IMG" bts:Time="2020-08-12T17:36:46.322+02:00" bts:Column="3" bts:Row="2" bts:TimePoint="2" bts:FieldIndex="2" bts:ZIndex="1" bts:TimelineIndex="1" bts:ActionIndex="1" bts:Action="3D" bts:X="-1032.3" bts:Y="1517.7" bts:Z="-2.0" bts:Ch="1">myplate_B03_T0002F002L01A01Z01C01.png</bts:MeasurementRecord>
-<bts:MeasurementRecord bts:Type="IMG" bts:Time="2020-08-12T17:36:46.322+02:00" bts:Column="3" bts:Row="2" bts:TimePoint="2" bts:FieldIndex="2" bts:ZIndex="2" bts:TimelineIndex="1" bts:ActionIndex="1" bts:Action="3D" bts:X="-1032.3" bts:Y="1517.7" bts:Z="-1.0" bts:Ch="1">myplate_B03_T0002F002L01A01Z02C01.png</bts:MeasurementRecord>
-</bts:MeasurementData>
diff --git a/tests/data/png/MeasurementDetail.mrf b/tests/data/png/MeasurementDetail.mrf
deleted file mode 100644
index df80363f1..000000000
--- a/tests/data/png/MeasurementDetail.mrf
+++ /dev/null
@@ -1,5 +0,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<bts:MeasurementDetail bts:Version="1.0" bts:OperatorName="Joel" bts:Title="20200812-CardiomyocyteDifferentiation14-Cycle1" bts:Application="" bts:BeginTime="2020-08-12T17:27:17.603876+02:00" bts:EndTime="2020-08-13T03:20:17.1789113+02:00" bts:MeasurementSettingFileName="20200812-Joel-CardiomyocyteDifferentiation14-Cycle1.mes" bts:ColumnCount="12" bts:RowCount="8" bts:TimePointCount="5" bts:FieldCount="72" bts:ZCount="42" bts:TargetSystem="CV7000 FD" bts:ReleaseNumber="R1.17.05" xmlns:bts="http://www.yokogawa.co.jp/BTS/BTSSchema/1.0">
-  <bts:MeasurementSamplePlate bts:Name="20200812-CardiomyocyteDifferentiation14-Cycle1" bts:WellPlateFileName="20200812-CardiomyocyteDifferentiation14-Cycle1.wpi" bts:WellPlateProductFileName="1009602002_Greiner_#655090.wpp" />
-  <bts:MeasurementChannel bts:Ch="1" bts:HorizontalPixelDimension="0.1625" bts:VerticalPixelDimension="0.1625" bts:CameraNumber="3" bts:InputBitDepth="16" bts:InputLevel="1000" bts:HorizontalPixels="2560" bts:VerticalPixels="2160" bts:FilterWheelPosition="6" bts:FilterPosition="1" bts:ShadingCorrectionSource="SC_BP445-45_40x_M10_CH01.tif" />
-</bts:MeasurementDetail>
diff --git a/tests/data/png/generate_fake_images.py b/tests/data/png/generate_fake_images.py
deleted file mode 100644
index 4319735e9..000000000
--- a/tests/data/png/generate_fake_images.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import numpy as np
-from PIL import Image
-
-im1 = np.arange(2560 * 2160, dtype=np.uint16).reshape(2160, 2560) // 100
-im2 = np.arange(2560 * 2160, dtype=np.uint16).reshape(2560, 2160).T // 100
-Image.fromarray(im1).save(
-    "myplate_B03_T0002F001L01A01Z01C01.png", optimize=True
-)
-Image.fromarray(im2).save(
-    "myplate_B03_T0002F001L01A01Z02C01.png", optimize=True
-)
-Image.fromarray(im2).save(
-    "myplate_B03_T0002F002L01A01Z01C01.png", optimize=True
-)
-Image.fromarray(im1).save(
-    "myplate_B03_T0002F002L01A01Z02C01.png", optimize=True
-)
diff --git a/tests/data/png/myplate_B03_T0002F001L01A01Z01C01.png b/tests/data/png/myplate_B03_T0002F001L01A01Z01C01.png
deleted file mode 100644
index 3cb4c1e15..000000000
Binary files a/tests/data/png/myplate_B03_T0002F001L01A01Z01C01.png and /dev/null differ
diff --git a/tests/data/png/myplate_B03_T0002F001L01A01Z02C01.png b/tests/data/png/myplate_B03_T0002F001L01A01Z02C01.png
deleted file mode 100644
index 104a31514..000000000
Binary files a/tests/data/png/myplate_B03_T0002F001L01A01Z02C01.png and /dev/null differ
diff --git a/tests/data/png/myplate_B03_T0002F002L01A01Z01C01.png b/tests/data/png/myplate_B03_T0002F002L01A01Z01C01.png
deleted file mode 100644
index 104a31514..000000000
Binary files a/tests/data/png/myplate_B03_T0002F002L01A01Z01C01.png and /dev/null differ
diff --git a/tests/data/png/myplate_B03_T0002F002L01A01Z02C01.png b/tests/data/png/myplate_B03_T0002F002L01A01Z02C01.png
deleted file mode 100644
index 3cb4c1e15..000000000
Binary files a/tests/data/png/myplate_B03_T0002F002L01A01Z02C01.png and /dev/null differ