Skip to content

Commit

Permalink
formatting & tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nickzoic committed Apr 16, 2024
1 parent 4019ea3 commit f666013
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions countess/gui/tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pandas as pd
from pandas.api.types import is_integer_dtype, is_numeric_dtype

from countess.gui.widgets import copy_to_clipboard, get_icon, ResizingFrame
from countess.gui.widgets import ResizingFrame, copy_to_clipboard, get_icon

# XXX columns should automatically resize based on information
# from _column_xscrollcommand which can tell if they're
Expand Down Expand Up @@ -104,7 +104,7 @@ def __init__(self, *a, **k):
self.label_frame.pack(fill="x")

self.scrollbar = ttk.Scrollbar(self, orient=tk.VERTICAL)
self.scrollbar.pack(side='right', fill='y')
self.scrollbar.pack(side="right", fill="y")
self.scrollbar["command"] = self._scrollbar_command

self.bind("<Configure>", self._configure)
Expand Down Expand Up @@ -172,7 +172,7 @@ def set_dataframe(self, dataframe: pd.DataFrame, offset: Optional[int] = 0):
if self.subframe:
self.subframe.destroy()
self.subframe = ResizingFrame(self, orientation=ResizingFrame.Orientation.HORIZONTAL, bg="darkgrey")
self.subframe.pack(side='left', fill='both', expand=True)
self.subframe.pack(side="left", fill="both", expand=True)

self.label["text"] = f"Dataframe Preview {len(self.dataframe)} rows"

Expand All @@ -190,7 +190,6 @@ def set_dataframe(self, dataframe: pd.DataFrame, offset: Optional[int] = 0):
column_text.bind("<Configure>", partial(self._column_configure, num))
self.columns.append(column_text)


def _column_configure(self, num, ev):
# when the column changes position, move the labels around
# to match
Expand Down
4 changes: 3 additions & 1 deletion tests/gui/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def test_main():
root = make_root()
node = PipelineNode(name="NEW", plugin=DataTablePlugin())
callback = MagicMock()
wrap = ConfiguratorWrapper(root, node, callback)
logger = MagicMock()

wrap = ConfiguratorWrapper(root, node, logger, callback)
wrap.on_add_notes()

root.update()
Expand Down
2 changes: 0 additions & 2 deletions tests/gui/test_tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ def test_tabular_1():
root = make_root()
tt = TabularDataFrame(root)

tt.reset()

tt.set_dataframe(df0)
tt.set_dataframe(df00)
tt.set_dataframe(df1)
Expand Down

0 comments on commit f666013

Please sign in to comment.