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 5 commits into from Nov 8, 2019


Copy link

@kleavor kleavor commented Nov 6, 2019

Closes #514 .

Removed the 'warn' mode to keep only 'error' and 'override'.
'override' behavior now correctly removes the pre-existing Panel.

WIP since the object deletion feels like a kludge and an additional latent bug was noticed during 'error' behavior resulting from line 937-945.

The if-statement on overlap only evaluates to true if the location of the new Panel object exactly matches the location of the conflicting Panel object. In the case of the example provided in the Issue, neither of the new panels matches the "Initial" Panel exactly, and the new object is still added despite erroring, since the error is not raised until the end of the method.

Behavior can be observed in a notebook with the following cells

gs = pn.GridSpec(mode='error')
gs[0:2, 0] = pn.widgets.MultiSelect(options=[0, 1, 2, 3], name='Initial')

The following cell will raise an Exception.

gs[0:1, 0] = pn.widgets.MultiSelect(options=[5, 6, 7], name='Second')
gs[1:2, 0] = pn.widgets.MultiSelect(options=[9, 10, 11], name='Third')

This cell will show that the state of the gs object now still contains the MultiSelect object despite erroring.


kleavor added 2 commits Nov 6, 2019
Removed the 'warn' mode to keep only 'error' and 'override'.
'override' behavior now correctly removes the pre-existing Panel.
panel/ Outdated Show resolved Hide resolved
@philippjfr philippjfr changed the title WIP: Correct GridSpec override behavior Correct GridSpec override behavior Nov 8, 2019
Copy link

@philippjfr philippjfr commented Nov 8, 2019

Thanks for helping out @kleavor! I hope you don't mind I fixed up the PR.

@philippjfr philippjfr merged commit 9bb2499 into holoviz:master Nov 8, 2019
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

2 participants