gravity-toolkit icon indicating copy to clipboard operation
gravity-toolkit copied to clipboard

A little problem.

Open zhangyuyayaya opened this issue 1 year ago • 2 comments

When running GRACE-Harmonic-Plots.ipynb, the following error occurs. What should I do to solve it?

set the directory with GRACE/GRACE-FO data

update local data with PO.DAAC https servers

widgets = gravtk.tools.widgets() ipywidgets.VBox([ widgets.directory, widgets.update ])


NotImplementedError Traceback (most recent call last) Cell In[3], line 3 1 # set the directory with GRACE/GRACE-FO data 2 # update local data with PO.DAAC https servers ----> 3 widgets = gravtk.tools.widgets() 4 ipywidgets.VBox([ 5 widgets.directory, 6 widgets.update 7 ])

File D:\Professional\Anaconda3\envs\GRACE\lib\site-packages\gravity_toolkit\tools.py:91, in widgets.init(self, **kwargs) 89 self.style = copy.copy(kwargs['style']) 90 # run directory ---> 91 self.select_directory(**kwargs)

File D:\Professional\Anaconda3\envs\GRACE\lib\site-packages\gravity_toolkit\tools.py:128, in widgets.select_directory(self, **kwargs) 123 self.directory = ipywidgets.HBox([ 124 self.directory_label, 125 self.directory_button 126 ]) 127 else: --> 128 self.directory = copy.copy(self.directory_label) 129 # connect directory select button with action 130 self.directory_button.on_click(self.set_directory)

File D:\Professional\Anaconda3\envs\GRACE\lib\copy.py:84, in copy(x) 82 copier = getattr(cls, "copy", None) 83 if copier is not None: ---> 84 return copier(x) 86 reductor = dispatch_table.get(cls) 87 if reductor is not None:

File D:\Professional\Anaconda3\envs\GRACE\lib\site-packages\ipywidgets\widgets\widget.py:509, in Widget.copy(self) 508 def copy(self): --> 509 raise NotImplementedError("Widgets cannot be copied; custom implementation required")

NotImplementedError: Widgets cannot be copied; custom implementation required

zhangyuyayaya avatar Nov 24 '24 14:11 zhangyuyayaya

hi @zhangyuyayaya, Right. I think ipywidgets deprecated copying widgets to new variables. I think I scrubbed out all instances of the copies in #151

tsutterley avatar Nov 25 '24 18:11 tsutterley

thanks.

zhangyuyayaya avatar Nov 27 '24 06:11 zhangyuyayaya