From 1318f54d29d4e5063db74e5669f696a0c0099e08 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Tue, 28 Nov 2023 10:04:07 +0100
Subject: [PATCH] [py] ruff: manual fixes for glacier tutorial.

---
 .../tutorials/advancing-glacier/glacierclass.py    | 14 +++++++-------
 .../docs/tutorials/advancing-glacier/mesh_basin.py |  4 ++--
 .../tutorials/advancing-glacier/timeBCs_glacier.py |  2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/web/content/docs/tutorials/advancing-glacier/glacierclass.py b/web/content/docs/tutorials/advancing-glacier/glacierclass.py
index 82f9cde739c..ccd75f95929 100644
--- a/web/content/docs/tutorials/advancing-glacier/glacierclass.py
+++ b/web/content/docs/tutorials/advancing-glacier/glacierclass.py
@@ -24,14 +24,14 @@ class glacier:
 
     # analytical function for the glacier's shape
     def local_height(self, x, t):
-        l = self.length(t)
-        if l == 0:
+        length = self.length(t)
+        if length == 0:
             return 0 * x
-        else:
-            xi = (x - self.x_0) / l
-            xi = np.array(xi)
-            xi[xi > 1] = 1.0
-            return self.height(t) * np.sqrt(1 - xi**1)
+
+        xi = (x - self.x_0) / length
+        xi = np.array(xi)
+        xi[xi > 1] = 1.0
+        return self.height(t) * np.sqrt(1 - xi**1)
 
     def height(self, t):
         return self.H_max * (t - self.t_0) / self.t_1
diff --git a/web/content/docs/tutorials/advancing-glacier/mesh_basin.py b/web/content/docs/tutorials/advancing-glacier/mesh_basin.py
index f3f3f50868c..5f3b22da946 100644
--- a/web/content/docs/tutorials/advancing-glacier/mesh_basin.py
+++ b/web/content/docs/tutorials/advancing-glacier/mesh_basin.py
@@ -118,8 +118,8 @@ gmsh.model.geo.addCurveLoop([2, 3, 4, 10, 13, 14], 4)
 # loop defines the exterior contour; additional curve loop define holes.
 # (only one here, representing the external contour, since there are no holes
 # --see `t4.py' for an example of a surface with a hole):
-for l in range(1, 5):
-    gmsh.model.geo.addPlaneSurface([l], l)
+for L in range(1, 5):
+    gmsh.model.geo.addPlaneSurface([L], L)
 
 # At this level, Gmsh knows everything to display the surfaces and
 # to mesh it. An optional step is needed if we want to group elementary
diff --git a/web/content/docs/tutorials/advancing-glacier/timeBCs_glacier.py b/web/content/docs/tutorials/advancing-glacier/timeBCs_glacier.py
index 3860321dec9..a35006ce43a 100644
--- a/web/content/docs/tutorials/advancing-glacier/timeBCs_glacier.py
+++ b/web/content/docs/tutorials/advancing-glacier/timeBCs_glacier.py
@@ -22,7 +22,7 @@ class BC_Y(OpenGeoSys.BoundaryCondition):
         self.glacier.plotEvolution()
 
     def getFlux(
-        self, t, coords, primary_vars
+        self, t, coords, _primary_vars
     ):  # here Neumann BC: flux of linear momentum
         x, y, z = coords
 
-- 
GitLab