From aad1f6f2ff83ff394a282a746b3cda20b8bd9801 Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Sun, 29 May 2022 15:56:16 +0200 Subject: [PATCH] pseudo_type return lowcase and compared in if-else (#152) In #140, the pseudo_type return from pseudo parser is lowcase ie nc rather than NC for norm-conserving. Forget to change in _base work chain when setting dual_scan_list. --- aiida_sssp_workflow/workflows/convergence/_base.py | 2 +- pseudo_parser/upf_parser/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aiida_sssp_workflow/workflows/convergence/_base.py b/aiida_sssp_workflow/workflows/convergence/_base.py index 814ae8e9..af7a4653 100644 --- a/aiida_sssp_workflow/workflows/convergence/_base.py +++ b/aiida_sssp_workflow/workflows/convergence/_base.py @@ -206,7 +206,7 @@ def init_setup(self): # set the ecutrho according to the type of pseudopotential # dual 4 for NC and 10 for all other type of PP. - if self.ctx.pseudo_type in ['NC', 'SL']: + if self.ctx.pseudo_type == 'nc': self.ctx.dual = 4.0 self.ctx.dual_scan_list = cutoff_control['nc_dual_scan'] else: diff --git a/pseudo_parser/upf_parser/__init__.py b/pseudo_parser/upf_parser/__init__.py index fc7db316..07e1f25c 100644 --- a/pseudo_parser/upf_parser/__init__.py +++ b/pseudo_parser/upf_parser/__init__.py @@ -89,7 +89,7 @@ def parse_pseudo_type(content: str) -> str: raw_type = match.group("pseudo_type") if "US" in raw_type: return "us" - elif "NC" in raw_type: + elif "NC" in raw_type or "SL" in raw_type: return "nc" elif "PAW" in raw_type: return "paw"