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

'Parameter name clashes for keys' in Detail View #118

Closed
chbrandt opened this issue Feb 24, 2020 · 13 comments
Closed

'Parameter name clashes for keys' in Detail View #118

chbrandt opened this issue Feb 24, 2020 · 13 comments
Assignees

Comments

@chbrandt
Copy link
Contributor

The Query Filter mechanism -- available under the Flags Filter -- allows the user to subsample datapoints through a "free" query expression over metrics columns.

When I test the Query filter with the Skyplot View active, things seem to work fine; I can "Run the query", then "clear" it, and notice some reaction on the Skyplot. If I then change the view to Detail View a log message (is written to the terminal):

Parameter name clashes for keys {'height', 'width', 'scale'}

Below I will put a series of screenshot of this procedure to make it as clear as possible. But before, I would like to add that if the Query Filter is run while the Detail View is active, the dashboard crashes with the same message (Parameter name clashes for keys {'height', 'width', 'scale'}) at the end. I will put the respective error stack at the end, after the screenshots.

Example of workflow to reproduce the "unexpected message in the terminal":

  • (Load data and) chose a metric (psfTraceSdssDiff_percent for instance) to visualize
    image

  • Run Query Filter
    image

  • Clear it
    image

  • Change to Skyplot View (all seems ok, notice that datapoints are not subsampled anymore -- we cleared the query/filter)
    image

  • Message in the terminal
    image

Error stack

If we do the steps above looking at Detail View active instead of Skyplot View we will see the following (crash):

tornado.application - ERROR - Exception in callback functools.partial(<function wrap.<locals>.null_wrapper at 0x12d355170>, <Future finished exception=AttributeError("'functools.partial' object has no attribute '__self__'")>)
Traceback (most recent call last):
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/tornado/ioloop.py", line 758, in _run_callback
    ret = callback()
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/tornado/stack_context.py", line 300, in null_wrapper
    return fn(*args, **kwargs)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
    future.result()
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/tornado/gen.py", line 1147, in run
    yielded = self.gen.send(value)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/bokeh/server/session.py", line 70, in _needs_document_lock_wrapper
    result = yield yield_for_all_futures(func(self, *args, **kwargs))
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/bokeh/server/session.py", line 191, in with_document_locked
    return func(*args, **kwargs)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/bokeh/document/document.py", line 1127, in wrapper
    return doc._with_self_as_curdoc(invoke)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/bokeh/document/document.py", line 1113, in _with_self_as_curdoc
    return f()
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/bokeh/document/document.py", line 1126, in invoke
    return f(*args, **kwargs)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/bokeh/document/document.py", line 916, in remove_then_invoke
    return callback(*args, **kwargs)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/panel/viewable.py", line 786, in _change_event
    self._process_events(events)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/panel/viewable.py", line 776, in _process_events
    self.param.set_param(**self._process_property_change(events))
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/param/parameterized.py", line 1365, in set_param
    self_._batch_call_watchers()
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/param/parameterized.py", line 1480, in _batch_call_watchers
    watcher.fn(*events)
  File "/Users/chbrandt/Estudos/Codigos/repositories/PARIETAL/lsst_dashboard/lsst_dashboard/gui.py", line 704, in _switch_view_mode
    self._plot_layout.append(self.list_layout)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/panel/layout.py", line 305, in append
    self.objects = new_objects
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/param/parameterized.py", line 294, in _f
    instance_param.__set__(obj, val)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/param/parameterized.py", line 296, in _f
    return f(self, obj, val)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/param/parameterized.py", line 861, in __set__
    obj.param._call_watcher(watcher, event)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/param/parameterized.py", line 1456, in _call_watcher
    watcher.fn(event)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/panel/viewable.py", line 693, in param_change
    self._update_model(events, msg, root, model, doc, comm)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/panel/layout.py", line 79, in _update_model
    filtered[self._rename['objects']] = self._get_objects(model, old, doc, root, comm)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/panel/layout.py", line 126, in _get_objects
    child = pane._get_model(doc, root, model, comm)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/panel/layout.py", line 136, in _get_model
    objects = self._get_objects(model, [], doc, root, comm)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/panel/layout.py", line 126, in _get_objects
    child = pane._get_model(doc, root, model, comm)
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/panel/pane/holoviews.py", line 256, in _get_model
    old_plot.cleanup()
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/holoviews/plotting/bokeh/plot.py", line 347, in cleanup
    (p, subscriber) for p, subscriber in stream._subscribers
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/holoviews/plotting/bokeh/plot.py", line 348, in <listcomp>
    if get_method_owner(subscriber) not in plots
  File "/Users/chbrandt/opt/miniconda3/envs/lsst-panel/lib/python3.7/site-packages/holoviews/core/util.py", line 543, in get_method_owner
    return method.__self__ if sys.version_info.major >= 3 else method.im_self
