diff --git a/Tests/Data/Mechanics/Linear/PythonHertzContact/gen-unit-circle.py b/Tests/Data/Mechanics/Linear/PythonHertzContact/gen-unit-circle.py index df9a177feec5ef54f4e01a945bce106345a914d2..efe6cbb5344e5afe408a3a618ed6c53863f6eed9 100755 --- a/Tests/Data/Mechanics/Linear/PythonHertzContact/gen-unit-circle.py +++ b/Tests/Data/Mechanics/Linear/PythonHertzContact/gen-unit-circle.py @@ -1,6 +1,7 @@ #!/usr/bin/vtkpython import sys +from pathlib import Path import numpy as np import vtk @@ -49,7 +50,7 @@ coords = vtk_to_numpy(grid.GetPoints().GetData()) a = np.empty(coords.shape[0]) -for i, (x, y, z) in enumerate(coords): +for i, (x, y, _z) in enumerate(coords): if x > y: R = np.sqrt(1 + (y / x) ** 2) a[i] = 1.0 / R @@ -86,7 +87,7 @@ idcs = np.where(abs(R_squared - 1) < 1e-8)[0] idcs = idcs[np.argsort(phi[idcs])] # sorted with ascending polar angle -with open(out_geom, "w") as fh: +with Path(out_geom).open(mode="w") as fh: fh.write( """<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysGLI> diff --git a/Tests/Data/Mechanics/Linear/PythonHertzContact/hertz_contact_bc.py b/Tests/Data/Mechanics/Linear/PythonHertzContact/hertz_contact_bc.py index 36583ee1a82b7067fc693a65e5beb7297fa29a8f..517ca2ad441cb6f8e1d4da2da5aca2ddd98eb4d2 100644 --- a/Tests/Data/Mechanics/Linear/PythonHertzContact/hertz_contact_bc.py +++ b/Tests/Data/Mechanics/Linear/PythonHertzContact/hertz_contact_bc.py @@ -133,7 +133,7 @@ class HertzContactBC(OpenGeoSys.BoundaryCondition): if x <= self._a_prev: raise AssertionError() # this case shouldn't happen res = (True, y_top - y) - elif self._boundary_x_coords_are_initialized(t): + if self._boundary_x_coords_are_initialized(t): idx = self._boundary_x_coords.index(x) if idx != 0 and self._boundary_x_coords[idx - 1] == self._a_prev: res = (True, y_top - y) @@ -146,7 +146,7 @@ class HertzContactBC(OpenGeoSys.BoundaryCondition): return 1.0 - 0.005 * t - def _boundary_x_coords_are_initialized(self, t): + def _boundary_x_coords_are_initialized(self, _t): return self._iteration >= 2