Commit cb41520a authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

pamhyr: Fix Pep8.

No related merge requests found
Pipeline #55370 passed with stages
in 6 minutes and 51 seconds
Showing with 16 additions and 12 deletions
+16 -12
...@@ -82,14 +82,12 @@ class PlotAC(PamhyrPlot): ...@@ -82,14 +82,12 @@ class PlotAC(PamhyrPlot):
label=self.label_previous_plot_selected, label=self.label_previous_plot_selected,
lw=1.5, linestyle='--', color=self.color_plot_previous lw=1.5, linestyle='--', color=self.color_plot_previous
) )
#self.previous_plot_selected.set_visible(False)
self.plot_selected, = self.canvas.axes.plot( self.plot_selected, = self.canvas.axes.plot(
station, elevation, station, elevation,
label=self.label_plot_selected, label=self.label_plot_selected,
color=self.color_plot_current, lw=1.5 color=self.color_plot_current, lw=1.5
) )
#self.plot_selected.set_visible(False)
next_id = profile_id + 1 next_id = profile_id + 1
station_next = self.data.profile(next_id).get_station() station_next = self.data.profile(next_id).get_station()
...@@ -100,7 +98,6 @@ class PlotAC(PamhyrPlot): ...@@ -100,7 +98,6 @@ class PlotAC(PamhyrPlot):
label=self.label_next_plot_selected, label=self.label_next_plot_selected,
color=self.color_plot_next, lw=1.6, linestyle='--' color=self.color_plot_next, lw=1.6, linestyle='--'
) )
#self.next_plot_selected.set_visible(False)
self.canvas.axes.set_visible(False) self.canvas.axes.set_visible(False)
def draw_gl(self): def draw_gl(self):
...@@ -110,13 +107,16 @@ class PlotAC(PamhyrPlot): ...@@ -110,13 +107,16 @@ class PlotAC(PamhyrPlot):
profile_id = 0 profile_id = 0
profile = self.data.profile(profile_id) profile = self.data.profile(profile_id)
if profile == None: return if profile is None:
return
station = profile.get_station() station = profile.get_station()
elevation = profile.z() elevation = profile.z()
gl = profile.names() gl = profile.names()
self.annotation = [] self.annotation = []
self.complete_gl, self.incomplete_gl = self.data.compute_guidelines() self.complete_gl, self.incomplete_gl = self.data.compute_guidelines()
lcomplete = list(self.complete_gl) lcomplete = list(self.complete_gl)
lincomplete = list(self.incomplete_gl) lincomplete = list(self.incomplete_gl)
...@@ -193,7 +193,6 @@ class PlotAC(PamhyrPlot): ...@@ -193,7 +193,6 @@ class PlotAC(PamhyrPlot):
self.data.profile(previous_id).z() self.data.profile(previous_id).z()
) )
self.previous_plot_selected.set_visible(True) self.previous_plot_selected.set_visible(True)
#self.canvas.axes.legend()
if 0 <= profile_id < self.data.number_profiles: if 0 <= profile_id < self.data.number_profiles:
self.plot_selected.set_data( self.plot_selected.set_data(
...@@ -201,7 +200,6 @@ class PlotAC(PamhyrPlot): ...@@ -201,7 +200,6 @@ class PlotAC(PamhyrPlot):
self.data.profile(profile_id).z() self.data.profile(profile_id).z()
) )
self.plot_selected.set_visible(True) self.plot_selected.set_visible(True)
#self.canvas.axes.legend()
if 0 <= next_id < self.data.number_profiles: if 0 <= next_id < self.data.number_profiles:
self.next_plot_selected.set_data( self.next_plot_selected.set_data(
...@@ -209,7 +207,7 @@ class PlotAC(PamhyrPlot): ...@@ -209,7 +207,7 @@ class PlotAC(PamhyrPlot):
self.data.profile(next_id).z() self.data.profile(next_id).z()
) )
self.next_plot_selected.set_visible(True) self.next_plot_selected.set_visible(True)
#self.canvas.axes.legend()
self.canvas.axes.set_visible(True) self.canvas.axes.set_visible(True)
def update_full(self): def update_full(self):
......
...@@ -157,7 +157,9 @@ class GeometryWindow(PamhyrWindow): ...@@ -157,7 +157,9 @@ class GeometryWindow(PamhyrWindow):
def _compute_status_label(self): def _compute_status_label(self):
row = self.index_selected_row() row = self.index_selected_row()
if row == None: return if row is None:
return
profile = self._reach.profile(row) profile = self._reach.profile(row)
name = profile.name + " " + str(profile.kp) name = profile.name + " " + str(profile.kp)
...@@ -404,7 +406,6 @@ class GeometryWindow(PamhyrWindow): ...@@ -404,7 +406,6 @@ class GeometryWindow(PamhyrWindow):
def update_plot_ac(self, ind: int): def update_plot_ac(self, ind: int):
self.tableView.model().blockSignals(True) self.tableView.model().blockSignals(True)
#self._plot_ac.current = ind
self._plot_ac.update() self._plot_ac.update()
self.tableView.model().blockSignals(False) self.tableView.model().blockSignals(False)
...@@ -449,7 +450,8 @@ class GeometryWindow(PamhyrWindow): ...@@ -449,7 +450,8 @@ class GeometryWindow(PamhyrWindow):
def select_current_profile(self): def select_current_profile(self):
self.tableView.model().blockSignals(True) self.tableView.model().blockSignals(True)
row = self.index_selected_row() row = self.index_selected_row()
if row != None:
if row is not None:
self.find(QSlider, "verticalSlider").setValue(row) self.find(QSlider, "verticalSlider").setValue(row)
self.select_plot_xy(row) self.select_plot_xy(row)
self.select_plot_kpc(row) self.select_plot_kpc(row)
...@@ -530,13 +532,17 @@ class GeometryWindow(PamhyrWindow): ...@@ -530,13 +532,17 @@ class GeometryWindow(PamhyrWindow):
def move_up(self): def move_up(self):
row = self.index_selected_row() row = self.index_selected_row()
if row == None: return if row is None:
return
self._table.move_up(row) self._table.move_up(row)
self.select_current_profile() self.select_current_profile()
def move_down(self): def move_down(self):
row = self.index_selected_row() row = self.index_selected_row()
if row == None: return if row is None:
return
self._table.move_down(row) self._table.move_down(row)
self.select_current_profile() self.select_current_profile()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment