Skip to content

Commit

Permalink
logic for the codes
Browse files Browse the repository at this point in the history
  • Loading branch information
AndresOrtegaGuerrero committed Nov 29, 2024
1 parent b18fe6d commit 9524fbc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
45 changes: 8 additions & 37 deletions src/aiidalab_qe_vibroscopy/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@

from aiidalab_qe_vibroscopy.app.model import VibroConfigurationSettingsModel
from aiidalab_qe_vibroscopy.app.settings import VibroConfigurationSettingPanel
from aiidalab_qe_vibroscopy.app.code import (
VibroResourceSettingsModel,
VibroResourcesSettingsPanel,
)


# from aiidalab_qe_vibroscopy.app.settings import Setting
from aiidalab_qe_vibroscopy.app.workchain import workchain_and_builder
# from aiidalab_qe_vibroscopy.app.result import Result
# from aiidalab_qe.common.panel import OutlinePanel

from aiidalab_qe.common.widgets import (
QEAppComputationalResourcesWidget,
PwCodeResourceSetupWidget,
)


class VibroPluginOutline(PluginOutline):
Expand All @@ -25,33 +20,9 @@ class VibroPluginOutline(PluginOutline):
"panel": VibroConfigurationSettingPanel,
"model": VibroConfigurationSettingsModel,
},
"code": {
"panel": VibroResourcesSettingsPanel,
"model": VibroResourceSettingsModel,
},
"workchain": workchain_and_builder,
}

PhononWorkChainPwCode = PwCodeResourceSetupWidget(
description="pw.x for phonons", # code for the PhononWorkChain workflow",
default_calc_job_plugin="quantumespresso.pw",
)

# The finite electric field does not support npools (does not work with npools>1), so we just set it as QEAppComputationalResourcesWidget
DielectricWorkChainPwCode = QEAppComputationalResourcesWidget(
description="pw.x for dielectric", # code for the DielectricWorChain workflow",
default_calc_job_plugin="quantumespresso.pw",
)

PhonopyCalculationCode = QEAppComputationalResourcesWidget(
description="phonopy", # code for the PhonopyCalculation calcjob",
default_calc_job_plugin="phonopy.phonopy",
)

# property = {
# "outline": Outline,
# "code": {
# "phonon": PhononWorkChainPwCode,
# "dielectric": DielectricWorkChainPwCode,
# "phonopy": PhonopyCalculationCode,
# },
# "setting": Setting,
# "workchain": workchain_and_builder,
# "result": Result,
# }
29 changes: 29 additions & 0 deletions src/aiidalab_qe_vibroscopy/app/code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from aiidalab_qe.common.code.model import CodeModel, PwCodeModel
from aiidalab_qe.common.panel import ResourceSettingsModel, ResourceSettingsPanel


class VibroResourceSettingsModel(ResourceSettingsModel):
"""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",
),
}


class VibroResourcesSettingsPanel(ResourceSettingsPanel[VibroResourceSettingsModel]):
"""Panel for the resource settings for the vibroscopy calculations."""

title = "Vibronic"
identifier = identifier = "vibronic"

0 comments on commit 9524fbc

Please sign in to comment.