From ed7fb612c105e1221e9ed3fe01df96783f4fe217 Mon Sep 17 00:00:00 2001 From: superstar54 Date: Sat, 7 Oct 2023 13:59:09 +0000 Subject: [PATCH] add detail parameters --- docs/source/development/architecture.rst | 25 ++++++++++++--- docs/source/development/plugin.rst | 39 +++++++++++++++++++++++- 2 files changed, 59 insertions(+), 5 deletions(-) diff --git a/docs/source/development/architecture.rst b/docs/source/development/architecture.rst index e62c77bdd..4694a8cb0 100644 --- a/docs/source/development/architecture.rst +++ b/docs/source/development/architecture.rst @@ -27,11 +27,28 @@ In the configuration step, there are several panels. The parameters from these p .. code:: python { - "workchain": {...}, - "advanced": {...}, - "bands": {...}, + "workchain": { + "protocol": "fast", + "relax_type": "positions", + "properties": ["bands", "pdos", "relax"], + "spin_type": "none", + "electronic_type": "insulator", + }, + "advanced": { + "initial_magnetic_moments": None, + "pw": { + "parameters": { + "SYSTEM": {"ecutwfc": 30.0, "ecutrho": 240.0, "tot_charge": 0.0} + }, + "pseudos": {"Si": "eaef3352-2b0e-4205-b404-e6565a88aec8"}, + }, + "pseudo_family": "SSSP/1.2/PBEsol/efficiency", + "kpoints_distance": 0.5, + }, + "bands": {"kpath_2d": "hexagonal"}, + "pdos": {...}, "plugin_1": {...}, - ... + "plugin_2": {...}, } Plugin diff --git a/docs/source/development/plugin.rst b/docs/source/development/plugin.rst index ec265f261..5fbd2a20c 100644 --- a/docs/source/development/plugin.rst +++ b/docs/source/development/plugin.rst @@ -89,7 +89,40 @@ In this class, one needs to implement the ``_update_view`` method to tell QeApp WorkChain and Builder ----------------------- -One needs to implement a ``get_builder`` function to tell QeApp how to use the input parameters from the GUI. Then register the workchain and builder in the `workchain_and_builder` dict, so that the QeApp can load them. +One needs to implement a ``get_builder`` function to tell QeApp how to use the input parameters from the GUI. + +The `parameters` passed to the `get_builder` function has the following structure: + +.. code:: python + + { + "workchain": { + "protocol": "fast", + "relax_type": "positions", + "properties": ["bands", "pdos", "relax"], + "spin_type": "none", + "electronic_type": "insulator", + }, + "advanced": { + "initial_magnetic_moments": None, + "pw": { + "parameters": { + "SYSTEM": {"ecutwfc": 30.0, "ecutrho": 240.0, "tot_charge": 0.0} + }, + "pseudos": {"Si": "eaef3352-2b0e-4205-b404-e6565a88aec8"}, + }, + "pseudo_family": "SSSP/1.2/PBEsol/efficiency", + "kpoints_distance": 0.5, + }, + "bands": {"kpath_2d": "hexagonal"}, + "pdos": {...}, + "hello_world": {...}, + "plugin_1": {...}, + } + +One needs to decide which parameters are needed for the workchain, and how to use them. For example, the ``HelloWorldWorkChain`` needs the ``name`` parameter, which is defined in the ``Setting`` panel. The ``get_builder`` function will return a ``builder`` for the ``HelloWorldWorkChain``. The ``builder`` will be used to submit the workchain. + + .. code-block:: python @@ -104,6 +137,10 @@ One needs to implement a ``get_builder`` function to tell QeApp how to use the i ) return builder +Then register the workchain and builder in the `workchain_and_builder` dict, so that the QeApp can load them. + +.. code-block:: python + # register the workchain and builder workchain_and_builder = { "workchain": HelloWorldWorkChain,