Skip to content

Commit

Permalink
Rejig pseudo ordered dict
Browse files Browse the repository at this point in the history
  • Loading branch information
elinscott committed Oct 10, 2024
1 parent bc4bc44 commit f19daee
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/koopmans/workflows/_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class Workflow(utils.HasDirectory, ABC):
calculator_parameters: Dict[str, settings.SettingsDict]
name: str
kpoints: Kpoints
_pseudopotentials: OrderedDict[str, str]
_pseudopotentials: Dict[str, str]
pseudo_dir: Path
projections: ProjectionBlocks
ml_model: Optional[AbstractMLModel]
Expand Down Expand Up @@ -466,13 +466,15 @@ def output_model(self) -> Type[outputs.OutputModel]:
...

@property
def pseudopotentials(self) -> Dict[str, str]:
return self._pseudopotentials
def pseudopotentials(self) -> OrderedDict[str, str]:
# Always return the pseudopotentials in alphabetical order
out = OrderedDict()
for k in sorted(self._pseudopotentials):
out[k] = self._pseudopotentials[k]
return out

@pseudopotentials.setter
def pseudopotentials(self, value: Union[Dict[str, str], OrderedDict[str, str]]):
if not isinstance(value, OrderedDict):
value = OrderedDict(value)
def pseudopotentials(self, value: Dict[str, str]):
self._pseudopotentials = value

def get_step_by_uuid(self, uuid: str):
Expand Down

0 comments on commit f19daee

Please sign in to comment.