Skip to content

Commit

Permalink
Simplify and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuang11 committed Nov 12, 2023
1 parent 1e6e8fe commit 643018a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions hvplot/tests/testui.py
Expand Up @@ -64,6 +64,7 @@ def test_explorer_plot_code():
" kind='scatter',\n"
" x='bill_length_mm',\n"
" y=['bill_depth_mm'],\n"
" widget_location='bottom',\n"
")"
)
)
Expand All @@ -77,6 +78,7 @@ def test_explorer_plot_code():
" kind='scatter',\n"
" x='bill_length_mm',\n"
" y=['bill_depth_mm'],\n"
" widget_location='bottom',\n"
")"
)
)
Expand Down Expand Up @@ -278,6 +280,7 @@ def test_explorer_code_dataframe():
kind='points',
x='bill_length_mm',
y='species',
widget_location='bottom',
)"""
)
assert explorer._code_pane.object == dedent("""\
Expand All @@ -286,6 +289,7 @@ def test_explorer_code_dataframe():
kind='points',
x='bill_length_mm',
y='species',
widget_location='bottom',
)
```"""
)
Expand All @@ -301,6 +305,7 @@ def test_explorer_code_gridded():
kind='image',
x='lon',
y='lat',
widget_location='bottom',
)""")

assert explorer._code_pane.object == dedent("""\
Expand All @@ -311,6 +316,7 @@ def test_explorer_code_gridded():
kind='image',
x='lon',
y='lat',
widget_location='bottom',
)
```"""
)
Expand All @@ -327,6 +333,7 @@ def test_explorer_code_gridded_dataarray():
kind='image',
x='lon',
y='lat',
widget_location='bottom',
)""")

assert explorer._code_pane.object == dedent("""\
Expand All @@ -337,6 +344,7 @@ def test_explorer_code_gridded_dataarray():
kind='image',
x='lon',
y='lat',
widget_location='bottom',
)
```"""
)
Expand All @@ -353,6 +361,7 @@ def test_explorer_code_opts():
kind='image',
x='lon',
y='lat',
widget_location='bottom',
).opts(
color_levels=3,
)""")
Expand All @@ -365,6 +374,7 @@ def test_explorer_code_opts():
kind='image',
x='lon',
y='lat',
widget_location='bottom',
).opts(
color_levels=3,
)
Expand Down
2 changes: 1 addition & 1 deletion hvplot/ui.py
Expand Up @@ -512,7 +512,7 @@ def __init__(self, df, **params):
# Using .layout on the HoloViews pane to display the widgets
# https://github.com/holoviz/panel/issues/5628#issuecomment-1763443895
pn.Tabs(('Plot', self._hv_pane.layout), ('Code', self._code_pane)),
sizing_mode='stretch_both', min_height=1000
sizing_mode='stretch_both'
),
sizing_mode='stretch_both'
)
Expand Down

0 comments on commit 643018a

Please sign in to comment.