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

fixed issue 1581 #1584

Merged
merged 3 commits into from
Sep 15, 2020
Merged

fixed issue 1581 #1584

merged 3 commits into from
Sep 15, 2020

Conversation

MarcSkovMadsen
Copy link
Collaborator

@MarcSkovMadsen MarcSkovMadsen commented Sep 15, 2020

This should fix #1581

I've added a test and a one line fix. For me all tests pass.

But I simply don't understand the logic of the function I've changed. Are we sure that all combinations of events wil work?

image

@MarcSkovMadsen
Copy link
Collaborator Author

@philippjfr . Let me know if there is more I should do.

@codecov
Copy link

codecov bot commented Sep 15, 2020

Codecov Report

Merging #1584 into master will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1584      +/-   ##
==========================================
- Coverage   85.68%   85.68%   -0.01%     
==========================================
  Files         147      147              
  Lines       16414    16440      +26     
==========================================
+ Hits        14064    14086      +22     
- Misses       2350     2354       +4     
Impacted Files Coverage Δ
panel/param.py 90.88% <ø> (-0.71%) ⬇️
panel/tests/test_param.py 99.86% <ø> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1526bb0...0e4e69a. Read the comment docs.

panel/param.py Outdated
@@ -227,7 +227,8 @@ def _update_widgets(self, *events):
parameters = [] if event.new == [] else event.new

if parameters != [] and parameters != self.parameters:
self.parameters = parameters
if not self.parameters:
self.parameters = parameters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change does not seem correct to me, but I can see how the previous logic was incorrect too. Will keep your test though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

@philippjfr
Copy link
Member

Okay, added what I think is the correct fix. That said I also can't explain the return there. Will have to think about that more.

@philippjfr
Copy link
Member

Okay I understand it now and left comments. The return statement was there because setting self.parameters would trigger the method to be called again, which would then lead to the appropriate changes being applied.

@philippjfr philippjfr force-pushed the issue-1581-param-object-and-parameters branch from 9512ee3 to 0e4e69a Compare September 15, 2020 09:46
@philippjfr philippjfr merged commit 4e3439d into master Sep 15, 2020
@philippjfr philippjfr deleted the issue-1581-param-object-and-parameters branch September 15, 2020 10:47
philippjfr added a commit that referenced this pull request Sep 17, 2020
* fixed issue 1581

* Handle condition where Param.parameters was set

* Keep track whether parameters was explicitly set

Co-authored-by: Marc Skov Madsen <masma@orsted.dk>
Co-authored-by: Philipp Rudiger <prudiger@anaconda.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When updating Param object the parameters changes
2 participants