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

Correct GridSpec override behavior #748

Merged
merged 5 commits into from
Nov 8, 2019
Merged
Changes from 2 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
8 changes: 3 additions & 5 deletions panel/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,9 +718,8 @@ class GridSpec(Panel):
The dictionary of child objects that make up the grid.""")

mode = param.ObjectSelector(
default='warn', objects=['warn', 'error', 'override'], doc="""
Whether to warn, error or simply override on overlapping
assignment.""")
default='override', objects=['error', 'override'], doc="""
Whether to error or simply override on overlapping assignment.""")

width = param.Integer(default=600)

Expand Down Expand Up @@ -961,8 +960,7 @@ def __setitem__(self, index, obj):
str(grid.astype('uint8')))
if self.mode == 'error':
raise IndexError(overlap_text)
elif self.mode == 'warn':
self.param.warning(overlap_text)
self.objects.__delitem__(*self.__getitem__(index).objects.keys())
philippjfr marked this conversation as resolved.
Show resolved Hide resolved
self.__delitem__(index, False)
self.objects[key] = Pane(obj)
self.param.trigger('objects')
Expand Down