Skip to content

Commit

Permalink
add detail parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
superstar54 committed Oct 7, 2023
1 parent 9636663 commit ed7fb61
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 5 deletions.
25 changes: 21 additions & 4 deletions docs/source/development/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 38 additions & 1 deletion docs/source/development/plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit ed7fb61

Please sign in to comment.