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

Critical ⚠️ : Reset structure after submit the workflow cause the break #527

Closed
unkcpz opened this issue Oct 22, 2023 · 2 comments · Fixed by #537
Closed

Critical ⚠️ : Reset structure after submit the workflow cause the break #527

unkcpz opened this issue Oct 22, 2023 · 2 comments · Fixed by #537
Assignees
Labels
bug Something isn't working
Milestone

Comments

@unkcpz
Copy link
Member

unkcpz commented Oct 22, 2023

Here is how to reproduce it:

  • submit a calculation,
  • without reset, directly go to step1 and select a new structure.

any idea? @superstar54
I can reproduce this by select new structure from "From Example" see #529

---------------------------------------------------------------------------
TraitError                                Traceback (most recent call last)
/opt/conda/lib/python3.9/site-packages/optimade_client/query_filter.py in retrieve_data(self, _)
    579             # Update list of structures in dropdown widget
--> 580             self._update_structures(response["data"])
    581 

/opt/conda/lib/python3.9/site-packages/optimade_client/query_filter.py in _update_structures(self, data)
    551         # Update list of structures in dropdown widget
--> 552         self.structure_drop.set_options(structures)
    553 

/opt/conda/lib/python3.9/site-packages/optimade_client/subwidgets/results.py in set_options(self, options)
     39         with self.hold_trait_notifications():
---> 40             self.index = index
     41 

/opt/conda/lib/python3.9/contextlib.py in __exit__(self, typ, value, traceback)
    125             try:
--> 126                 next(self.gen)
    127             except StopIteration:

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in hold_trait_notifications(self)
   1370                     for change in changes:
-> 1371                         self.notify_change(change)
   1372 

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1430 
-> 1431             c(event)
   1432 

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget_selection.py in _propagate_index(self, change)
    234         if self.value is not value:
--> 235             self.value = value
    236 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    714         else:
--> 715             self.set(obj, value)
    716 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1430 
-> 1431             c(event)
   1432 

/opt/conda/lib/python3.9/site-packages/optimade_client/query_filter.py in _on_structure_select(self, change)
    207         else:
--> 208             self.structure = chosen_structure["structure"]
    209 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    714         else:
--> 715             self.set(obj, value)
    716 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1430 
-> 1431             c(event)
   1432 

/opt/conda/lib/python3.9/site-packages/aiidalab_widgets_base/databases.py in _update_structure(self, change)
    202         """New structure chosen"""
