Skip to content

Commit

Permalink
tidy up to pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nickzoic committed Aug 31, 2023
1 parent 8d54aec commit 7fb11dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions countess/core/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,17 +430,20 @@ class PandasTransformXToTupleMixin:

def __init__(self, *a, **k):
super().__init__(*a, **k)
assert hasattr(self, "parameters")
assert isinstance(self.parameters["output"], ArrayParam)
assert all(isinstance(pp["name"], StringParam) for pp in self.parameters["output"])

def series_to_dataframe(self, series: pd.Series) -> pd.DataFrame:
assert hasattr(self, "parameters")
assert isinstance(self.parameters["output"], ArrayParam)
assert all(isinstance(pp["name"], StringParam) for pp in self.parameters["output"])
column_names = [
pp.name.value or "Column %d" % n
for n, pp in enumerate(self.parameters["output"], 1)
pp.name.value or "Column %d" % n for n, pp in enumerate(self.parameters["output"], 1)
] # type: ignore [attr-defined]

data = series.tolist()
column_names = column_names[:len(data[0])]
column_names = column_names[: len(data[0])]
df = pd.DataFrame(data, columns=column_names, index=series.index)
return df

Expand Down
1 change: 0 additions & 1 deletion countess/gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def show_config_subframe(self):
self.config_canvas.bind("<Configure>", self.on_config_canvas_configure)

def on_config_canvas_configure(self, *_):

self.config_canvas.itemconfigure(self.config_subframe_id, width=self.config_canvas.winfo_width())

def on_label_configure(self, *_):
Expand Down

0 comments on commit 7fb11dd

Please sign in to comment.