From 02020ce7e8c407f7b503871a6f7077ac12eb26c0 Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Mon, 13 Feb 2023 18:01:44 +0100
Subject: [PATCH] Allow missing `ishape_last.txt` in `comp_ishape`

Allow missing `ishape_last.txt` in method `comp_ishape`. This is
useful is an SHPC is missing an orientation.
---
 Common/util_eddies.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Common/util_eddies.py b/Common/util_eddies.py
index 55649244..69f37191 100644
--- a/Common/util_eddies.py
+++ b/Common/util_eddies.py
@@ -177,8 +177,11 @@ class SHPC_class:
             ishape = eddy_index - 1
         else:
             # date > self.d_init[i_slice]
-            ishape = self.get_ishape_last(i_slice, orientation)\
-                [date - self.d_init[i_slice] - 1] + eddy_index
+            try:
+                ishape = self.get_ishape_last(i_slice, orientation)\
+                    [date - self.d_init[i_slice] - 1] + eddy_index
+            except TypeError:
+                ishape = None
 
         return ishape
 
-- 
GitLab