pep8: Fix code format for model.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-10-11 11:47:09 +02:00
1 parent 2c592b25b9
commit 9f2b81d385
17 files changed
+106 -68

No files matched your search

+10 -9
View File
@@ -136,7 +136,7 @@ class ProfileXYZ(Profile, SQLSubModel):
status=status
)
if sl == -1 or sl == None:
if sl == -1 or sl is None:
new._sl = None
else:
new._sl = next(
@@ -163,7 +163,8 @@ class ProfileXYZ(Profile, SQLSubModel):
sql = (
"INSERT OR REPLACE INTO " +
"geometry_profileXYZ(id, ind, name, reach, kp, num, code1, code2, sl) " +
"geometry_profileXYZ(id, ind, name, reach, " +
"kp, num, code1, code2, sl) " +
"VALUES (" +
f"{self.id}, {ind}, '{self._sql_format(self._name)}', " +
f"{self.reach.id}, {self.kp}, {self.num}, " +
@@ -378,28 +379,28 @@ class ProfileXYZ(Profile, SQLSubModel):
if (first_named_point != last_named_point and
first_named_point.x != last_named_point.x):
vector = Vector1d(first_named_point, last_named_point)
normalized_direction_vec = vector.normalized_direction_vector()
norm_dir_vec = vector.normalized_direction_vector()
else:
vector = Vector1d(first_point_not_nan, last_point_not_nan)
normalized_direction_vec = vector.normalized_direction_vector()
norm_dir_vec = vector.normalized_direction_vector()
for point in self.points:
xi = point.x - first_named_point.x
yi = point.y - first_named_point.y
station_i = (normalized_direction_vec[0] * xi +
normalized_direction_vec[1] * yi)
station_i = (norm_dir_vec[0] * xi +
norm_dir_vec[1] * yi)
station.append(station_i)
constant = station[index_first_named_point]
elif first_named_point is None:
vector = Vector1d(first_point_not_nan, last_point_not_nan)
normalized_direction_vec = vector.normalized_direction_vector()
norm_dir_vec = vector.normalized_direction_vector()
for point in self.points:
xi = point.x - first_point_not_nan.x
yi = point.y - first_point_not_nan.y
station_i = (normalized_direction_vec[0] * xi +
normalized_direction_vec[1] * yi)
station_i = (norm_dir_vec[0] * xi +
norm_dir_vec[1] * yi)
station.append(station_i)
z_min = self.z_min()