From efbedabb1ad17740bdea1aea3bb1f38ac748c086 Mon Sep 17 00:00:00 2001 From: Andres Ortega-Guerrero <34098967+AndresOrtegaGuerrero@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:31:32 +0100 Subject: [PATCH] Revert "modifications to the EditStructureData Widgets (#956)" This reverts commit 9cebb5267c7f78c4780c91e07d935db7cc2f2529. --- src/aiidalab_qe/common/widgets.py | 40 ++++--------------------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/src/aiidalab_qe/common/widgets.py b/src/aiidalab_qe/common/widgets.py index 51e2536eb..b42301083 100644 --- a/src/aiidalab_qe/common/widgets.py +++ b/src/aiidalab_qe/common/widgets.py @@ -440,11 +440,7 @@ def __init__(self, title="", **kwargs): self._status_message = StatusHTML() self.atom_selection = ipw.Text( - placeholder="e.g. 1..5 8 10", - description="Index of atoms", - value="", - style={"description_width": "100px"}, - layout={"width": "initial"}, + description="Index of atoms", value="", layout={"width": "initial"} ) self.from_selection = ipw.Button(description="From selection") self.from_selection.on_click(self._from_selection) @@ -482,10 +478,6 @@ def __init__(self, title="", **kwargs): button_style="primary", layout={"width": "100px"}, ) - self.scroll_note = ipw.HTML( - value="
Note: The table is scrollable.
", - layout={"visibility": "hidden"}, - ) self.tag_display = ipw.Output() self.add_tags.on_click(self._add_tags) self.reset_tags.on_click(self._reset_tags) @@ -499,22 +491,7 @@ def __init__(self, title="", **kwargs): super().__init__( children=[ ipw.HTML( - "Set custom tags for atoms", - ), - ipw.HTML( - """ -
- These are used to distinguish atoms of the same chemical element.
- For example, they can be used to assign different initial magnetization values for antiferromagnetic systems.
-
NOTE:
-Select the periodicity of your system.
@@ -554,18 +530,14 @@ def _display_table(self, _=None): current_tags = self.structure.get_tags() chemichal_symbols = self.structure.get_chemical_symbols() - if ( - selection - and (min(selection) >= 0) - and (max(selection) <= (len(self.structure) - 1)) - ): + if selection and (max(selection) <= (len(self.structure) - 1)): table_data = [] for index in selection: tag = current_tags[index] symbol = chemichal_symbols[index] if tag == 0: tag = "" - table_data.append([f"{index+ 1}", f"{symbol}", f"{tag}"]) + table_data.append([f"{index}", f"{symbol}", f"{tag}"]) # Create an HTML table table_html = "