|
47 | 47 | from glob import glob
|
48 | 48 | from itertools import chain
|
49 | 49 | from pathlib import Path
|
| 50 | +from typing import Any, Literal |
50 | 51 | from zipfile import ZipFile
|
51 | 52 |
|
52 | 53 | import numpy as np
|
@@ -250,24 +251,25 @@ class DictSet(VaspInputSet):
|
250 | 251 |
|
251 | 252 | def __init__(
|
252 | 253 | self,
|
253 |
| - structure, |
254 |
| - config_dict, |
| 254 | + structure: Structure, |
| 255 | + config_dict: dict[str, Any], |
255 | 256 | files_to_transfer=None,
|
256 | 257 | user_incar_settings=None,
|
257 | 258 | user_kpoints_settings=None,
|
258 | 259 | user_potcar_settings=None,
|
259 |
| - constrain_total_magmom=False, |
260 |
| - sort_structure=True, |
261 |
| - potcar_functional=None, |
262 |
| - user_potcar_functional=None, |
263 |
| - force_gamma=False, |
| 260 | + constrain_total_magmom: bool = False, |
| 261 | + sort_structure: bool = True, |
| 262 | + user_potcar_functional: Literal[ |
| 263 | + "PBE", "PBE_52", "PBE_54", "LDA", "LDA_52", "LDA_54", "PW91", "LDA_US", "PW91_US" |
| 264 | + ] = None, |
| 265 | + force_gamma: bool = False, |
264 | 266 | reduce_structure=None,
|
265 | 267 | vdw=None,
|
266 |
| - use_structure_charge=False, |
267 |
| - standardize=False, |
| 268 | + use_structure_charge: bool = False, |
| 269 | + standardize: bool = False, |
268 | 270 | sym_prec=0.1,
|
269 |
| - international_monoclinic=True, |
270 |
| - validate_magmom=True, |
| 271 | + international_monoclinic: bool = True, |
| 272 | + validate_magmom: bool = True, |
271 | 273 | ):
|
272 | 274 | """
|
273 | 275 | Args:
|
@@ -385,22 +387,8 @@ def __init__(
|
385 | 387 | raise KeyError(
|
386 | 388 | f"Invalid or unsupported van-der-Waals functional. Supported functionals are {', '.join(vdw_par)}."
|
387 | 389 | )
|
388 |
| - # read the POTCAR_FUNCTIONAL from the .yaml |
389 |
| - self.potcar_functional = self._config_dict.get("POTCAR_FUNCTIONAL", "PBE") |
390 |
| - |
391 |
| - if potcar_functional is not None and user_potcar_functional is not None: |
392 |
| - raise ValueError( |
393 |
| - "Received both 'potcar_functional' and 'user_potcar_functional arguments. " |
394 |
| - "'potcar_functional is deprecated." |
395 |
| - ) |
396 |
| - if potcar_functional: |
397 |
| - warnings.warn( |
398 |
| - "'potcar_functional' argument is deprecated. Use 'user_potcar_functional' instead.", |
399 |
| - FutureWarning, |
400 |
| - ) |
401 |
| - self.potcar_functional = potcar_functional |
402 |
| - elif user_potcar_functional: |
403 |
| - self.potcar_functional = user_potcar_functional |
| 390 | + # 'or' case reads the POTCAR_FUNCTIONAL from the .yaml |
| 391 | + self.potcar_functional = user_potcar_functional or self._config_dict.get("POTCAR_FUNCTIONAL", "PBE") |
404 | 392 |
|
405 | 393 | # warn if a user is overriding POTCAR_FUNCTIONAL
|
406 | 394 | if self.potcar_functional != self._config_dict.get("POTCAR_FUNCTIONAL"):
|
|
0 commit comments