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

Slider Bug #16

Open
3 tasks done
billy-doyle opened this issue May 1, 2020 · 0 comments
Open
3 tasks done

Slider Bug #16

billy-doyle opened this issue May 1, 2020 · 0 comments

Comments

@billy-doyle
Copy link
Contributor

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of moly.

  • (optional) I have confirmed this bug exists on the master branch of moly.


Code Sample, a copy-pastable example

fig = moly.Figure()
fig.add_cube('Psi_a_9_5-A1.cube', iso=[0.03, 0.04, 0.05], plot_geometry=True)
fig.show()

Error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-29b34361b222> in <module>
      1 fig = moly.Figure()
----> 2 fig.add_cube('Psi_a_9_5-A1.cube', iso=[0.03, 0.04, 0.05], plot_geometry=True)
      3 fig.show()

~/Python_stuff/psi4labs/moly/moly/figure/figure.py in add_cube(self, file, iso, plot_geometry, colorscale, opacity, style)
    127                 self.fig.add_trace(trace)
    128 
--> 129             slider = get_slider(iso, geometry_traces)
    130             self.fig.update_layout(sliders=slider)
    131 

~/Python_stuff/psi4labs/moly/moly/figure/widgets.py in get_slider(iso, geometry_traces)
     44         one_step = {'method': "restyle", 
     45                     'label': str(iso_i),
---> 46                     'args': [{"visible": [True] * geometry_traces + [False] * len(iso)}]}
     47         one_step["args"][0]['visible'][geometry_traces + i] = True
     48         steps.append(one_step)

TypeError: can't multiply sequence by non-int of type 'tuple'

Problem description

In moly/figure/figure.py, line 120 should have the len removed.
In moly/figure/widgets.py, lines 46 and 47 do not include the len for the geometry_traces parameter.

I have tested this locally and it works as expected.

See PR #15

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