Skip to content

Commit

Permalink
updating resources with new classes from aiidalab-qe (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndresOrtegaGuerrero authored Dec 23, 2024
1 parent fbb0075 commit c351153
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/aiidalab_qe_vibroscopy/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class VibroPluginOutline(PluginOutline):
"panel": VibroConfigurationSettingPanel,
"model": VibroConfigurationSettingsModel,
},
"code": {
"resources": {
"panel": VibroResourcesSettingsPanel,
"model": VibroResourceSettingsModel,
},
Expand Down
50 changes: 31 additions & 19 deletions src/aiidalab_qe_vibroscopy/app/code.py
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit c351153

Please sign in to comment.