Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Jul 22, 2018
1 parent e7a73bc commit 8115bda
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/mlstatpy/graph/graph_distance.py
Expand Up @@ -232,7 +232,7 @@ def load_from_file(filename, add_loop):
def _private__init__(self, add_loop, weight_vertex, weight_edge):
if add_loop:
for k in self.vertices:
if k != self.labelBegin and k != self.labelEnd:
if k not in (self.labelBegin, self.labelEnd):
self.edges[k, k] = Edge(k, k, "", weight_edge)
self.connect_root_and_leave(weight_vertex, weight_edge)
self.compute_predecessor()
Expand Down
2 changes: 1 addition & 1 deletion src/mlstatpy/image/detection_segment/detection_segment.py
Expand Up @@ -285,7 +285,7 @@ def detect_segments(image, proba_bin=1.0 / 16,

# on ajoute les resultats à la liste
segment.extend(res)
if stop > 0 and len(segment) >= stop:
if len(segment) >= stop > 0:
break
else:
not_aligned += 1
Expand Down
4 changes: 2 additions & 2 deletions src/mlstatpy/ml/ml_grid_benchmark.py
Expand Up @@ -192,15 +192,15 @@ def graphs(self, path_to_images):
@return list of tuple (image_name, function to create the graph)
"""
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.cm as mcm
df = self.to_df()

def local_graph(vx, vy, ax=None, text=True, figsize=(5, 5)):
btrys = set(df["_btry"])
ymin = df[vy].min()
ymax = df[vy].max()
decy = (ymax - ymin) / 50
colors = cm.rainbow(numpy.linspace(0, 1, len(btrys)))
colors = mcm.rainbow(numpy.linspace(0, 1, len(btrys)))
if len(btrys) == 0:
raise ValueError("The benchmark is empty.")
if ax is None:
Expand Down

0 comments on commit 8115bda

Please sign in to comment.