--> 203         self.structure = (
    204             change["new"].as_aiida_structuredata.get_ase() if change["new"] else None

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    714         else:
--> 715             self.set(obj, value)
    716 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1430 
-> 1431             c(event)
   1432 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _update(self, change)
    451         with self._busy_updating():
--> 452             setattr(self.target[0], self.target[1], self._transform(change.new))
    453 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    714         else:
--> 715             self.set(obj, value)
    716 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1430 
-> 1431             c(event)
   1432 

/opt/conda/lib/python3.9/site-packages/aiidalab_widgets_base/structures.py in _observe_input_structure(self, change)
    314         if isinstance(change["new"], ase.Atoms):
--> 315             self.structure = change["new"]
    316 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    714         else:
--> 715             self.set(obj, value)
    716 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1430 
-> 1431             c(event)
   1432 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _update_source(self, change)
    380             if getattr(self.target[0], self.target[1]) != change.new:
--> 381                 raise TraitError(
    382                     "Broken link {}: the target value changed while updating "

TraitError: Broken link <traitlets.traitlets.link object at 0x7f7e1ca08880>: the target value changed while updating the source.

The above exception was the direct cause of the following exception:

QueryError                                Traceback (most recent call last)
/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in _handle_msg(self, msg)
    762                 if 'buffer_paths' in data:
    763                     _put_buffers(state, data['buffer_paths'], msg['buffers'])
--> 764                 self.set_state(state)
    765 
    766         # Handle a state request.

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in set_state(self, sync_data)
    631                     from_json = self.trait_metadata(name, 'from_json',
    632                                                     self._trait_from_json)
--> 633                     self.set_trait(name, from_json(sync_data[name], self))
    634 
    635     def send(self, content, buffers=None):

/opt/conda/lib/python3.9/contextlib.py in __exit__(self, typ, value, traceback)
    124         if typ is None:
    125             try:
--> 126                 next(self.gen)
    127             except StopIteration:
    128                 return False

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in hold_trait_notifications(self)
   1369                 for changes in cache.values():
   1370                     for change in changes:
-> 1371                         self.notify_change(change)
   1372 
   1373     def _notify_trait(self, name, old_value, new_value):

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    692                 # Send new state to front-end
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 
    696     def __repr__(self):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1384     def notify_change(self, change):
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 
   1388     def _notify_observers(self, event):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1429                 c = getattr(self, c.name)
   1430 
-> 1431             c(event)
   1432 
   1433     def _add_notifiers(self, handler, name, type):

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget_selection.py in _propagate_index(self, change)
    233             self.label = label
    234         if self.value is not value:
--> 235             self.value = value
    236 
    237     @validate('value')

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    713             raise TraitError('The "%s" trait is read-only.' % self.name)
    714         else:
--> 715             self.set(obj, value)
    716 
    717     def _validate(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    702             # we explicitly compare silent to True just in case the equality
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 
    706     def __set__(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1372 
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(
   1376                 name=name,

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    692                 # Send new state to front-end
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 
    696     def __repr__(self):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1384     def notify_change(self, change):
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 
   1388     def _notify_observers(self, event):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1429                 c = getattr(self, c.name)
   1430 
-> 1431             c(event)
   1432 
   1433     def _add_notifiers(self, handler, name, type):

/opt/conda/lib/python3.9/site-packages/optimade_client/subwidgets/provider_database.py in _observe_child_dbs(self, change)
    183             self.database = "", None
    184         else:
--> 185             self.database = self.child_dbs.label.strip(), self.child_dbs.value
    186 
    187     @staticmethod

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    713             raise TraitError('The "%s" trait is read-only.' % self.name)
    714         else:
--> 715             self.set(obj, value)
    716 
    717     def _validate(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    702             # we explicitly compare silent to True just in case the equality
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 
    706     def __set__(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1372 
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(
   1376                 name=name,

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    692                 # Send new state to front-end
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 
    696     def __repr__(self):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1384     def notify_change(self, change):
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 
   1388     def _notify_observers(self, event):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1429                 c = getattr(self, c.name)
   1430 
-> 1431             c(event)
   1432 
   1433     def _add_notifiers(self, handler, name, type):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _update(self, change)
    450             return
    451         with self._busy_updating():
--> 452             setattr(self.target[0], self.target[1], self._transform(change.new))
    453 
    454     def unlink(self):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    713             raise TraitError('The "%s" trait is read-only.' % self.name)
    714         else:
--> 715             self.set(obj, value)
    716 
    717     def _validate(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    702             # we explicitly compare silent to True just in case the equality
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 
    706     def __set__(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1372 
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(
   1376                 name=name,

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    692                 # Send new state to front-end
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 
    696     def __repr__(self):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1384     def notify_change(self, change):
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 
   1388     def _notify_observers(self, event):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1429                 c = getattr(self, c.name)
   1430 
-> 1431             c(event)
   1432 
   1433     def _add_notifiers(self, handler, name, type):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _update(self, change)
    450             return
    451         with self._busy_updating():
--> 452             setattr(self.target[0], self.target[1], self._transform(change.new))
    453 
    454     def unlink(self):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    713             raise TraitError('The "%s" trait is read-only.' % self.name)
    714         else:
--> 715             self.set(obj, value)
    716 
    717     def _validate(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    702             # we explicitly compare silent to True just in case the equality
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 
    706     def __set__(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1372 
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(
   1376                 name=name,

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    692                 # Send new state to front-end
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 
    696     def __repr__(self):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1384     def notify_change(self, change):
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 
   1388     def _notify_observers(self, event):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1429                 c = getattr(self, c.name)
   1430 
-> 1431             c(event)
   1432 
   1433     def _add_notifiers(self, handler, name, type):

/opt/conda/lib/python3.9/site-packages/optimade_client/query_filter.py in _on_database_select(self, _)
    193                 self.query_button.icon = "search"
    194                 self.query_button.tooltip = "Search"
--> 195                 self.sort_selector.valid_fields = sorted(
    196                     get_sortable_fields(self.database[1].base_url)
    197                 )

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    713             raise TraitError('The "%s" trait is read-only.' % self.name)
    714         else:
--> 715             self.set(obj, value)
    716 
    717     def _validate(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
   2863             return super().set(obj, [value])
   2864         else:
-> 2865             return super().set(obj, value)
   2866 
   2867 

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    702             # we explicitly compare silent to True just in case the equality
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 
    706     def __set__(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1372 
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(
   1376                 name=name,

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    692                 # Send new state to front-end
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 
    696     def __repr__(self):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1384     def notify_change(self, change):
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 
   1388     def _notify_observers(self, event):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1429                 c = getattr(self, c.name)
   1430 
-> 1431             c(event)
   1432 
   1433     def _add_notifiers(self, handler, name, type):

/opt/conda/lib/python3.9/site-packages/optimade_client/subwidgets/sort_selector.py in _update_drop_options(self, change)
    141             return
    142         value = self.fields_drop.value
--> 143         self.fields_drop.options = fields
    144         if value in fields:
    145             self.fields_drop.value = value

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    713             raise TraitError('The "%s" trait is read-only.' % self.name)
    714         else:
--> 715             self.set(obj, value)
    716 
    717     def _validate(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    702             # we explicitly compare silent to True just in case the equality
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 
    706     def __set__(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1372 
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(
   1376                 name=name,

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    692                 # Send new state to front-end
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 
    696     def __repr__(self):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1384     def notify_change(self, change):
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 
   1388     def _notify_observers(self, event):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1429                 c = getattr(self, c.name)
   1430 
-> 1431             c(event)
   1432 
   1433     def _add_notifiers(self, handler, name, type):

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget_selection.py in _propagate_options(self, change)
    212                     # label. Just setting the value would not trigger the observers
    213                     # since traitlets thinks the value hasn't changed.
--> 214                     self._notify_trait('index', 0, 0)
    215                 else:
    216                     self.index = 0

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1372 
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(
   1376                 name=name,

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    692                 # Send new state to front-end
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 
    696     def __repr__(self):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1384     def notify_change(self, change):
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 
   1388     def _notify_observers(self, event):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1429                 c = getattr(self, c.name)
   1430 
-> 1431             c(event)
   1432 
   1433     def _add_notifiers(self, handler, name, type):

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget_selection.py in _propagate_index(self, change)
    233             self.label = label
    234         if self.value is not value:
--> 235             self.value = value
    236 
    237     @validate('value')

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    713             raise TraitError('The "%s" trait is read-only.' % self.name)
    714         else:
--> 715             self.set(obj, value)
    716 
    717     def _validate(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    702             # we explicitly compare silent to True just in case the equality
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 
    706     def __set__(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1372 
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(
   1376                 name=name,

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    692                 # Send new state to front-end
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 
    696     def __repr__(self):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1384     def notify_change(self, change):
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 
   1388     def _notify_observers(self, event):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1429                 c = getattr(self, c.name)
   1430 
-> 1431             c(event)
   1432 
   1433     def _add_notifiers(self, handler, name, type):

/opt/conda/lib/python3.9/site-packages/optimade_client/subwidgets/sort_selector.py in _validate_field(self, change)
    152         field = change["new"]
    153         if field and field != self.NO_AVAILABLE_FIELDS:
--> 154             self.field = field
    155             self._toggle_sort_availability()
    156         else:

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    713             raise TraitError('The "%s" trait is read-only.' % self.name)
    714         else:
--> 715             self.set(obj, value)
    716 
    717     def _validate(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    702             # we explicitly compare silent to True just in case the equality
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 
    706     def __set__(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1372 
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(
   1376                 name=name,

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    692                 # Send new state to front-end
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 
    696     def __repr__(self):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1384     def notify_change(self, change):
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 
   1388     def _notify_observers(self, event):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1429                 c = getattr(self, c.name)
   1430 
-> 1431             c(event)
   1432 
   1433     def _add_notifiers(self, handler, name, type):

/opt/conda/lib/python3.9/site-packages/optimade_client/subwidgets/sort_selector.py in _set_value_from_field(self, change)
    162         value = change["new"]
    163         if value and value != self.NO_AVAILABLE_FIELDS:
--> 164             self.value = f"{self.order.value}{value}"
    165         else:
    166             self.value = None

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    713             raise TraitError('The "%s" trait is read-only.' % self.name)
    714         else:
--> 715             self.set(obj, value)
    716 
    717     def _validate(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in set(self, obj, value)
    702             # we explicitly compare silent to True just in case the equality
    703             # comparison above returns something other than True/False
--> 704             obj._notify_trait(self.name, old_value, new_value)
    705 
    706     def __set__(self, obj, value):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
   1372 
   1373     def _notify_trait(self, name, old_value, new_value):
-> 1374         self.notify_change(
   1375             Bunch(
   1376                 name=name,

/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change)
    692                 # Send new state to front-end
    693                 self.send_state(key=name)
--> 694         super(Widget, self).notify_change(change)
    695 
    696     def __repr__(self):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in notify_change(self, change)
   1384     def notify_change(self, change):
   1385         """Notify observers of a change event"""
-> 1386         return self._notify_observers(change)
   1387 
   1388     def _notify_observers(self, event):

/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py in _notify_observers(self, event)
   1429                 c = getattr(self, c.name)
   1430 
-> 1431             c(event)
   1432 
   1433     def _add_notifiers(self, handler, name, type):

/opt/conda/lib/python3.9/site-packages/optimade_client/query_filter.py in _sort(self, change)
    272         sort = change["new"]
    273         self.sorting = sort
--> 274         self.retrieve_data({})
    275 
    276     def freeze(self):

/opt/conda/lib/python3.9/site-packages/optimade_client/query_filter.py in retrieve_data(self, _)
    603             self.structure_drop.reset()
    604             self.structure_page_chooser.reset()
--> 605             raise QueryError(f"Bad stuff happened: {traceback.format_exc()}") from exc
    606 
    607         finally:

QueryError: 
QueryError
  Message: Bad stuff happened: Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/site-packages/optimade_client/query_filter.py", line 580, in retrieve_data
    self._update_structures(response["data"])
  File "/opt/conda/lib/python3.9/site-packages/optimade_client/query_filter.py", line 552, in _update_structures
    self.structure_drop.set_options(structures)
  File "/opt/conda/lib/python3.9/site-packages/optimade_client/subwidgets/results.py", line 40, in set_options
    self.index = index
  File "/opt/conda/lib/python3.9/contextlib.py", line 126, in __exit__
    next(self.gen)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1371, in hold_trait_notifications
    self.notify_change(change)
  File "/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py", line 694, in notify_change
    super(Widget, self).notify_change(change)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1386, in notify_change
    return self._notify_observers(change)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1431, in _notify_observers
    c(event)
  File "/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget_selection.py", line 235, in _propagate_index
    self.value = value
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 715, in __set__
    self.set(obj, value)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 704, in set
    obj._notify_trait(self.name, old_value, new_value)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1374, in _notify_trait
    self.notify_change(
  File "/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py", line 694, in notify_change
    super(Widget, self).notify_change(change)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1386, in notify_change
    return self._notify_observers(change)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1431, in _notify_observers
    c(event)
  File "/opt/conda/lib/python3.9/site-packages/optimade_client/query_filter.py", line 208, in _on_structure_select
    self.structure = chosen_structure["structure"]
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 715, in __set__
    self.set(obj, value)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 704, in set
    obj._notify_trait(self.name, old_value, new_value)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1374, in _notify_trait
    self.notify_change(
  File "/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py", line 694, in notify_change
    super(Widget, self).notify_change(change)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1386, in notify_change
    return self._notify_observers(change)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1431, in _notify_observers
    c(event)
  File "/opt/conda/lib/python3.9/site-packages/aiidalab_widgets_base/databases.py", line 203, in _update_structure
    self.structure = (
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 715, in __set__
    self.set(obj, value)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 704, in set
    obj._notify_trait(self.name, old_value, new_value)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1374, in _notify_trait
    self.notify_change(
  File "/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py", line 694, in notify_change
    super(Widget, self).notify_change(change)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1386, in notify_change
    return self._notify_observers(change)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1431, in _notify_observers
    c(event)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 452, in _update
    setattr(self.target[0], self.target[1], self._transform(change.new))
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 715, in __set__
    self.set(obj, value)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 704, in set
    obj._notify_trait(self.name, old_value, new_value)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1374, in _notify_trait
    self.notify_change(
  File "/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py", line 694, in notify_change
    super(Widget, self).notify_change(change)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1386, in notify_change
    return self._notify_observers(change)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1431, in _notify_observers
    c(event)
  File "/opt/conda/lib/python3.9/site-packages/aiidalab_widgets_base/structures.py", line 315, in _observe_input_structure
    self.structure = change["new"]
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 715, in __set__
    self.set(obj, value)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 704, in set
    obj._notify_trait(self.name, old_value, new_value)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1374, in _notify_trait
    self.notify_change(
  File "/opt/conda/lib/python3.9/site-packages/ipywidgets/widgets/widget.py", line 694, in notify_change
    super(Widget, self).notify_change(change)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1386, in notify_change
    return self._notify_observers(change)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 1431, in _notify_observers
    c(event)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/traitlets.py", line 381, in _update_source
    raise TraitError(
traitlets.traitlets.TraitError: Broken link <traitlets.traitlets.link object at 0x7f7e1ca08880>: the target value changed while updating the source.

  Remove target: False
@unkcpz unkcpz added the bug Something isn't working label Oct 22, 2023
@unkcpz unkcpz added this to the v2023.10.0 milestone Oct 22, 2023
@superstar54
Copy link
Member

It seems that the structure is set in a loop. I will fix it asap.

@unkcpz
Copy link
Member Author

unkcpz commented Oct 23, 2023

Thanks! When I look and input_structure and confirm_structure I start to think using UUID as a trait is better, otherwise the structure changed and the "DbNode persistent error" shows up in a theading. I noticed that after I turned the warning to error in pytest in #519.
If you think it is good, please also make this change otherwise leave it to #519.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants