Skip to content

Commit

Permalink
fix issue in labeller
Browse files Browse the repository at this point in the history
  • Loading branch information
OriolAbril committed Feb 9, 2023
1 parent 4fc5000 commit c1dc14c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions arviz/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def make_label_vert(self, var_name: Union[str, None], sel: dict, isel: dict):
var_name_str = self.var_name_to_str(var_name)
sel_str = self.sel_to_str(sel, isel)
if not sel_str:
return var_name_str
return "" if var_name_str is None else var_name_str
if var_name_str is None:
return sel_str
return f"{var_name_str}\n{sel_str}"
Expand All @@ -121,7 +121,7 @@ def make_label_flat(self, var_name: str, sel: dict, isel: dict):
var_name_str = self.var_name_to_str(var_name)
sel_str = self.sel_to_str(sel, isel)
if not sel_str:
return var_name_str
return "" if var_name_str is None else var_name_str
if var_name_str is None:
return sel_str
return f"{var_name_str}[{sel_str}]"
Expand All @@ -136,7 +136,9 @@ def make_model_label(self, model_name, label):
model_name_str = self.model_name_to_str(model_name)
if model_name_str is None:
return label
return f"{model_name}: {label}"
if label is None or label == "":
return model_name_str
return f"{model_name_str}: {label}"


class DimCoordLabeller(BaseLabeller):
Expand Down

0 comments on commit c1dc14c

Please sign in to comment.