AttributeError: 'functools.partial' object has no attribute '__self__'
Parameter name clashes for keys {'height', 'width', 'scale'}

@philippjfr I saw something similar here holoviz/holoviews#3831. Any ideas of how I could work around this (or whether I'm doing something wrong)?

@philippjfr
Copy link
Collaborator

Seems like a bug in HoloViews, seems like that utility needs to be updated to inspect the function wrapped by the partial.

@philippjfr
Copy link
Collaborator

PR would be welcome as I'm pushing hard on getting various features done.

@chbrandt
Copy link
Contributor Author

chbrandt commented Feb 27, 2020

OK, thanks. I will look into it. If you have any directions to arrive quicker to tackle the problem, feel free to be the boss.

@philippjfr
Copy link
Collaborator

Just FYI, I've already handled the "Parameter name clashes" issue separately in holoviz/holoviews#4119.

@chbrandt
Copy link
Contributor Author

Nice, thanks. I'll clone it and check on my side.

@chbrandt
Copy link
Contributor Author

Yes, I checked out Hv seleciton_mode branch and installed. Something is still there: same workflow, crash, but different error:

(...)
  File "/Users/chbrandt/Estudos/Codigos/repositories/PARIETAL/panel/panel/pane/holoviews.py", line 256, in _get_model
    old_plot.cleanup()
  File "/Users/chbrandt/Estudos/Codigos/repositories/PARIETAL/holoviews/holoviews/plotting/bokeh/plot.py", line 234, in cleanup
    (p, subscriber) for p, subscriber in stream._subscribers
  File "/Users/chbrandt/Estudos/Codigos/repositories/PARIETAL/holoviews/holoviews/plotting/bokeh/plot.py", line 235, in <listcomp>
    if get_method_owner(subscriber) not in plots
  File "/Users/chbrandt/Estudos/Codigos/repositories/PARIETAL/holoviews/holoviews/core/util.py", line 541, in get_method_owner
    return method.__self__ if sys.version_info.major >= 3 else method.im_self
AttributeError: 'functools.partial' object has no attribute '__self__'

Will look if I can spot it.

@chbrandt
Copy link
Contributor Author

chbrandt commented Feb 28, 2020

@philippjfr I applied a very naive patch to that, it is here: https://github.com/chbrandt/holoviews/commit/739802c991684ce93978774436e3312f505a7de3 . I could not follow where __self__ is assigned so I decided trust on your coding and return a None (which is certainly no in the stream). But maybe you have a word on that?
PS: it does (afai can see) solve my crash.

@timothydmorton
Copy link
Contributor

I've seen that same error elsewhere, too, though don't remember the exact context.

@philippjfr
Copy link
Collaborator

Fixed in holoviz/holoviews#4259

@chbrandt
Copy link
Contributor Author

chbrandt commented Mar 6, 2020

This is strange @philippjfr ... still,

/Users/chbrandt/Estudos/Codigos/repositories/PARIETAL/holoviews/holoviews/core/util.py", line 549, in get_method_owner
    return method.__self__ if sys.version_info.major >= 3 else method.im_self
AttributeError: 'function' object has no attribute '__self__'

is comming out.

I'm at the latest:

$ git log -n1
commit 9f5425e2a92ce51c3cd3ae2cb4d1404a77768373 (HEAD -> master, tag: v1.13.0b2, origin/master, origin/HEAD)
Author: Philipp Rudiger <prudiger@anaconda.com>
Date:   Thu Mar 5 20:59:58 2020 +0100

    Require firefox and geckodriver for doc builds (#4272)

My env has it installed:

$ pip list | grep holov
holoviews                     1.13.0b2            /Users/chbrandt/Estudos/Codigos/repositories/PARIETAL/holoviews

@philippjfr
Copy link
Collaborator

That's odd indeed. I'll look into it.

@philippjfr
Copy link
Collaborator

Should be fixed in holoviz/holoviews#4275

@chbrandt
Copy link
Contributor Author

Yep! Awesome.

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

No branches or pull requests

4 participants