diff --git a/src/aiidalab_qe_vibroscopy/app/__init__.py b/src/aiidalab_qe_vibroscopy/app/__init__.py index 361de09..1058b79 100644 --- a/src/aiidalab_qe_vibroscopy/app/__init__.py +++ b/src/aiidalab_qe_vibroscopy/app/__init__.py @@ -22,7 +22,7 @@ class VibroPluginOutline(PluginOutline): "panel": VibroConfigurationSettingPanel, "model": VibroConfigurationSettingsModel, }, - "code": { + "resources": { "panel": VibroResourcesSettingsPanel, "model": VibroResourceSettingsModel, }, diff --git a/src/aiidalab_qe_vibroscopy/app/code.py b/src/aiidalab_qe_vibroscopy/app/code.py index 53574d6..7d24eaf 100644 --- a/src/aiidalab_qe_vibroscopy/app/code.py +++ b/src/aiidalab_qe_vibroscopy/app/code.py @@ -1,29 +1,41 @@ from aiidalab_qe.common.code.model import CodeModel, PwCodeModel -from aiidalab_qe.common.panel import ResourceSettingsModel, ResourceSettingsPanel +from aiidalab_qe.common.panel import ( + PluginResourceSettingsModel, + PluginResourceSettingsPanel, +) -class VibroResourceSettingsModel(ResourceSettingsModel): +class VibroResourceSettingsModel(PluginResourceSettingsModel): """Resource settings for the vibroscopy calculations.""" - codes = { - "phonon": PwCodeModel( - description="pw.x for phonons", - default_calc_job_plugin="quantumespresso.pw", - ), - "dielectric": PwCodeModel( - description="pw.x for dielectric", - default_calc_job_plugin="quantumespresso.pw", - ), - "phonopy": CodeModel( - name="phonopy", - description="phonopy", - default_calc_job_plugin="phonopy.phonopy", - ), - } + identifier = "vibronic" + def __init__(self, **kwargs): + super().__init__(**kwargs) + self.add_models( + { + "phonon": PwCodeModel( + name="phonon", + description="pw.x for phonons", + default_calc_job_plugin="quantumespresso.pw", + ), + "dielectric": PwCodeModel( + name="dielectric", + description="pw.x for dielectric", + default_calc_job_plugin="quantumespresso.pw", + ), + "phonopy": CodeModel( + name="phonopy", + description="phonopy", + default_calc_job_plugin="phonopy.phonopy", + ), + } + ) -class VibroResourcesSettingsPanel(ResourceSettingsPanel[VibroResourceSettingsModel]): + +class VibroResourcesSettingsPanel( + PluginResourceSettingsPanel[VibroResourceSettingsModel] +): """Panel for the resource settings for the vibroscopy calculations.""" title = "Vibronic" - identifier = identifier = "vibronic"