From e20a41429dfe02a89c84764ab4ca3e25fe42e6f4 Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Fri, 26 Apr 2024 23:03:53 +0200
Subject: [PATCH] Update format of test descriptions

For `Test_compare` version > 0.4.
---
 Common/Tests/tests.json                       |  3 +-
 Convert_Matlab/Tests/tests_with_Matlab.json   |  3 +-
 Inst_eddies/Tests/long_tests.json             | 18 +++++-----
 Inst_eddies/Tests/short_tests.json            | 28 +++++++--------
 Inst_eddies/Tests/test_output.json            | 34 +++++--------------
 Overlap/Analysis/tests.json                   |  2 +-
 .../Documentation_texfol/documentation.tex    | 18 +++++-----
 Trajectories/Tests/perf_tests.json            |  6 ++--
 Trajectories/Tests/tests.json                 | 12 +++----
 9 files changed, 53 insertions(+), 71 deletions(-)

diff --git a/Common/Tests/tests.json b/Common/Tests/tests.json
index a9bedab0..b7c0deeb 100644
--- a/Common/Tests/tests.json
+++ b/Common/Tests/tests.json
@@ -17,7 +17,8 @@
 		"Anticyclones"
             ]
 	],
-	"input": "20455, 1\n", "exclude_cmp": ["timings.txt", "perf_report.csv"]
+	"input": "20455, 1\n",
+	"sel_diff_args": {"exclude": ["timings.txt", "perf_report.csv"]}
     },
     "Create_ishape_last_missing": {
 	"description": "Create ishape_last with a missing date.",
diff --git a/Convert_Matlab/Tests/tests_with_Matlab.json b/Convert_Matlab/Tests/tests_with_Matlab.json
index 85ffebc7..819efb85 100644
--- a/Convert_Matlab/Tests/tests_with_Matlab.json
+++ b/Convert_Matlab/Tests/tests_with_Matlab.json
@@ -11,7 +11,8 @@
 	"symlink": [
             "$src_dir/Convert_Matlab/inst_eddies.m"
 	],
-	"stdout": "inst_eddies_v6_stdout.txt", "exclude_cmp": ["n_slices.txt"]
+	"stdout": "inst_eddies_v6_stdout.txt",
+	"sel_diff_args": {"exclude": ["n_slices.txt"]}
     },
     "Inst_eddies_v6_global": {
 	"description": "On a global file to test the processing of ghost eddies.",
diff --git a/Inst_eddies/Tests/long_tests.json b/Inst_eddies/Tests/long_tests.json
index 843e6429..c18064cb 100644
--- a/Inst_eddies/Tests/long_tests.json
+++ b/Inst_eddies/Tests/long_tests.json
@@ -18,7 +18,7 @@
             "&config_nml min_radius = 20./\n"
 	],
 	"input": "&dates_nml date = 1/\n",
-	"exclude_cmp": ["timings.txt"]
+	"sel_diff_args": {"exclude": ["timings.txt"]}
     },
     "Extraction_eddies_region_3": {
 	"commands": [
@@ -40,7 +40,7 @@
 	],
 	"input": "&dates_nml date = 20454/\n",
 	"description": "Larger region, 120 x 120. Includes degenerate extrema.",
-	"exclude_cmp": ["timings.txt"]
+	"sel_diff_args": {"exclude": ["timings.txt"]}
     },
     "Extraction_eddies_region_3_min": {
 	"commands": [
@@ -62,7 +62,7 @@
 	],
 	"input": "&dates_nml date = 20454/\n",
 	"description": "Same as Extraction_eddies_region_3 except with 1 mm minimum amplitude.",
-	"exclude_cmp": ["timings.txt"]
+	"sel_diff_args": {"exclude": ["timings.txt"]}
     },
     "Extraction_eddies_region_5": {
 	"commands": [
@@ -84,7 +84,7 @@
 	],
 	"input": "&dates_nml date = 20454/\n",
 	"description": "Same as Extraction_eddies_region_4 with larger domain.",
-	"exclude_cmp": ["n_slices.txt", "timings.txt"]
+	"sel_diff_args": {"exclude": ["n_slices.txt", "timings.txt"]}
     },
     "Extraction_eddies_region_2_noise": {
 	"create_file": [
@@ -101,7 +101,7 @@
             "$Aviso_DT_dir/dt_global_allsat_phy_l4_%Y%m%d_20210726.nc",
             "2006-01-01", "2006-01-15", "0"
 	],
-	"exclude_cmp": ["timings.txt", "perf_report.csv"]
+	"sel_diff_args": {"exclude": ["timings.txt", "perf_report.csv"]}
     },
     "Region_6": {
 	"create_file": [
@@ -119,7 +119,7 @@
             "-26.875"
 	],
 	"input": "20454\n0\n",
-	"exclude_cmp": ["timings.txt", "perf_report.csv"]
+	"sel_diff_args": {"exclude": ["timings.txt", "perf_report.csv"]}
     },
     "Missing_file": {
 	"create_file": [
@@ -132,7 +132,7 @@
 	    "2020-01-31", "2020-02-02", "0"
 	],
 	"description": "Date 2020-02-01 is missing. Test of the script with a missing date.",
-	"exclude_cmp": ["timings.txt", "perf_report.csv"]
+	"sel_diff_args": {"exclude": ["timings.txt", "perf_report.csv"]}
     },
     "Greece": {
 	"description": "This is a case where the speed is not defined on a whole segment.",
@@ -146,7 +146,7 @@
             "config_nml.txt",
             "&config_nml /\n"
 	],
-	"exclude_cmp": ["timings.txt", "perf_report.csv"]
+	"sel_diff_args": {"exclude": ["timings.txt", "perf_report.csv"]}
     },
     "Region_5_15_days": {
 	"description": "This is used in several tests in Overlap.",
@@ -160,6 +160,6 @@
             "config_nml.txt",
             "&config_nml /\n"
 	],
-	"exclude_cmp": ["timings.txt", "perf_report.csv"]
+	"sel_diff_args": {"exclude": ["timings.txt", "perf_report.csv"]}
     }
 }
diff --git a/Inst_eddies/Tests/short_tests.json b/Inst_eddies/Tests/short_tests.json
index 996d00d2..84946cae 100644
--- a/Inst_eddies/Tests/short_tests.json
+++ b/Inst_eddies/Tests/short_tests.json
@@ -18,7 +18,7 @@
 		"$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc"
             ]
 	],
-	"exclude_cmp": ["timings.txt", "n_slices.txt"]
+	"sel_diff_args": {"exclude": ["timings.txt", "n_slices.txt"]}
     },
     "Region_1_20454_cyclone_3":
     {
@@ -53,7 +53,7 @@
 		"$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc"
             ]
 	],
-	"exclude_cmp": ["n_slices.txt"]
+	"sel_diff_args": {"exclude": ["n_slices.txt"]}
     },
     "Get_1_outerm_noise_2_8": {
 	"description": "Assume insufficient amplitude for extrema 2 and 8. Even if extremum 8 does not have a particularly small amplitude, we just want to see the target extremum, 6, grow its outermost contour compared to the case without minimum amplitude.",
@@ -73,7 +73,7 @@
 		"$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc"
             ]
 	],
-	"exclude_cmp": ["n_slices.txt"]
+	"sel_diff_args": {"exclude": ["n_slices.txt"]}
     },
     "Good_contour": {
 	"description": "3 contours at that level. 2 contain the inside point, one of which contains the 2 outside points.",
@@ -197,7 +197,7 @@
             ]
 	],
 	"input": "t\n",
-	"exclude_cmp": ["n_slices.txt"]
+	"sel_diff_args": {"exclude": ["n_slices.txt"]}
     },
     "Set_max_speed_noise": {
 	"symlink": ["$tests_old_dir/Get_1_outerm_noise_2_8/config_nml.txt"],
@@ -212,7 +212,7 @@
             ]
 	],
 	"input": "t\n",
-	"exclude_cmp": ["n_slices.txt"]
+	"sel_diff_args": {"exclude": ["n_slices.txt"]}
     },
     "SHPC_degenerate":
     {
@@ -248,7 +248,7 @@
             ]
 	],
 	"input": "f\n",
-	"exclude_cmp": ["n_slices.txt"]
+	"sel_diff_args": {"exclude": ["n_slices.txt"]}
     },
     "Extraction_eddies_region_2": {
 	"create_file": [
@@ -269,7 +269,7 @@
 		"$src_dir/Inst_eddies/Tests/Input/huv_region_2.nc"
             ]
 	],
