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

SceneObj show kwarg in docstring but it cannot be provided #94

Open
cboulay opened this issue Mar 14, 2021 · 0 comments
Open

SceneObj show kwarg in docstring but it cannot be provided #94

cboulay opened this issue Mar 14, 2021 · 0 comments

Comments

@cboulay
Copy link

cboulay commented Mar 14, 2021

SceneObj's docstring lists show as a kwarg:

class SceneObj(object):
"""Create a scene and add objects to it.
Parameters
----------
bgcolor : string | 'black'
Background color of the scene.
show : bool | True
Display the canvas.

However, it isn't an explicit kwarg in the constructor

def __init__(self, bgcolor='black', camera_state={}, verbose=None,
**kwargs):

so it gets dumped into kwargs. **kwargs is then passed on to the SceneCanvas constructor, which also has an explicit show=False,

self.canvas = scene.SceneCanvas(keys='interactive', show=False,
title='Object scene',
bgcolor=color2vb(bgcolor), **kwargs)

thus giving SceneCanvas two different values for show, raising an error.

A simple fix is to put show=True in the SceneObj init , then modify the call to create a SceneCanvas object to pass in show=show.

I'm not putting this in a PR because, while the suggested modification is consistent with the docstring, it changes the default behaviour. To replicate the current behaviour, the SceneObj init should have show=False (and the docstring should be updated accordingly). I'm not sure what the "correct" desired behaviour is.

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

1 participant