From dabf36f9a05b70fd4831ef3ca1edc9ea44ff281e Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Fri, 29 Apr 2022 22:19:20 +0200
Subject: [PATCH] Rename `num_of_days_to_avg` to `n_days_avg`

Rename variable `num_of_days_to_avg` to `n_days_avg`.
---
 cost_function.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/cost_function.py b/cost_function.py
index 4fc4ff2a..9fe443a6 100755
--- a/cost_function.py
+++ b/cost_function.py
@@ -125,7 +125,7 @@ handlers = [util_eddies.open_shpc(shpc_dir) for shpc_dir in args.SHPC_dir]
 array_d_init = [handler["d_init"] for handler in handlers]
 # (create the list once and for all)
 
-num_of_days_to_avg = 7 # number of days to average
+n_days_avg = 7 # number of days to average
 print("Iterating on vertices...")
 
 for n in g.vertices():
@@ -153,19 +153,19 @@ for n in g.vertices():
         g.vp.pos_last[n] = handlers[i_SHPC]["readers"]["extremum"]\
             .shape(ishape).points[0] # [in degrees]
 
-        if (num_of_days > num_of_days_to_avg):
+        if (num_of_days > n_days_avg):
             # The segment is longer than the number of days over which
             # to average
 
             # First 7 days calculation
             g.vp.first_av_rad[n], g.vp.first_av_ros[n] \
-                = calculate_radii_rossby(segment[:num_of_days_to_avg],
-                                         e_overestim, handlers, array_d_init)
+                = calculate_radii_rossby(segment[:n_days_avg], e_overestim,
+                                         handlers, array_d_init)
 
             # Last 7 days calculation:
             g.vp.last_av_rad[n], g.vp.last_av_ros[n] \
-                = calculate_radii_rossby(segment[- num_of_days_to_avg:],
-                                         e_overestim, handlers, array_d_init)
+                = calculate_radii_rossby(segment[- n_days_avg:], e_overestim,
+                                         handlers, array_d_init)
         else:
             # The number of eddies in a segment is lower than the number
             # of days over which to average. The values will be the same
-- 
GitLab