-	"exclude_cmp": ["timings.txt", "n_slices.txt"]
+	"sel_diff_args": {"exclude": ["timings.txt", "n_slices.txt"]}
     },
     "Extraction_eddies_region_4": {
 	"description": "Part of the domain has missing values.",
@@ -288,7 +288,7 @@
             "$Aviso_DT_dir/dt_global_allsat_phy_l4_20060102_20210726.nc"
 	],
 	"input": "20454\n0\n",
-	"exclude_cmp": ["timings.txt", "perf_report.csv"]
+	"sel_diff_args": {"exclude": ["timings.txt", "perf_report.csv"]}
     },
     "Inst_eddies_py": {
 	"description": "Like Extraction_eddies_region_4, but for a single date. This is a test of options of the wrapper script rather than a test of the Fortran executable.",
@@ -306,7 +306,7 @@
             "$Aviso_DT_dir/dt_global_allsat_phy_l4_20060101_20210726.nc"
 	],
 	"input": "20454\n0\n",
-	"exclude_cmp": ["timings.txt", "perf_report.csv"]
+	"sel_diff_args": {"exclude": ["timings.txt", "perf_report.csv"]}
     },
     "Inst_eddies_loop": {
 	"create_file": [
@@ -319,7 +319,7 @@
 	    "2006-01-01", "2006-01-04", "0"
 	],
 	"input": "20454\n",
-	"exclude_cmp": ["timings.txt", "perf_report.csv"]
+	"sel_diff_args": {"exclude": ["timings.txt", "perf_report.csv"]}
     },
     "Nearby_extr": {
 	"command": [
@@ -349,7 +349,7 @@
 		"$src_dir/Inst_eddies/Tests/Input/uv_2006_01_01_coarse.nc"
             ]
 	],
-	"exclude_cmp": ["timings.txt", "n_slices.txt"]
+	"sel_diff_args": {"exclude": ["timings.txt", "n_slices.txt"]}
     },
     "Extraction_eddies_periodic": {
 	"description": "Periodic domain.",
@@ -371,7 +371,7 @@
 		"$src_dir/Inst_eddies/Tests/Input/uv_2006_01_01_coarse.nc"
             ]
 	],
-	"exclude_cmp": ["timings.txt", "n_slices.txt"]
+	"sel_diff_args": {"exclude": ["timings.txt", "n_slices.txt"]}
     },
     "Extr_proj": {
 	"description": "Create shapefile extr_proj.",
@@ -393,7 +393,7 @@
 		"$src_dir/Inst_eddies/Tests/Input/Region_1/huv_region_1_2006_01_01.nc"
             ]
 	],
-	"exclude_cmp": ["n_slices.txt"]
+	"sel_diff_args": {"exclude": ["n_slices.txt"]}
     },
     "Region_4_15_days": {
 	"description": "This is used in several tests in Overlap.",
@@ -404,7 +404,7 @@
             "--bbox", "16.125", "20.875", "-38.875", "-34.125"
 	],
 	"create_file": ["config_nml.txt", "&config_nml /\n"],
-	"exclude_cmp": ["timings.txt", "perf_report.csv"]
+	"sel_diff_args": {"exclude": ["timings.txt", "perf_report.csv"]}
     },
     "Complete_SSH":
     {"command": "$build_dir/Inst_eddies/Tests/test_complete_ssh"},
diff --git a/Inst_eddies/Tests/test_output.json b/Inst_eddies/Tests/test_output.json
index dccb15d2..fc3ba610 100644
--- a/Inst_eddies/Tests/test_output.json
+++ b/Inst_eddies/Tests/test_output.json
@@ -31,9 +31,7 @@
             ]
 	],
 	"stdout": "test_write_null_stdout.txt",
-	"exclude_cmp": [
-            "test_write_null_stderr.txt"
-	]
+	"sel_diff_args": {"exclude": ["test_write_null_stderr.txt"]}
     },
     "Small_mix": {
 	"description": "Append to small SHPC, mixing output to the three shapefiles.",
@@ -49,9 +47,7 @@
             ]
 	],
 	"stdout": "test_write_null_stdout.txt",
-	"exclude_cmp": [
-            "test_write_null_stderr.txt"
-	]
+	"sel_diff_args": {"exclude": ["test_write_null_stderr.txt"]}
     },
     "Medium_sep": {
 	"description": "Append to medium-sized SHPC, separating output to the three shapefiles.",
@@ -67,9 +63,7 @@
             ]
 	],
 	"stdout": "test_write_null_stdout.txt",
