Skip to content

Commit b87079e

Browse files
Fix pseudo dojo library handling on process upload (#1384)
Some logic was missed in handling the relativistic information when loading the app from a process.
1 parent 7302023 commit b87079e

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/aiidalab_qe/app/configuration/advanced/model.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,17 @@ def set_model_state(self, parameters):
164164
)
165165
if pseudo_family_string := parameters.get("pseudo_family"):
166166
pseudo_family = PseudoFamily.from_string(pseudo_family_string)
167-
library = pseudo_family.library
168-
accuracy = pseudo_family.accuracy
167+
library = f"{pseudo_family.library} {pseudo_family.accuracy}"
168+
if relativistic := pseudo_family.relativistic:
169+
library += f" ({relativistic})"
169170
pseudos.functional = pseudo_family.functional
170-
pseudos.library = f"{library} {accuracy}"
171+
pseudos.library = library
171172
pseudos.family = pseudo_family_string
172173
else:
173-
pseudos.library = None
174174
pp_uuid = next(iter(parameters["pw"]["pseudos"].values()))
175175
pseudo_info = get_pseudo_info(pp_uuid)
176176
pseudos.functional = pseudo_info["functional"]
177+
pseudos.library = None
177178
pseudos.family = None
178179
pseudos.show_upload_warning = True
179180

src/aiidalab_qe/app/configuration/advanced/pseudos/model.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,15 @@ def update_family_parameters(self):
137137

138138
pseudo_family = PseudoFamily.from_string(pseudo_family_string)
139139
library = f"{pseudo_family.library} {pseudo_family.accuracy}"
140+
if relativistic := pseudo_family.relativistic:
141+
library += f" ({relativistic})"
140142

141-
if "FR" in pseudo_family_string:
142-
library += " (FR)"
143-
elif "SR" in pseudo_family_string:
144-
library += " (SR)"
145-
146-
self._defaults["library"] = library
147143
self._defaults["functional"] = pseudo_family.functional
144+
self._defaults["library"] = library
148145

149146
with self.hold_trait_notifications():
150-
self.library = self._defaults["library"]
151147
self.functional = self._defaults["functional"]
148+
self.library = self._defaults["library"]
152149

153150
def update_functionals(self):
154151
if self.loaded_from_process or not (self.functional and self.family):

0 commit comments

Comments
 (0)