Skip to content

Commit

Permalink
Guard pseudo model updates when loaded from process
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Nov 4, 2024
1 parent 751f378 commit d1ddbae
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/aiidalab_qe/app/configuration/advanced/pseudos/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ def update(self, specific=""): # noqa: ARG002
self.update_family()

def update_default_pseudos(self):
if self.loaded_from_process:
return
try:
pseudo_family = self._get_pseudo_family_from_database()
pseudos = pseudo_family.get_pseudos(structure=self.input_structure)
Expand All @@ -159,6 +161,8 @@ def update_default_pseudos(self):

def update_default_cutoffs(self):
"""Update wavefunction and density cutoffs from pseudo family."""
if self.loaded_from_process:
return
try:
pseudo_family = self._get_pseudo_family_from_database()
current_unit = pseudo_family.get_cutoffs_unit()
Expand Down Expand Up @@ -196,6 +200,8 @@ def update_default_cutoffs(self):
self.cutoffs = self._get_default_cutoffs()

def update_library_options(self):
if self.loaded_from_process:
return
if self.spin_orbit == "soc":
library_options = [
"PseudoDojo standard",
Expand All @@ -216,6 +222,8 @@ def update_library_options(self):
self.update_family_parameters()

def update_family_parameters(self):
if self.loaded_from_process:
return
if self.spin_orbit == "soc":
if self.protocol in ["fast", "moderate"]:
pseudo_family_string = "PseudoDojo/0.4/PBE/FR/standard/upf"
Expand All @@ -236,6 +244,8 @@ def update_family_parameters(self):
self.functional = self._defaults["functional"]

def update_family(self):
if self.loaded_from_process:
return
library, accuracy = self.library.split()
functional = self.functional
# XXX (jusong.yu): a validator is needed to check the family string is
Expand Down

0 comments on commit d1ddbae

Please sign in to comment.