8000 Fix all_equal() and hence get_param_values( by ceball · Pull Request #437 · holoviz/param · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix all_equal() and hence get_param_values(> #437

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

Closed
wants to merge 5 commits into from
Closed

Conversation

ceball
Copy link
Contributor
@ceball ceball commented Sep 14, 2020

all_equal() is pretty broken, so replace it with Comparator.is_equal().

Fixes #179
Incorporates #180

But, some issues...

To do:

  • decide on "different definitions of equality"
  • decide on how/when to suppress name parameter from get_param_values()
  • add a test (if necessary, depending what is decided)

Different definitions of equality

I'd like everything to be deciding equality the same way. However, it's probably tricky. You can't always have full equality checks everywhere (e.g. could be too expensive).

Comparator.is_equal() does not (by default) handle numpy arrays or param.Time(*), both of which are (meant to be) handled by all_equal().

  1. Drop those from all_equal() (i.e. make it like default of Comparator.is_equal())?

  2. Or support those during all_equal(), i.e. retain all_equal's existing intended behavior, but comparisons done with Comparator (outside of all_equal) would by default behave differently.

  3. Or make Comparator.is_equal() handle numpy arrays and param.Time by default. (I'm not quite sure how it's supposed to work on skimming it, but it looks like Comparator is designed to allow comparisons without explicit imports, but even if not seems likely it could be made to work).

(*) Has _infinitely_iterable attribute

I'm not too sure. I prefer 1 or 3. When I think of param in the past, I think 3 is what I'd like. But I suspect there's a good reason the default of Comparator is not to handle various cases (performance?).

Retaining get_param_values( behavior of not showing auto-generated name

As noted in #179, a side effect of the incorrect all_equal() function is that it suppresses a parameterized's name from appearing in the result of get_param_values(> if the name was auto-generated. I've added suppress_auto_name to get_param_values(), defaulting to True, so that if is requested, an auto-generated name is not included.

But I feel like there are often times when you don't want the name in the parameters you're dealing with, so I'd prefer suppress_auto_name to be respected whether or not onlychanged is True.

I haven't thought about it a lot. Whether to have this option and what it does might depend a bit on the outcome of the api discussions.

@jbednar jbednar added this to the v1.10.2 milestone May 10, 2021
@jbednar jbednar modified the milestones: v1.10.2, v1.10.3 Jun 30, 2021
@MridulS MridulS modified the milestones: v1.11.2, v1.12.1 Feb 7, 2022
@philippjfr philippjfr modified the milestones: v1.12.x, 2.0 Jan 16, 2023
@maximlt maximlt modified the milestones: 2.0, v2.x Apr 16, 2023
@maximlt
Copy link
Member
maximlt commented Jul 28, 2023

Superseded by #795

@maximlt maximlt closed this Jul 28, 2023
@maximlt maximlt removed this from the v2.x milestone Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

all_equal() is broken
5 participants
0