From c8a8253c9c1d6ed4cce97b3aafcb49f0a1811cc6 Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Tue, 18 Jan 2022 08:44:18 +0100
Subject: [PATCH] Add `accept.py` for test Filter

This `accept.py` also serves as an example for a module accept
accompanying the script `filter.py`.
---
 Inst_eddies/Analysis/tests.json   | 3 ++-
 Inst_eddies/Tests/Input/accept.py | 8 ++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100644 Inst_eddies/Tests/Input/accept.py

diff --git a/Inst_eddies/Analysis/tests.json b/Inst_eddies/Analysis/tests.json
index 50d5f80e..e751b6f8 100644
--- a/Inst_eddies/Analysis/tests.json
+++ b/Inst_eddies/Analysis/tests.json
@@ -121,6 +121,7 @@
 	    "$src_dir/Inst_eddies/Analysis/filter.py",
 	    "$PWD/Inst_eddies_4_anti",
 	    "plouf"
-	]
+	],
+	"env": {"PYTHONPATH": "$src_dir/Inst_eddies/Tests/Input"}
     }
 ]    
diff --git a/Inst_eddies/Tests/Input/accept.py b/Inst_eddies/Tests/Input/accept.py
new file mode 100644
index 00000000..d40ede31
--- /dev/null
+++ b/Inst_eddies/Tests/Input/accept.py
@@ -0,0 +1,8 @@
+def accept(shape_rec_extr, shape_rec_outer, shape_rec_max):
+    """Filtering function."""
+
+    ##return 0.125 <= shape_rec_extr.shape.points[0][0] <= 29.875 \
+    ##    and -59.875 <= shape_rec_extr.shape.points[0][1] <= -15.125
+    ##return shape_rec_extr.record.date == 20456
+    return shape_rec_extr.record.date == 20456 \
+        and shape_rec_extr.record.eddy_index == 87
-- 
GitLab