EtienneCmb / visbrain

A multi-purpose GPU-accelerated open-source suite for brain data visualization
http://visbrain.org
Other
241 stars 64 forks source link

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

Open cboulay opened 3 years ago

cboulay commented 3 years ago

SceneObj's docstring lists show as a kwarg:

https://github.com/EtienneCmb/visbrain/blob/b599038e095919dc193b12d5e502d127de7d03c9/visbrain/objects/scene_obj.py#L339-L347

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

https://github.com/EtienneCmb/visbrain/blob/b599038e095919dc193b12d5e502d127de7d03c9/visbrain/objects/scene_obj.py#L361-L362

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

https://github.com/EtienneCmb/visbrain/blob/b599038e095919dc193b12d5e502d127de7d03c9/visbrain/objects/scene_obj.py#L368-L370

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.