From 6a5daf49ea7e239a1bb7ac47581ee535ead1a1a1 Mon Sep 17 00:00:00 2001 From: Shyam D Date: Thu, 27 May 2021 08:53:29 -0700 Subject: [PATCH] switch default deprecated tags to setting --- emmet-core/emmet/core/settings.py | 4 ++++ emmet-core/emmet/core/vasp/validation.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/emmet-core/emmet/core/settings.py b/emmet-core/emmet/core/settings.py index 23fd23b494..60cfbeba60 100644 --- a/emmet-core/emmet/core/settings.py +++ b/emmet-core/emmet/core/settings.py @@ -79,6 +79,10 @@ class EmmetSettings(BaseSettings): description="Maximum upward gradient in the last SCF for any VASP calculation", ) + VASP_DEPRECATED_TAGS: List[str] = Field( + [], description="List of tags to manually deprecate in task validation" + ) + class Config: env_prefix = "emmet_" extra = "ignore" diff --git a/emmet-core/emmet/core/vasp/validation.py b/emmet-core/emmet/core/vasp/validation.py index f4961dc6fd..d019e66a04 100644 --- a/emmet-core/emmet/core/vasp/validation.py +++ b/emmet-core/emmet/core/vasp/validation.py @@ -1,5 +1,5 @@ from datetime import datetime -from typing import Dict, List, Union +from typing import Dict, List, Optional, Union import numpy as np from pydantic import BaseModel, Field, PyObject @@ -57,7 +57,7 @@ def from_task_doc( input_sets: Dict[str, PyObject] = SETTINGS.VASP_DEFAULT_INPUT_SETS, LDAU_fields: List[str] = SETTINGS.VASP_CHECKED_LDAU_FIELDS, max_allowed_scf_gradient: float = SETTINGS.VASP_MAX_SCF_GRADIENT, - deprecated_tags: Optional[List[str]] = None, + deprecated_tags: List[str] = SETTINGS.VASP_DEPRECATED_TAGS, ) -> "ValidationDoc": """ Determines if a calculation is valid based on expected input parameters from a pymatgen inputset