Listing AiiDA processesΒΆ

%%javascript

IPython.OutputArea.prototype._should_scroll = function(lines) {
    return false;
}
import ipywidgets as ipw
from aiidalab_widgets_base import ProcessListWidget
from traitlets import dlink
from plumpy import ProcessState
process_list = ProcessListWidget(path_to_root="../../")

past_days_widget = ipw.IntText(value=7, description='Past days:')
dlink((past_days_widget, 'value'), (process_list, 'past_days'))


all_days_checkbox = ipw.Checkbox(description="All days", value=False)
dlink((all_days_checkbox, 'value'), (past_days_widget, 'disabled'))
dlink((all_days_checkbox, 'value'), (process_list, 'past_days'), transform=lambda v: -1 if v else past_days_widget.value)

incoming_node_widget = ipw.Text(
    description='Incoming node:',
    style={'description_width': 'initial'}
)
dlink((incoming_node_widget, 'value'), (process_list, 'incoming_node'))


outgoing_node_widget = ipw.Text(
    description='Outgoing node:',
    style={'description_width': 'initial'}
)
dlink((outgoing_node_widget, 'value'), (process_list, 'outgoing_node'))


available_states = [state.value for state in ProcessState]
process_state_widget = ipw.SelectMultiple(options=available_states,
                                        value=available_states,
                                        description='Process State:',
                                        style={'description_width': 'initial'},
                                        disabled=False)
dlink((process_state_widget, 'value'), (process_list, 'process_states'))

process_label_widget = ipw.Text(
    description='Process label:',
    style={'description_width': 'initial'}
)
dlink((process_label_widget, 'value'), (process_list, 'process_label'))

description_contains_widget = ipw.Text(
    description='Description contains:',
    style={'description_width': 'initial'}
)
dlink((description_contains_widget, 'value'), (process_list, 'description_contains'))

display(
    ipw.HBox([
        ipw.VBox([past_days_widget, process_state_widget]),
        ipw.VBox(
            [
                all_days_checkbox,
                incoming_node_widget,
                outgoing_node_widget,
                process_label_widget,
                description_contains_widget
            ],
            layout={'margin': '0px 0px 0px 40px'}
        )
    ]),
    process_list)
process_list.start_autoupdate(update_interval=30)