I'm trying to use the IPython interact widget for a particular method in one of my classes. I would like it to ignore the self & colour arguments, and only adjust the i argument, but it insists that self is a bonafide argument too.
A similar question was asked here, but neither method (using fixed on self or pre-loading self into the method with partial) is appropriate in this case.
from ipywidgets.widgets import interact,fixed
import matplotlib.pyplot as plt
class Profile():
'''self.stages is a list of lists'''
@interact(i=(0,5,1),colour=fixed(DEFAULT_COLOR))
def plot_stages(self, i, colour):
plt.plot(self.stages[i], color=colour)
This returns an error:
ValueError: cannot find widget or abbreviation for argument: 'self'
So how does one tell interact to ignore the self argument?