Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regression test for bug that caused histogram viewer to crash when removing datasets #407

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion glue_jupyter/bqplot/histogram/tests/test_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_non_hex_colors(app, dataxyz):
dataxyz.subsets[0].style.color = 'purple'


def test_remove(app, dataxz, dataxyz):
def test_remove_from_viewer(app, dataxz, dataxyz):
s = app.histogram1d(data=dataxyz)
s.add_data(dataxz)
app.data_collection.new_subset_group(subset_state=dataxz.id['x'] > 1, label='test')
Expand All @@ -28,6 +28,20 @@ def test_remove(app, dataxz, dataxyz):
assert len(s.figure.marks) == 0


def test_remove_from_data_collection(app, dataxz, dataxyz):
s = app.histogram1d(data=dataxyz)
s.add_data(dataxz)
app.data_collection.new_subset_group(subset_state=dataxz.id['x'] > 1, label='test')
assert len(s.figure.marks) == 4
s.state.hist_n_bin = 30
app.data_collection.remove(dataxyz)
assert len(s.figure.marks) == 2
s.state.hist_n_bin = 20
app.data_collection.remove(dataxz)
assert len(s.figure.marks) == 0
s.state.hist_n_bin = 10


def test_redraw_empty_subset(app, dataxz):
s = app.histogram1d(data=dataxz)
s.add_data(dataxz)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ python_requires = >=3.8
setup_requires =
setuptools_scm
install_requires =
glue-core>=1.7.0
glue-core>=1.14.1
glue-vispy-viewers>=1.0
notebook>=4.0
ipympl>=0.3.0
Expand Down