-	"exclude_cmp": [
-            "test_write_null_stderr.txt"
-	]
+	"sel_diff_args": {"exclude": ["test_write_null_stderr.txt"]}
     },
     "Small_sep": {
 	"description": "Append to small SHPC, separating output to the three shapefiles.",
@@ -85,9 +79,7 @@
             ]
 	],
 	"stdout": "test_write_null_stdout.txt",
-	"exclude_cmp": [
-            "test_write_null_stderr.txt"
-	]
+	"sel_diff_args": {"exclude": ["test_write_null_stderr.txt"]}
     },
     "Create_mix": {
 	"description": "Create SHPC, mixing output to the three shapefiles.",
@@ -104,9 +96,7 @@
             ]
 	],
 	"stdout": "test_write_null_stdout.txt",
-	"exclude_cmp": [
-            "test_write_null_stderr.txt"
-	]
+	"sel_diff_args": {"exclude": ["test_write_null_stderr.txt"]}
     },
     "Create_sep": {
 	"description": "Create SHPC, separating output to the three shapefiles.",
@@ -123,9 +113,7 @@
             ]
 	],
 	"stdout": "test_write_null_stdout.txt",
-	"exclude_cmp": [
-            "test_write_null_stderr.txt"
-	]
+	"sel_diff_args": {"exclude": ["test_write_null_stderr.txt"]}
     },
     "Big_mix": {
 	"description": "Append to big SHPC, mixing output to the three shapefiles.",
@@ -141,10 +129,7 @@
             ]
 	],
 	"stdout": "test_write_null_stdout.txt",
-	"exclude_cmp": [
-            "test_write_null_stderr.txt",
-            "*.shp"
-	]
+	"sel_diff_args": {"exclude": ["test_write_null_stderr.txt", "*.shp"]}
     },
     "Big_sep": {
 	"description": "Append to big SHPC, separating output to the three shapefiles.",
@@ -160,9 +145,6 @@
             ]
 	],
 	"stdout": "test_write_null_stdout.txt",
-	"exclude_cmp": [
-            "test_write_null_stderr.txt",
-            "*.shp"
-	]
+	"sel_diff_args": {"exclude": ["test_write_null_stderr.txt", "*.shp"]}
     }
 }
diff --git a/Overlap/Analysis/tests.json b/Overlap/Analysis/tests.json
index 2cf86f6b..db6f00e8 100644
--- a/Overlap/Analysis/tests.json
+++ b/Overlap/Analysis/tests.json
@@ -88,6 +88,6 @@
 	["$src_dir/Overlap/Analysis/extract_component_nx.py",
 	 "$tests_old_dir/EGr2nd15md4np3/edgelist.csv", "204618",
 	 "component.csv"],
-	"exclude_cmp": ["e_overestim.txt"]
+	"sel_diff_args": {"exclude": ["e_overestim.txt"]}
     }
 }
diff --git a/Overlap/Documentation_texfol/documentation.tex b/Overlap/Documentation_texfol/documentation.tex
index a6d7fd32..3f565c98 100644
--- a/Overlap/Documentation_texfol/documentation.tex
+++ b/Overlap/Documentation_texfol/documentation.tex
@@ -62,7 +62,9 @@ régulièrement espacées. Ces dates sont identifiées par un indice (un
 nombre entier) prenant les valeurs successives entre $k_1$ et
 $k_1 + \mathtt{n\_dates} - 1$. $k_1$ est le premier indice de date de
 la première tranche de SHPC. $\mathtt{n\_dates}$ est le nombre total
-de dates dans toutes les tranches de SHPC.
+de dates dans les \verb+ishape_last+ de toutes les tranches de SHPC
+(une date peut ne contenir aucun tourbillon : aucune forme dans le
+SHPC, mais une ligne dans \verb+ishape_last+).
 
 Chaque tourbillon à chaque date reçoit un identifiant. Les
 recouvrements de tourbillons à différentes dates peuvent être
@@ -77,10 +79,10 @@ Le code est écrit en Fortran, parallélisé avec MPI.
 La zone intérieure à la ligne de vitesse maximale est le c\oe{}ur du
 tourbillon. On cherche les recouvrements entre ces c\oe{}urs, l'idée
 étant que les extremums à deux dates correspondent au même tourbillon
