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

Cycle is broken for Overlay #1081

Closed
basnijholt opened this issue Jan 25, 2017 · 5 comments
Closed

Cycle is broken for Overlay #1081

basnijholt opened this issue Jan 25, 2017 · 5 comments
Labels
type: bug Something isn't correct or isn't working

Comments

@basnijholt
Copy link
Contributor

basnijholt commented Jan 25, 2017

This used to work in v1.4.3

%%opts Curve (color=Cycle(values=['r', 'g', 'b', 'y']))
plot = [hv.Curve(np.random.rand(10)) * hv.HLine(0) for i in range(4)]
plot = hv.Overlay(plot)
plot

download

However this:

%%opts Curve (color=Cycle(values=['r', 'g', 'b', 'y']))
plot = (hv.Curve(np.random.rand(10)) * hv.HLine(0) * 
        hv.Curve(np.random.rand(10)) * hv.HLine(0) *
        hv.Curve(np.random.rand(10)) * hv.HLine(0) *
        hv.Curve(np.random.rand(10)) * hv.HLine(0))
plot

produces:
download 1

@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Jan 25, 2017
@philippjfr
Copy link
Member

This is high priority, I'll investigate tomorrow.

@philippjfr
Copy link
Member

philippjfr commented Jan 26, 2017

This seems pretty bad and I don't know how this hasn't gotten caught sooner. In 1.4.3 this:

elements = [hv.Curve(np.random.rand(10)) * hv.HLine(0) for i in range(4)]
overlay = hv.Overlay(elements)
print(repr(overlay))

produces this:

:Overlay
   .Curve.I   :Curve   [x]   (y)
   .HLine.I   :HLine   [x,y]
   .Curve.II  :Curve   [x]   (y)
   .HLine.III :HLine   [x,y]
   .Curve.III :Curve   [x]   (y)
   .HLine.IV  :HLine   [x,y]
   .Curve.IV  :Curve   [x]   (y)
   .HLine.V   :HLine   [x,y]

In 1.7 it produces this:

:Overlay
   .Overlay.I   :Overlay
      .Curve.I :Curve   [x]   (y)
      .HLine.I :HLine   [x,y]
   .Overlay.II  :Overlay
      .Curve.I :Curve   [x]   (y)
      .HLine.I :HLine   [x,y]
   .Overlay.III :Overlay
      .Curve.I :Curve   [x]   (y)
      .HLine.I :HLine   [x,y]
   .Overlay.IV  :Overlay
      .Curve.I :Curve   [x]   (y)
      .HLine.I :HLine   [x,y]

Somewhere along the line we broke how Overlays are nested 😱 I'll have to bisect tomorrow to see when this happened.

@philippjfr
Copy link
Member

philippjfr commented Jan 26, 2017

My fault:

2e801dabdc730f969734026f7dbccf664cad6c5f is the first bad commit
commit 2e801dabdc730f969734026f7dbccf664cad6c5f
Author: Philipp Rudiger <[email protected]>
Date:   Wed Oct 26 00:07:42 2016 +0100

    Reimplemented Layout.from_values

@jlstevens
Copy link
Contributor

Ah right..because Overlay inherits from Layout. And it has been this way since the 26th of October! At least it is not an issue that made it into any non-dev release...

@philippjfr
Copy link
Member

Finally fixed! Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

3 participants