zhubonan / aiida-castep

Interface with AiiDA to automate CASTEP calculations and preserve their provenance.
MIT License
7 stars 3 forks source link

pasing metadata.options to `CastepBaseWorkChain` for `CastepCalculation` #17

Open zhubonan opened 2 years ago

zhubonan commented 2 years ago

metadata.options contains the information regarding the operation of the CastepCalculation. Two approaches may be used:

  1. Expose the input port from CastepCalculation. This enables automatic checking and tab completion, but renders get_builder_restart difficult to use for CastepBaseWorkChain.
  2. Wrap everything in the Dict. This is the way VaspWorkChain handles it. It allows get_builder_restart to be used. However, any problem with the options supports.

The plan was to migrate from 1 to 2, but 2 is not really good as it does not use the mechanism in aiida-core - so more like a workaround. The key problem is the metadata.options is a non-db input, e.g. plain python dictionary, but it is needed for creating a workchian level restart builder.

The alternative is to implement custom methods for performing the restart. However, it is not possible to, in general, recover the metadata.options from the called calculations, but cause what was stored may be the results from modifications. To support 1., CastepBaseWorkChain can implement a method to store the metadata.options inside the extras of the underlying WorkChainNode. This way, the original inputs may be recovered for manual restart.