-si les c\oe{}urs se recouvrent.
-
-Les arcs relient les tourbillons dont les c\oe{}urs se recouvrent à
-deux dates successives.
+si les c\oe{}urs se recouvrent. Association (création d'un arc) entre
+tourbillons instantanées à deux dates si et seulement si :
+recouvrement des contours de vitesse max $\ge$ \verb+min_inters_speed+
+ou recouvrement des contours extérieurs $\ge$ \verb+min_inters_out+.
 
 Le graphe est orienté acyclique. L'ordre topologique est tout trouvé :
 numérotation par dates successives. Le graphe non orienté associé
@@ -273,9 +275,9 @@ fichier. Cf. figure (\ref{fig:input_output}).
   \label{fig:input_output}
 \end{figure}
 
-Le programme lit une liste de tranches de SHPC. Nous supposons que la
-première date présente dans une tranche est strictement supérieure à
-la dernière date de la tranche précédente.
+Le programme lit une liste de tranches de SHPC. Le premier indice de
+date d'une tranche doit être égal à 1 plus le dernier indice de date
+de la tranche précédente.
 
 On n'enregistre pas le fichier \verb+e_overestim.txt+ dans le SHPC
 parce qu'il dépend des choix \verb+n_dates+ et \verb+i_slice+ faits à
diff --git a/Trajectories/Tests/perf_tests.json b/Trajectories/Tests/perf_tests.json
index b91137ca..04138ad5 100644
--- a/Trajectories/Tests/perf_tests.json
+++ b/Trajectories/Tests/perf_tests.json
@@ -6,7 +6,7 @@
             "$PWD/edgelist_head.csv",
             "segments.gt"
 	],
-	"exclude_cmp": ["timings_segments.txt"]
+	"sel_diff_args": {"exclude": ["timings_segments.txt"]}
     },
     "Perf_cost_function": {
 	"description": "Performance test with adjustable size of input.",
@@ -17,7 +17,7 @@
             "$PWD/Perf_segments/segments.gt",
             "segments_cost_functions.gt"
 	],
-	"exclude_cmp": ["timings.txt"]
+	"sel_diff_args": {"exclude": ["timings.txt"]}
     },
     "Perf_trajectories": {
 	"description": "Performance test with adjustable size of input.",
@@ -25,6 +25,6 @@
             "$src_dir/Trajectories/trajectories.py",
             "$PWD/Perf_cost_function/segments_cost_functions.gt"
 	],
- 	"exclude_cmp": ["timings.txt"]
+ 	"sel_diff_args": {"exclude": ["timings.txt"]}
    }
 }
diff --git a/Trajectories/Tests/tests.json b/Trajectories/Tests/tests.json
index 3bcd1888..78053e59 100644
--- a/Trajectories/Tests/tests.json
+++ b/Trajectories/Tests/tests.json
@@ -35,7 +35,7 @@
             "$tests_old_dir/EGr2nd15md4/edgelist.csv",
             "segments.graphml"
 	],
-	"exclude_cmp": ["timings_segments.txt"],
+	"sel_diff_args": {"exclude": ["timings_segments.txt"]},
 	"description": "This is a case with only isolated segments."
     },
     "Cost_functions": {
@@ -46,9 +46,7 @@
             "$tests_old_dir/Segments/segments.graphml",
             "segments_cost_functions.graphml", "--debug"
 	],
-	"exclude_cmp": [
-            "timings.txt"
-	],
+	"sel_diff_args": {"exclude": ["timings.txt"]},
 	"description": "This is a case with only isolated segments."
     },
     "Greece_segments": {
@@ -68,9 +66,7 @@
             "$tests_old_dir/Greece_segments/segments.graphml",
             "segments_cost_functions.graphml", "--debug"
 	],
-	"exclude_cmp": [
-            "timings.txt"
-	]
+	"sel_diff_args": {"exclude": ["timings.txt"]}
     },
     "Cost_function_no_debug":
     {
@@ -82,7 +78,7 @@
             "$tests_old_dir/Greece_segments/segments.graphml",
             "segments_cost_functions.graphml"
 	],
-	"exclude_cmp": ["timings.txt"]
+	"sel_diff_args": {"exclude": ["timings.txt"]}
     },
     "Trajectories": {
 	"command": [
-- 
GitLab