aiidalab_widgets_base package¶
Subpackages¶
Submodules¶
aiidalab_widgets_base.bug_report module¶
Provide more user friendly error messages and automated reporting.
Authors:
Carl Simon Adorf <simon.adorf@epfl.ch>
- aiidalab_widgets_base.bug_report._convert_ansi_codes_to_html(msg)[source]¶
Convert any ANSI codes (e.g. color codes) into HTML.
- aiidalab_widgets_base.bug_report._format_truncated_traceback(traceback, max_num_chars=2000)[source]¶
Truncate the traceback to the given character length.
- aiidalab_widgets_base.bug_report._strip_ansi_codes(msg)[source]¶
Remove any ANSI codes (e.g. color codes).
- aiidalab_widgets_base.bug_report.install_create_github_issue_exception_handler(output, url, labels=None)[source]¶
Install a GitHub bug report exception handler.
After installing this handler, kernel exception will show a generic error message to the user, with the option to file an automatic bug report at the given URL.
aiidalab_widgets_base.codes module¶
Module to manage AiiDA codes.
- class aiidalab_widgets_base.codes.AiiDACodeSetup(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Class that allows to setup AiiDA code
- __module__ = 'aiidalab_widgets_base.codes'¶
- _trait_default_generators = {}¶
- _validate_input_plugin¶
- append_text¶
A trait for unicode strings.
- computer¶
A trait for unicode strings.
- description¶
A trait for unicode strings.
- input_plugin¶
A trait for unicode strings.
- label¶
A trait for unicode strings.
- prepend_text¶
A trait for unicode strings.
- remote_abs_path¶
A trait for unicode strings.
- class aiidalab_widgets_base.codes.CodeDropdown(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Code selection widget. Attributes:
selected_code(Unicode or Code): Trait that points to the selected Code instance. It can be set either to an AiiDA Code instance or to a code label (will automatically be replaced by the corresponding Code instance). It is linked to the ‘value’ trait of the self.dropdown widget.
codes(Dict): Trait that contains a dictionary (label => Code instance) for all codes found in the AiiDA database for the selected plugin. It is linked to the ‘options’ trait of the self.dropdown widget.
allow_hidden_codes(Bool): Trait that defines whether to show hidden codes or not.
allow_disabled_computers(Bool): Trait that defines whether to show codes on disabled computers.
- __init__(input_plugin, description='Select code:', path_to_root='../', **kwargs)[source]¶
Dropdown for Codes for one input plugin.
input_plugin (str): Input plugin of codes to show.
description (str): Description to display before the dropdown.
- __module__ = 'aiidalab_widgets_base.codes'¶
- _trait_default_generators = {}¶
- _validate_selected_code¶
- allow_disabled_computers¶
A boolean (True, False) trait.
A boolean (True, False) trait.
- codes¶
An instance of a Python dict.
One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.
Changed in version 5.0: Added key_trait for validating dict keys.
Changed in version 5.0: Deprecated ambiguous
trait
,traits
args in favor ofvalue_trait
,per_key_traits
.
- refresh(_=None)[source]¶
Refresh available codes.
The job of this function is to look in AiiDA database, find available codes and put them in the dropdown attribute.
- selected_code¶
A trait type representing a Union type.
aiidalab_widgets_base.computers module¶
All functionality needed to setup a computer.
- class aiidalab_widgets_base.computers.AiidaComputerSetup(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Inform AiiDA about a computer.
- __module__ = 'aiidalab_widgets_base.computers'¶
- _trait_default_generators = {}¶
- _validate_mpiprocs_per_machine¶
- _validate_safe_interval¶
- append_text¶
A trait for unicode strings.
- description¶
A trait for unicode strings.
- hostname¶
A trait for unicode strings.
- label¶
A trait for unicode strings.
- mpiprocs_per_machine¶
A trait type representing a Union type.
- mpirun_command¶
A trait for unicode strings.
- prepend_text¶
A trait for unicode strings.
- safe_interval¶
A trait type representing a Union type.
- scheduler¶
A trait for unicode strings.
- transport¶
A trait for unicode strings.
- work_dir¶
A trait for unicode strings.
- class aiidalab_widgets_base.computers.ComputerDropdown(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Widget to select a configured computer.
- Attributes:
- selected_computer(Unicode or Computer): Trait that points to the selected Computer instance.
It can be set either to an AiiDA Computer instance or to a computer label (will automatically be replaced by the corresponding Computer instance). It is linked to the ‘value’ trait of self._dropdown widget.
computers(Dict): Trait that contains a dictionary (label => Computer instance) for all computers found in the AiiDA database. It is linked to the ‘options’ trait of self._dropdown widget.
allow_select_disabled(Bool): Trait that defines whether to show disabled computers.
- __init__(description='Select computer:', path_to_root='../', **kwargs)[source]¶
Dropdown for configured AiiDA Computers.
description (str): Text to display before dropdown.
path_to_root (str): Path to the app’s root folder.
- __module__ = 'aiidalab_widgets_base.computers'¶
- _trait_default_generators = {}¶
- _validate_selected_computer¶
- allow_select_disabled¶
A boolean (True, False) trait.
- computers¶
An instance of a Python dict.
One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.
Changed in version 5.0: Added key_trait for validating dict keys.
Changed in version 5.0: Deprecated ambiguous
trait
,traits
args in favor ofvalue_trait
,per_key_traits
.
- selected_computer¶
A trait type representing a Union type.
- class aiidalab_widgets_base.computers.SshComputerSetup(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Setup password-free access to a computer.
- __module__ = 'aiidalab_widgets_base.computers'¶
- property __password¶
Returning the password and immediately destroying it
- property __private_key¶
unwrap private key file and setting filename and file content
- property __proxy_password¶
Returning the password and immediately destroying it
- static _add_private_key(private_key_fname, private_key_content)[source]¶
param private_key_fname: string param private_key_content: bytes
- _observe_proxy_hostname¶
- _observe_proxy_username¶
- _on_setup_ssh(mode, change)[source]¶
ATTENTION: modifying the order of operations in this function can lead to unexpected problems
- static _send_pubkey(hostname, username, password, proxycmd='')[source]¶
Send a publick key to a remote host.
- _trait_default_generators = {}¶
- _validate_port¶
- _write_ssh_config(proxycmd='', private_key_abs_fname=None)[source]¶
Put host information into the config file.
- hostname¶
A trait for unicode strings.
- on_use_diff_proxy_username_change(change)[source]¶
If using different username for proxy check-box is clicked.
- port¶
A trait type representing a Union type.
- proxy_hostname¶
A trait for unicode strings.
- proxy_username¶
A trait for unicode strings.
- setup_counter¶
An int trait.
- use_proxy¶
A boolean (True, False) trait.
- username¶
A trait for unicode strings.
aiidalab_widgets_base.databases module¶
Widgets that allow to query online databases.
- class aiidalab_widgets_base.databases.CodQueryWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Query structures in Crystallography Open Database (COD) Useful class members: :ivar structure(Atoms): trait that contains the selected structure, None if structure is not selected.
- __module__ = 'aiidalab_widgets_base.databases'¶
- _default_structure¶
- _trait_default_generators = {'structure': <traitlets.traitlets.DefaultHandler object>}¶
- structure¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.databases.CodeDatabaseWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.HBox
Extract the setup of a known computer from the AiiDA code registry.
- __module__ = 'aiidalab_widgets_base.databases'¶
- _trait_default_generators = {}¶
- append_text¶
A trait for unicode strings.
- computer¶
A trait for unicode strings.
- description¶
A trait for unicode strings.
- input_plugin¶
A trait for unicode strings.
- label¶
A trait for unicode strings.
- on_computer¶
A boolean (True, False) trait.
- prepend_text¶
A trait for unicode strings.
- remote_abs_path¶
A trait for unicode strings.
- class aiidalab_widgets_base.databases.ComputerDatabaseWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.HBox
Extract the setup of a known computer from the AiiDA code registry.
- __module__ = 'aiidalab_widgets_base.databases'¶
- _observe_proxy_command¶
- _trait_default_generators = {}¶
- allow_agent¶
A boolean (True, False) trait.
- append_text¶
A trait for unicode strings.
- description¶
A trait for unicode strings.
- hostname¶
A trait for unicode strings.
- label¶
A trait for unicode strings.
- mpiprocs_per_machine¶
An int trait.
- mpirun_command¶
A trait for unicode strings.
- num_cores_per_mpiproc¶
An int trait.
- port¶
An int trait.
- prepend_text¶
A trait for unicode strings.
- proxy_command¶
A trait for unicode strings.
- proxy_hostname¶
A trait for unicode strings.
- proxy_username¶
A trait for unicode strings.
- queue_name¶
A trait for unicode strings.
- safe_interval¶
A float trait.
- scheduler¶
A trait for unicode strings.
- shebang¶
A trait for unicode strings.
- transport¶
A trait for unicode strings.
- update_settings(_=None)[source]¶
Read settings from the YAML files and populate self.database with them.
- use_login_shell¶
A boolean (True, False) trait.
- work_dir¶
A trait for unicode strings.
- class aiidalab_widgets_base.databases.OptimadeQueryWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
AiiDAlab-specific OPTIMADE Query widget
Useful as a widget to integrate with the
aiidalab_widgets_base.structures.StructureManagerWidget
, embedded into applications.NOTE: embedded for OptimadeQueryFilterWidget was introduced in optimade-client version 2020.11.5.
- Parameters
embedded (bool) – Whether or not to show extra database and provider information. When set to True, the extra information will be hidden, this is useful in situations where the widget is used in a Tab or similar, e.g., for the
aiidalab_widgets_base.structures.StructureManagerWidget
.title (str) – Title used for Tab header if employed in
aiidalab_widgets_base.structures.StructureManagerWidget
.
- __init__(embedded: bool = True, title: Optional[str] = None, **kwargs) None [source]¶
Public constructor
- __module__ = 'aiidalab_widgets_base.databases'¶
- _database_grouping = {'Materials Cloud': {'General': ['curated-cofs'], 'Projects': ['2dstructures', '2dtopo', 'pyrene-mofs', 'scdm', 'sssp', 'stoceriaitf', 'tc-applicability', 'threedd']}}¶
- _disable_providers = ['cod', 'tcod', 'nmd', 'oqmd', 'aflow', 'matcloud', 'mpds', 'necro', 'jarvis']¶
- _skip_databases = {'Materials Cloud': ['optimade-sample', 'li-ion-conductors']}¶
- _trait_default_generators = {}¶
- structure¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
aiidalab_widgets_base.dicts module¶
aiidalab_widgets_base.elns module¶
- class aiidalab_widgets_base.elns.ElnConfigureWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
- __module__ = 'aiidalab_widgets_base.elns'¶
- _trait_default_generators = {}¶
- class aiidalab_widgets_base.elns.ElnExportWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
- __module__ = 'aiidalab_widgets_base.elns'¶
- _observe_node¶
- _trait_default_generators = {}¶
- node¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.elns.ElnImportWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
- __module__ = 'aiidalab_widgets_base.elns'¶
- _trait_default_generators = {}¶
- node¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
aiidalab_widgets_base.export module¶
Widgets to manage AiiDA export.
aiidalab_widgets_base.misc module¶
Some useful classes used acrross the repository.
- class aiidalab_widgets_base.misc.CopyToClipboardButton(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_button.Button
Button to copy text to clipboard.
- __module__ = 'aiidalab_widgets_base.misc'¶
- _trait_default_generators = {}¶
- value¶
A trait for unicode strings.
- class aiidalab_widgets_base.misc.ReversePolishNotation(operators, additional_operands=None)[source]¶
Bases:
object
Class defining operations for RPN conversion
- __dict__ = mappingproxy({'__module__': 'aiidalab_widgets_base.misc', '__doc__': 'Class defining operations for RPN conversion', '__init__': <function ReversePolishNotation.__init__>, 'haslessorequalpriority': <function ReversePolishNotation.haslessorequalpriority>, 'is_operator': <function ReversePolishNotation.is_operator>, 'isopenparenthesis': <staticmethod object>, 'iscloseparenthesis': <staticmethod object>, 'convert': <function ReversePolishNotation.convert>, 'parse_infix_notation': <staticmethod object>, 'execute': <function ReversePolishNotation.execute>, '__dict__': <attribute '__dict__' of 'ReversePolishNotation' objects>, '__weakref__': <attribute '__weakref__' of 'ReversePolishNotation' objects>, '__annotations__': {}})¶
- __module__ = 'aiidalab_widgets_base.misc'¶
- __weakref__¶
list of weak references to the object (if defined)
aiidalab_widgets_base.nodes module¶
Widgets to work with AiiDA nodes.
- class aiidalab_widgets_base.nodes.AiidaNodeTreeNode(**kwargs)[source]¶
Bases:
ipytree.tree.Node
- __module__ = 'aiidalab_widgets_base.nodes'¶
- _default_openend¶
- _trait_default_generators = {'opened': <traitlets.traitlets.DefaultHandler object>}¶
- class aiidalab_widgets_base.nodes.AiidaOutputsTreeNode(**kwargs)[source]¶
Bases:
ipytree.tree.Node
- __module__ = 'aiidalab_widgets_base.nodes'¶
- _trait_default_generators = {}¶
- disabled¶
A boolean (True, False) trait.
- icon¶
A trait for unicode strings.
- class aiidalab_widgets_base.nodes.AiidaProcessNodeTreeNode(**kwargs)[source]¶
Bases:
aiidalab_widgets_base.nodes.AiidaNodeTreeNode
- __module__ = 'aiidalab_widgets_base.nodes'¶
- _trait_default_generators = {}¶
- class aiidalab_widgets_base.nodes.CalcFunctionTreeNode(**kwargs)[source]¶
Bases:
aiidalab_widgets_base.nodes.AiidaProcessNodeTreeNode
- __module__ = 'aiidalab_widgets_base.nodes'¶
- _trait_default_generators = {}¶
- icon¶
A trait for unicode strings.
- class aiidalab_widgets_base.nodes.CalcJobTreeNode(**kwargs)[source]¶
Bases:
aiidalab_widgets_base.nodes.AiidaProcessNodeTreeNode
- __module__ = 'aiidalab_widgets_base.nodes'¶
- _trait_default_generators = {}¶
- icon¶
A trait for unicode strings.
- class aiidalab_widgets_base.nodes.NodesTreeWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_output.Output
A tree widget for the structured representation of a nodes graph.
- NODE_TYPE = {<class 'aiida.orm.nodes.process.workflow.workchain.WorkChainNode'>: <class 'aiidalab_widgets_base.nodes.WorkChainProcessTreeNode'>, <class 'aiida.orm.nodes.process.calculation.calcfunction.CalcFunctionNode'>: <class 'aiidalab_widgets_base.nodes.CalcFunctionTreeNode'>, <class 'aiida.orm.nodes.process.calculation.calcjob.CalcJobNode'>: <class 'aiidalab_widgets_base.nodes.CalcJobTreeNode'>}¶
- PROCESS_STATE_STYLE = {<ProcessState.EXCEPTED: 'excepted'>: 'danger', <ProcessState.FINISHED: 'finished'>: 'success', <ProcessState.KILLED: 'killed'>: 'warning', <ProcessState.RUNNING: 'running'>: 'info', <ProcessState.WAITING: 'waiting'>: 'info'}¶
- PROCESS_STATE_STYLE_DEFAULT = 'default'¶
- __module__ = 'aiidalab_widgets_base.nodes'¶
- _convert_to_tree_nodes(old_nodes, new_nodes)[source]¶
Convert nodes into tree nodes while re-using already converted nodes.
- _observe_nodes¶
- _trait_default_generators = {}¶
- nodes¶
An instance of a Python tuple.
- selected_nodes¶
An instance of a Python tuple.
- class aiidalab_widgets_base.nodes.OpenAiidaNodeInAppWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
- __module__ = 'aiidalab_widgets_base.nodes'¶
- _observe_node¶
- _trait_default_generators = {}¶
- node¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.nodes.UnknownTypeTreeNode(**kwargs)[source]¶
Bases:
aiidalab_widgets_base.nodes.AiidaNodeTreeNode
- __module__ = 'aiidalab_widgets_base.nodes'¶
- _trait_default_generators = {}¶
- icon¶
A trait for unicode strings.
- class aiidalab_widgets_base.nodes.WorkChainProcessTreeNode(**kwargs)[source]¶
Bases:
aiidalab_widgets_base.nodes.AiidaProcessNodeTreeNode
- __module__ = 'aiidalab_widgets_base.nodes'¶
- _trait_default_generators = {}¶
- icon¶
A trait for unicode strings.
- class aiidalab_widgets_base.nodes._AppIcon(app, path_to_root, node)[source]¶
Bases:
object
- __dict__ = mappingproxy({'__module__': 'aiidalab_widgets_base.nodes', '__init__': <function _AppIcon.__init__>, 'to_html_string': <function _AppIcon.to_html_string>, '__dict__': <attribute '__dict__' of '_AppIcon' objects>, '__weakref__': <attribute '__weakref__' of '_AppIcon' objects>, '__doc__': None, '__annotations__': {}})¶
- __module__ = 'aiidalab_widgets_base.nodes'¶
- __weakref__¶
list of weak references to the object (if defined)
aiidalab_widgets_base.process module¶
Widgets to work with processes.
- class aiidalab_widgets_base.process.CalcJobOutputWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_string.Textarea
Output of a calculation.
- __module__ = 'aiidalab_widgets_base.process'¶
- _change_calculation¶
- _trait_default_generators = {}¶
- calculation¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- update()[source]¶
Update the displayed output and scroll to its end.
NOTE: when this widgets is called by ProcessFollowerWidget in non-blocking manner the auto-scrolling won’t work. There used to be a function for the Textarea widget, but it didn’t work properly and got removed. For more information please visit: https://github.com/jupyter-widgets/ipywidgets/issues/1815
- class aiidalab_widgets_base.process.ProcessCallStackWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_string.HTML
Widget that shows process call stack.
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.process.ProcessFollowerWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
A Widget that follows a process until finished.
- __init__(process=None, followers=None, update_interval=0.1, path_to_root='../', **kwargs)[source]¶
Initiate all the followers.
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.process.ProcessInputsWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Widget to select and show process inputs.
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.process.ProcessListWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
List of AiiDA processes.
past_days (int): Sumulations that were submitted in the last past_days.
incoming_node (int, str, Node): Trait that takes node id or uuid and returns the node that must be among the input nodes of the process of interest.
outgoing_node (int, str, Node): Trait that takes node id or uuid and returns the node that must be among the output nodes of the process of interest.
process_states (list): List of allowed process states.
process_label (str): Show process states of type process_label.
description_contains (str): string that should be present in the description of a process node.
- __module__ = 'aiidalab_widgets_base.process'¶
- _default_process_label¶
- _trait_default_generators = {'process_label': <traitlets.traitlets.DefaultHandler object>}¶
- _validate_incoming_node¶
- _validate_outgoing_node¶
- _validate_process_label¶
- description_contains¶
A trait for unicode strings.
- incoming_node¶
A trait type representing a Union type.
- outgoing_node¶
A trait type representing a Union type.
- past_days¶
An int trait.
- process_label¶
A trait for unicode strings.
- process_states¶
An instance of a Python list.
- class aiidalab_widgets_base.process.ProcessMonitor(**kwargs)[source]¶
Bases:
traitlets.traitlets.HasTraits
Monitor a process and execute callback functions at specified intervals.
- __module__ = 'aiidalab_widgets_base.process'¶
- _observe_process¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.process.ProcessNodesTreeWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
A tree widget for the structured representation of a process graph.
- __module__ = 'aiidalab_widgets_base.process'¶
- _observe_process¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- selected_nodes¶
An instance of a Python tuple.
- class aiidalab_widgets_base.process.ProcessOutputsWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Widget to select and show process outputs.
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.process.ProcessReportWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_string.HTML
Widget that shows process report.
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.process.ProgressBarWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
A bar showing the proggress of a process.
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- property current_state¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.process.RunningCalcJobOutputWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Show an output of selected running child calculation.
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.process.SubmitButtonWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Submit button class that creates submit button jupyter widget.
- __init__(process_class, inputs_generator=None, input_dictionary_function=None, description='Submit', disable_after_submit=True, append_output=False, **kwargs)[source]¶
Submit Button widget.
process_class (Process): Process class to submit.
inputs_generator (func): Function that returns inputs dictionary or inputs builder.
input_dictionary_function (DEPRECATED): Function that generates input parameters dictionary.
description (str): Description written on the submission button.
disable_after_submit (bool): Whether to disable the button after the process was submitted.
append_output (bool): Whether to clear widget output for each subsequent submission.
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
aiidalab_widgets_base.structures module¶
Module to provide functionality to import structures.
- class aiidalab_widgets_base.structures.BasicStructureEditor(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Widget that allows for the basic structure editing.
- __module__ = 'aiidalab_widgets_base.structures'¶
- _trait_default_generators = {}¶
- property action_vector¶
Define the action vector.
- camera_orientation¶
An instance of a Python list.
- def_perpendicular_to_screen(_=None)[source]¶
Define a normalized vector perpendicular to the screen.
- mirror(_=None, norm=None, point=None)[source]¶
Mirror atoms on the plane perpendicular to the action vector.
- selection¶
An instance of a Python list.
- structure¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.structures.SmilesWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Conver SMILES into 3D structure.
- SPINNER = '<i class="fa fa-spinner fa-pulse" style="color:red;" ></i>'¶
- __module__ = 'aiidalab_widgets_base.structures'¶
- _default_structure¶
- _pybel_opt(smiles, steps)[source]¶
Optimize a molecule using force field and pybel (needed for complex SMILES).
- _rdkit_opt(smiles, steps)[source]¶
Optimize a molecule using force field and rdkit (needed for complex SMILES).
- _trait_default_generators = {'structure': <traitlets.traitlets.DefaultHandler object>}¶
- structure¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.structures.StructureBrowserWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Class to query for structures stored in the AiiDA database.
- __module__ = 'aiidalab_widgets_base.structures'¶
- _trait_default_generators = {}¶
- structure¶
A trait type representing a Union type.
- class aiidalab_widgets_base.structures.StructureExamplesWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Class to provide example structures for selection.
- __module__ = 'aiidalab_widgets_base.structures'¶
- _default_structure¶
- _trait_default_generators = {'structure': <traitlets.traitlets.DefaultHandler object>}¶
- structure¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.structures.StructureManagerWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Upload a structure and store it in AiiDA database.
- Attributes:
structure(Atoms): trait that contains the selected structure. ‘None’ if no structure is selected. structure_node(StructureData, CifData): trait that contains AiiDA structure object node_class(str): trait that contains structure_node type (as string).
- SUPPORTED_DATA_FORMATS = {'CifData': 'cif', 'StructureData': 'structure'}¶
- __init__(importers, viewer=None, editors=None, storable=True, node_class=None, **kwargs)[source]¶
- Arguments:
- importers(list): list of tuples each containing the displayed name of importer and the
importer object. Each object should contain ‘structure’ trait pointing to the imported structure. The trait will be linked to ‘structure’ trait of this class.
storable(bool): Whether to provide Store button (together with Store format)
- node_class(str): AiiDA node class for storing the structure.
Possible values: ‘StructureData’, ‘CifData’ or None (let the user decide). Note: If your workflows require a specific node class, better fix it here.
- __module__ = 'aiidalab_widgets_base.structures'¶
- _change_structure_node¶
- _convert_to_structure_node(structure)[source]¶
Convert structure of any type to the StructureNode object.
- _default_node_class¶
- _observe_input_structure¶
- _observe_structure_node¶
- _structure_changed¶
- _sync_structure_node()[source]¶
Synchronize the structure_node trait using the currently provided info.
- _trait_default_generators = {}¶
- input_structure¶
A trait type representing a Union type.
- node_class¶
A trait for unicode strings.
- structure¶
A trait type representing a Union type.
- structure_node¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.structures.StructureUploadWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Class that allows to upload structures from user’s computer.
- __module__ = 'aiidalab_widgets_base.structures'¶
- _trait_default_generators = {}¶
- _validate_and_fix_ase_cell(ase_structure, vacuum_ang=10.0)[source]¶
Checks if the ase Atoms object has a cell set, otherwise sets it to bounding box plus specified “vacuum” space
- structure¶
A trait type representing a Union type.
aiidalab_widgets_base.viewers module¶
Jupyter viewers for AiiDA data objects.
- class aiidalab_widgets_base.viewers.AiidaNodeViewWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
- __module__ = 'aiidalab_widgets_base.viewers'¶
- _observe_node¶
- _trait_default_generators = {}¶
- node¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.viewers.BandsDataViewer(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Viewer class for BandsData object.
- Parameters
bands (BandsData) – BandsData object to be viewed
- __module__ = 'aiidalab_widgets_base.viewers'¶
- _trait_default_generators = {}¶
- class aiidalab_widgets_base.viewers.DictViewer(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
- __module__ = 'aiidalab_widgets_base.viewers'¶
- _trait_default_generators = {}¶
- class aiidalab_widgets_base.viewers.FolderDataViewer(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Viewer class for FolderData object.
- Parameters
folder (FolderData) – FolderData object to be viewed
downloadable (bool) – If True, add link/button to download the content of the selected file in the folder
- __module__ = 'aiidalab_widgets_base.viewers'¶
- _trait_default_generators = {}¶
- class aiidalab_widgets_base.viewers.StructureDataViewer(**kwargs)[source]¶
Bases:
aiidalab_widgets_base.viewers._StructureDataBaseViewer
Viewer class for AiiDA structure objects.
- Attributes:
structure (Atoms, StructureData, CifData): Trait that contains a structure object, which was initially provided to the viewer. It can be either directly set to an ASE Atoms object or to AiiDA structure object containing get_ase() method.
displayed_structure (Atoms): Trait that contains a structure object that is currently displayed (super cell, for example). The trait is generated automatically and can’t be set outside of the class.
- __module__ = 'aiidalab_widgets_base.viewers'¶
- _observe_selection_2¶
- _observe_selection_adv¶
- _observe_structure¶
- _trait_default_generators = {}¶
- _update_structure_viewer¶
- _valid_structure¶
- displayed_structure¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- pk¶
An int trait.
- repeat¶
- structure¶
A trait type representing a Union type.
- class aiidalab_widgets_base.viewers._StructureDataBaseViewer(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Base viewer class for AiiDA structure or trajectory objects.
- Parameters
configure_view (bool) – If True, add configuration tabs
- DEFAULT_SELECTION_COLOR = 'green'¶
- DEFAULT_SELECTION_OPACITY = 0.2¶
- DEFAULT_SELECTION_RADIUS = 6¶
- __module__ = 'aiidalab_widgets_base.viewers'¶
- _default_selection¶
- _default_supercell¶
- _observe_cell¶
- _observe_selection¶
- _trait_default_generators = {'selection': <traitlets.traitlets.DefaultHandler object>, 'supercell': <traitlets.traitlets.DefaultHandler object>}¶
- _validate_selection¶
- cell¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- highlight_atoms(vis_list, color='green', size=6, opacity=0.2)[source]¶
Highlighting atoms according to the provided list.
- selection¶
An instance of a Python list.
- selection_adv¶
A trait for unicode strings.
- supercell¶
An instance of a Python list.
- property thumbnail¶
aiidalab_widgets_base.wizard module¶
The wizard application allows the implication of a Wizard-like GUI.
Authors:
Carl Simon Adorf <simon.adorf@epfl.ch>
- class aiidalab_widgets_base.wizard.WizardAppWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
- ICONS = {<State.INIT: 0>: '○', <State.READY: 2>: '◎', <State.CONFIGURED: 1>: '●', <State.ACTIVE: 3>: ['◜', '◝', '◞', '◟'], <State.SUCCESS: 4>: '✓', <State.FAIL: -1>: '×'}¶
- ICON_SEPARATOR = '\u2000'¶
- __module__ = 'aiidalab_widgets_base.wizard'¶
- _consider_auto_advance(_=None)[source]¶
Determine whether the app should automatically advance to the next step.
This is performed whenever the current step is within the SUCCESS state and has the auto_advance attribute set to True.
- _observe_selected_index¶
- _trait_default_generators = {}¶
- classmethod icons()[source]¶
Return the icon set and return animated icons based on the current time stamp.
- reset(step=0)[source]¶
Reset the app up to the given step.
For example, with step=0 (the default), the whole app is reset. With step=1, all but the first step are reset.
- selected_index¶
An int trait.
- class aiidalab_widgets_base.wizard.WizardAppWidgetStep(**kwargs)[source]¶
Bases:
traitlets.traitlets.HasTraits
One step of a WizardAppWidget.
- class State(value)[source]¶
Bases:
enum.Enum
Each step is always in one specific state.
The state is used to determine:
how the step is visually presented to the user, and
whether the next step is accessible (i.e. reached the SUCCESS state).
App developers are encouraged to use the step states to couple application logic and interface. In general, all widget changes should trigger a re-evaluation of the step state, and states also determine whether certain widgets are enabled or disabled.
A step can be in one of the following states:
INIT: The initial state, usually all widgets disabled. READY: The step (widget) is ready for user input (some or all widgets enabled). CONFIGURED: The step is in a consistent configuration awaiting confirmation. ACTIVE: The step is carrying out a runtime operation. SUCCESS: A configuration has been confirmed / a runtime operation successfully finished. FAIL: A runtime operation has failed in an unrecoverable way.
Not all steps must implement all states, for example:
the first step does not need an INIT state
a step without runtime process should not have an ACTIVE or FAIL state
a “review & confirm” step does not require a READY state.
a step without configuration options (e.g. pure “review & confirm” step)
Important: The next step is only accessible if the current step is within the SUCCESS state!
- ACTIVE = 3¶
- CONFIGURED = 1¶
- FAIL = -1¶
- INIT = 0¶
- READY = 2¶
- SUCCESS = 4¶
- __module__ = 'aiidalab_widgets_base.wizard'¶
- __module__ = 'aiidalab_widgets_base.wizard'¶
- _trait_default_generators = {}¶
- auto_advance¶
A boolean (True, False) trait.
- state¶
Use a Enum class as model for the data type description. Note that if no default-value is provided, the first enum-value is used as default-value.
# -- SINCE: Python 3.4 (or install backport: pip install enum34) import enum from traitlets import HasTraits, UseEnum class Color(enum.Enum): red = 1 # -- IMPLICIT: default_value blue = 2 green = 3 class MyEntity(HasTraits): color = UseEnum(Color, default_value=Color.blue) entity = MyEntity(color=Color.red) entity.color = Color.green # USE: Enum-value (preferred) entity.color = "green" # USE: name (as string) entity.color = "Color.green" # USE: scoped-name (as string) entity.color = 3 # USE: number (as int) assert entity.color is Color.green
Module contents¶
Reusable widgets for AiiDAlab applications.
- class aiidalab_widgets_base.AiiDACodeSetup(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Class that allows to setup AiiDA code
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.codes'¶
- _trait_default_generators = {}¶
- _validate_input_plugin¶
- append_text¶
A trait for unicode strings.
- computer¶
A trait for unicode strings.
- description¶
A trait for unicode strings.
- input_plugin¶
A trait for unicode strings.
- label¶
A trait for unicode strings.
- prepend_text¶
A trait for unicode strings.
- remote_abs_path¶
A trait for unicode strings.
- class aiidalab_widgets_base.AiidaComputerSetup(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Inform AiiDA about a computer.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.computers'¶
- _trait_default_generators = {}¶
- _validate_mpiprocs_per_machine¶
- _validate_safe_interval¶
- append_text¶
A trait for unicode strings.
- description¶
A trait for unicode strings.
- hostname¶
A trait for unicode strings.
- label¶
A trait for unicode strings.
- mpiprocs_per_machine¶
A trait type representing a Union type.
- mpirun_command¶
A trait for unicode strings.
- prepend_text¶
A trait for unicode strings.
- safe_interval¶
A trait type representing a Union type.
- scheduler¶
A trait for unicode strings.
- transport¶
A trait for unicode strings.
- work_dir¶
A trait for unicode strings.
- class aiidalab_widgets_base.AiidaNodeViewWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.viewers'¶
- _observe_node¶
- _trait_default_generators = {}¶
- node¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.BasicStructureEditor(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Widget that allows for the basic structure editing.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.structures'¶
- _trait_default_generators = {}¶
- property action_vector¶
Define the action vector.
- camera_orientation¶
An instance of a Python list.
- def_perpendicular_to_screen(_=None)[source]¶
Define a normalized vector perpendicular to the screen.
- mirror(_=None, norm=None, point=None)[source]¶
Mirror atoms on the plane perpendicular to the action vector.
- selection¶
An instance of a Python list.
- structure¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.CodQueryWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Query structures in Crystallography Open Database (COD) Useful class members: :ivar structure(Atoms): trait that contains the selected structure, None if structure is not selected.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.databases'¶
- _default_structure¶
- _trait_default_generators = {'structure': <traitlets.traitlets.DefaultHandler object>}¶
- structure¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.CodeDatabaseWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.HBox
Extract the setup of a known computer from the AiiDA code registry.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.databases'¶
- _trait_default_generators = {}¶
- append_text¶
A trait for unicode strings.
- computer¶
A trait for unicode strings.
- description¶
A trait for unicode strings.
- input_plugin¶
A trait for unicode strings.
- label¶
A trait for unicode strings.
- on_computer¶
A boolean (True, False) trait.
- prepend_text¶
A trait for unicode strings.
- remote_abs_path¶
A trait for unicode strings.
- class aiidalab_widgets_base.CodeDropdown(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Code selection widget. Attributes:
selected_code(Unicode or Code): Trait that points to the selected Code instance. It can be set either to an AiiDA Code instance or to a code label (will automatically be replaced by the corresponding Code instance). It is linked to the ‘value’ trait of the self.dropdown widget.
codes(Dict): Trait that contains a dictionary (label => Code instance) for all codes found in the AiiDA database for the selected plugin. It is linked to the ‘options’ trait of the self.dropdown widget.
allow_hidden_codes(Bool): Trait that defines whether to show hidden codes or not.
allow_disabled_computers(Bool): Trait that defines whether to show codes on disabled computers.
- __annotations__ = {}¶
- __init__(input_plugin, description='Select code:', path_to_root='../', **kwargs)[source]¶
Dropdown for Codes for one input plugin.
input_plugin (str): Input plugin of codes to show.
description (str): Description to display before the dropdown.
- __module__ = 'aiidalab_widgets_base.codes'¶
- _trait_default_generators = {}¶
- _validate_selected_code¶
- allow_disabled_computers¶
A boolean (True, False) trait.
A boolean (True, False) trait.
- codes¶
An instance of a Python dict.
One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.
Changed in version 5.0: Added key_trait for validating dict keys.
Changed in version 5.0: Deprecated ambiguous
trait
,traits
args in favor ofvalue_trait
,per_key_traits
.
- refresh(_=None)[source]¶
Refresh available codes.
The job of this function is to look in AiiDA database, find available codes and put them in the dropdown attribute.
- selected_code¶
A trait type representing a Union type.
- class aiidalab_widgets_base.ComputerDatabaseWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.HBox
Extract the setup of a known computer from the AiiDA code registry.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.databases'¶
- _observe_proxy_command¶
- _trait_default_generators = {}¶
- allow_agent¶
A boolean (True, False) trait.
- append_text¶
A trait for unicode strings.
- description¶
A trait for unicode strings.
- hostname¶
A trait for unicode strings.
- label¶
A trait for unicode strings.
- mpiprocs_per_machine¶
An int trait.
- mpirun_command¶
A trait for unicode strings.
- num_cores_per_mpiproc¶
An int trait.
- port¶
An int trait.
- prepend_text¶
A trait for unicode strings.
- proxy_command¶
A trait for unicode strings.
- proxy_hostname¶
A trait for unicode strings.
- proxy_username¶
A trait for unicode strings.
- queue_name¶
A trait for unicode strings.
- safe_interval¶
A float trait.
- scheduler¶
A trait for unicode strings.
- shebang¶
A trait for unicode strings.
- transport¶
A trait for unicode strings.
- update_settings(_=None)[source]¶
Read settings from the YAML files and populate self.database with them.
- use_login_shell¶
A boolean (True, False) trait.
- work_dir¶
A trait for unicode strings.
- class aiidalab_widgets_base.ComputerDropdown(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Widget to select a configured computer.
- Attributes:
- selected_computer(Unicode or Computer): Trait that points to the selected Computer instance.
It can be set either to an AiiDA Computer instance or to a computer label (will automatically be replaced by the corresponding Computer instance). It is linked to the ‘value’ trait of self._dropdown widget.
computers(Dict): Trait that contains a dictionary (label => Computer instance) for all computers found in the AiiDA database. It is linked to the ‘options’ trait of self._dropdown widget.
allow_select_disabled(Bool): Trait that defines whether to show disabled computers.
- __annotations__ = {}¶
- __init__(description='Select computer:', path_to_root='../', **kwargs)[source]¶
Dropdown for configured AiiDA Computers.
description (str): Text to display before dropdown.
path_to_root (str): Path to the app’s root folder.
- __module__ = 'aiidalab_widgets_base.computers'¶
- _trait_default_generators = {}¶
- _validate_selected_computer¶
- allow_select_disabled¶
A boolean (True, False) trait.
- computers¶
An instance of a Python dict.
One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.
Changed in version 5.0: Added key_trait for validating dict keys.
Changed in version 5.0: Deprecated ambiguous
trait
,traits
args in favor ofvalue_trait
,per_key_traits
.
- selected_computer¶
A trait type representing a Union type.
- class aiidalab_widgets_base.ElnConfigureWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.elns'¶
- _trait_default_generators = {}¶
- class aiidalab_widgets_base.ElnExportWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.elns'¶
- _observe_node¶
- _trait_default_generators = {}¶
- node¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.ElnImportWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.elns'¶
- _trait_default_generators = {}¶
- node¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.ExportButtonWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_button.Button
Export Node button.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.export'¶
- _trait_default_generators = {}¶
- class aiidalab_widgets_base.NodesTreeWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_output.Output
A tree widget for the structured representation of a nodes graph.
- NODE_TYPE = {<class 'aiida.orm.nodes.process.workflow.workchain.WorkChainNode'>: <class 'aiidalab_widgets_base.nodes.WorkChainProcessTreeNode'>, <class 'aiida.orm.nodes.process.calculation.calcfunction.CalcFunctionNode'>: <class 'aiidalab_widgets_base.nodes.CalcFunctionTreeNode'>, <class 'aiida.orm.nodes.process.calculation.calcjob.CalcJobNode'>: <class 'aiidalab_widgets_base.nodes.CalcJobTreeNode'>}¶
- PROCESS_STATE_STYLE = {<ProcessState.EXCEPTED: 'excepted'>: 'danger', <ProcessState.FINISHED: 'finished'>: 'success', <ProcessState.KILLED: 'killed'>: 'warning', <ProcessState.RUNNING: 'running'>: 'info', <ProcessState.WAITING: 'waiting'>: 'info'}¶
- PROCESS_STATE_STYLE_DEFAULT = 'default'¶
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.nodes'¶
- _convert_to_tree_nodes(old_nodes, new_nodes)[source]¶
Convert nodes into tree nodes while re-using already converted nodes.
- _observe_nodes¶
- _trait_default_generators = {}¶
- nodes¶
An instance of a Python tuple.
- selected_nodes¶
An instance of a Python tuple.
- class aiidalab_widgets_base.OpenAiidaNodeInAppWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.nodes'¶
- _observe_node¶
- _trait_default_generators = {}¶
- node¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.OptimadeQueryWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
AiiDAlab-specific OPTIMADE Query widget
Useful as a widget to integrate with the
aiidalab_widgets_base.structures.StructureManagerWidget
, embedded into applications.NOTE: embedded for OptimadeQueryFilterWidget was introduced in optimade-client version 2020.11.5.
- Parameters
embedded (bool) – Whether or not to show extra database and provider information. When set to True, the extra information will be hidden, this is useful in situations where the widget is used in a Tab or similar, e.g., for the
aiidalab_widgets_base.structures.StructureManagerWidget
.title (str) – Title used for Tab header if employed in
aiidalab_widgets_base.structures.StructureManagerWidget
.
- __annotations__ = {}¶
- __init__(embedded: bool = True, title: Optional[str] = None, **kwargs) None [source]¶
Public constructor
- __module__ = 'aiidalab_widgets_base.databases'¶
- _database_grouping = {'Materials Cloud': {'General': ['curated-cofs'], 'Projects': ['2dstructures', '2dtopo', 'pyrene-mofs', 'scdm', 'sssp', 'stoceriaitf', 'tc-applicability', 'threedd']}}¶
- _disable_providers = ['cod', 'tcod', 'nmd', 'oqmd', 'aflow', 'matcloud', 'mpds', 'necro', 'jarvis']¶
- _skip_databases = {'Materials Cloud': ['optimade-sample', 'li-ion-conductors']}¶
- _trait_default_generators = {}¶
- structure¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.ProcessCallStackWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_string.HTML
Widget that shows process call stack.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.ProcessFollowerWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
A Widget that follows a process until finished.
- __annotations__ = {}¶
- __init__(process=None, followers=None, update_interval=0.1, path_to_root='../', **kwargs)[source]¶
Initiate all the followers.
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.ProcessInputsWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Widget to select and show process inputs.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.ProcessListWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
List of AiiDA processes.
past_days (int): Sumulations that were submitted in the last past_days.
incoming_node (int, str, Node): Trait that takes node id or uuid and returns the node that must be among the input nodes of the process of interest.
outgoing_node (int, str, Node): Trait that takes node id or uuid and returns the node that must be among the output nodes of the process of interest.
process_states (list): List of allowed process states.
process_label (str): Show process states of type process_label.
description_contains (str): string that should be present in the description of a process node.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.process'¶
- _default_process_label¶
- _trait_default_generators = {'process_label': <traitlets.traitlets.DefaultHandler object>}¶
- _validate_incoming_node¶
- _validate_outgoing_node¶
- _validate_process_label¶
- description_contains¶
A trait for unicode strings.
- incoming_node¶
A trait type representing a Union type.
- outgoing_node¶
A trait type representing a Union type.
- past_days¶
An int trait.
- process_label¶
A trait for unicode strings.
- process_states¶
An instance of a Python list.
- class aiidalab_widgets_base.ProcessMonitor(**kwargs)[source]¶
Bases:
traitlets.traitlets.HasTraits
Monitor a process and execute callback functions at specified intervals.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.process'¶
- _observe_process¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.ProcessNodesTreeWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
A tree widget for the structured representation of a process graph.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.process'¶
- _observe_process¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- selected_nodes¶
An instance of a Python tuple.
- class aiidalab_widgets_base.ProcessOutputsWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Widget to select and show process outputs.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.ProcessReportWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_string.HTML
Widget that shows process report.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.ProgressBarWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
A bar showing the proggress of a process.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- property current_state¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.RunningCalcJobOutputWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Show an output of selected running child calculation.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.SmilesWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Conver SMILES into 3D structure.
- SPINNER = '<i class="fa fa-spinner fa-pulse" style="color:red;" ></i>'¶
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.structures'¶
- _default_structure¶
- _pybel_opt(smiles, steps)[source]¶
Optimize a molecule using force field and pybel (needed for complex SMILES).
- _rdkit_opt(smiles, steps)[source]¶
Optimize a molecule using force field and rdkit (needed for complex SMILES).
- _trait_default_generators = {'structure': <traitlets.traitlets.DefaultHandler object>}¶
- structure¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.SshComputerSetup(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Setup password-free access to a computer.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.computers'¶
- property __password¶
Returning the password and immediately destroying it
- property __private_key¶
unwrap private key file and setting filename and file content
- property __proxy_password¶
Returning the password and immediately destroying it
- static _add_private_key(private_key_fname, private_key_content)[source]¶
param private_key_fname: string param private_key_content: bytes
- _observe_proxy_hostname¶
- _observe_proxy_username¶
- _on_setup_ssh(mode, change)[source]¶
ATTENTION: modifying the order of operations in this function can lead to unexpected problems
- static _send_pubkey(hostname, username, password, proxycmd='')[source]¶
Send a publick key to a remote host.
- _trait_default_generators = {}¶
- _validate_port¶
- _write_ssh_config(proxycmd='', private_key_abs_fname=None)[source]¶
Put host information into the config file.
- hostname¶
A trait for unicode strings.
- on_use_diff_proxy_username_change(change)[source]¶
If using different username for proxy check-box is clicked.
- port¶
A trait type representing a Union type.
- proxy_hostname¶
A trait for unicode strings.
- proxy_username¶
A trait for unicode strings.
- setup_counter¶
An int trait.
- use_proxy¶
A boolean (True, False) trait.
- username¶
A trait for unicode strings.
- class aiidalab_widgets_base.StructureBrowserWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Class to query for structures stored in the AiiDA database.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.structures'¶
- _trait_default_generators = {}¶
- structure¶
A trait type representing a Union type.
- class aiidalab_widgets_base.StructureExamplesWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Class to provide example structures for selection.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.structures'¶
- _default_structure¶
- _trait_default_generators = {'structure': <traitlets.traitlets.DefaultHandler object>}¶
- structure¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.StructureManagerWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Upload a structure and store it in AiiDA database.
- Attributes:
structure(Atoms): trait that contains the selected structure. ‘None’ if no structure is selected. structure_node(StructureData, CifData): trait that contains AiiDA structure object node_class(str): trait that contains structure_node type (as string).
- SUPPORTED_DATA_FORMATS = {'CifData': 'cif', 'StructureData': 'structure'}¶
- __annotations__ = {}¶
- __init__(importers, viewer=None, editors=None, storable=True, node_class=None, **kwargs)[source]¶
- Arguments:
- importers(list): list of tuples each containing the displayed name of importer and the
importer object. Each object should contain ‘structure’ trait pointing to the imported structure. The trait will be linked to ‘structure’ trait of this class.
storable(bool): Whether to provide Store button (together with Store format)
- node_class(str): AiiDA node class for storing the structure.
Possible values: ‘StructureData’, ‘CifData’ or None (let the user decide). Note: If your workflows require a specific node class, better fix it here.
- __module__ = 'aiidalab_widgets_base.structures'¶
- _change_structure_node¶
- _convert_to_structure_node(structure)[source]¶
Convert structure of any type to the StructureNode object.
- _default_node_class¶
- _observe_input_structure¶
- _observe_structure_node¶
- _structure_changed¶
- _sync_structure_node()[source]¶
Synchronize the structure_node trait using the currently provided info.
- _trait_default_generators = {}¶
- input_structure¶
A trait type representing a Union type.
- node_class¶
A trait for unicode strings.
- structure¶
A trait type representing a Union type.
- structure_node¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.StructureUploadWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Class that allows to upload structures from user’s computer.
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.structures'¶
- _trait_default_generators = {}¶
- _validate_and_fix_ase_cell(ase_structure, vacuum_ang=10.0)[source]¶
Checks if the ase Atoms object has a cell set, otherwise sets it to bounding box plus specified “vacuum” space
- structure¶
A trait type representing a Union type.
- class aiidalab_widgets_base.SubmitButtonWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
Submit button class that creates submit button jupyter widget.
- __annotations__ = {}¶
- __init__(process_class, inputs_generator=None, input_dictionary_function=None, description='Submit', disable_after_submit=True, append_output=False, **kwargs)[source]¶
Submit Button widget.
process_class (Process): Process class to submit.
inputs_generator (func): Function that returns inputs dictionary or inputs builder.
input_dictionary_function (DEPRECATED): Function that generates input parameters dictionary.
description (str): Description written on the submission button.
disable_after_submit (bool): Whether to disable the button after the process was submitted.
append_output (bool): Whether to clear widget output for each subsequent submission.
- __module__ = 'aiidalab_widgets_base.process'¶
- _trait_default_generators = {}¶
- process¶
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Subclasses can declare default classes by overriding the klass attribute
- class aiidalab_widgets_base.WizardAppWidget(**kwargs)[source]¶
Bases:
ipywidgets.widgets.widget_box.VBox
- ICONS = {<State.INIT: 0>: '○', <State.READY: 2>: '◎', <State.CONFIGURED: 1>: '●', <State.ACTIVE: 3>: ['◜', '◝', '◞', '◟'], <State.SUCCESS: 4>: '✓', <State.FAIL: -1>: '×'}¶
- ICON_SEPARATOR = '\u2000'¶
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.wizard'¶
- _consider_auto_advance(_=None)[source]¶
Determine whether the app should automatically advance to the next step.
This is performed whenever the current step is within the SUCCESS state and has the auto_advance attribute set to True.
- _observe_selected_index¶
- _trait_default_generators = {}¶
- classmethod icons()[source]¶
Return the icon set and return animated icons based on the current time stamp.
- reset(step=0)[source]¶
Reset the app up to the given step.
For example, with step=0 (the default), the whole app is reset. With step=1, all but the first step are reset.
- selected_index¶
An int trait.
- class aiidalab_widgets_base.WizardAppWidgetStep(**kwargs)[source]¶
Bases:
traitlets.traitlets.HasTraits
One step of a WizardAppWidget.
- class State(value)[source]¶
Bases:
enum.Enum
Each step is always in one specific state.
The state is used to determine:
how the step is visually presented to the user, and
whether the next step is accessible (i.e. reached the SUCCESS state).
App developers are encouraged to use the step states to couple application logic and interface. In general, all widget changes should trigger a re-evaluation of the step state, and states also determine whether certain widgets are enabled or disabled.
A step can be in one of the following states:
INIT: The initial state, usually all widgets disabled. READY: The step (widget) is ready for user input (some or all widgets enabled). CONFIGURED: The step is in a consistent configuration awaiting confirmation. ACTIVE: The step is carrying out a runtime operation. SUCCESS: A configuration has been confirmed / a runtime operation successfully finished. FAIL: A runtime operation has failed in an unrecoverable way.
Not all steps must implement all states, for example:
the first step does not need an INIT state
a step without runtime process should not have an ACTIVE or FAIL state
a “review & confirm” step does not require a READY state.
a step without configuration options (e.g. pure “review & confirm” step)
Important: The next step is only accessible if the current step is within the SUCCESS state!
- ACTIVE = 3¶
- CONFIGURED = 1¶
- FAIL = -1¶
- INIT = 0¶
- READY = 2¶
- SUCCESS = 4¶
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.wizard'¶
- __annotations__ = {}¶
- __module__ = 'aiidalab_widgets_base.wizard'¶
- _trait_default_generators = {}¶
- auto_advance¶
A boolean (True, False) trait.
- state¶
Use a Enum class as model for the data type description. Note that if no default-value is provided, the first enum-value is used as default-value.
# -- SINCE: Python 3.4 (or install backport: pip install enum34) import enum from traitlets import HasTraits, UseEnum class Color(enum.Enum): red = 1 # -- IMPLICIT: default_value blue = 2 green = 3 class MyEntity(HasTraits): color = UseEnum(Color, default_value=Color.blue) entity = MyEntity(color=Color.red) entity.color = Color.green # USE: Enum-value (preferred) entity.color = "green" # USE: name (as string) entity.color = "Color.green" # USE: scoped-name (as string) entity.color = 3 # USE: number (as int) assert entity.color is Color.green