Skip to content

Commit

Permalink
fix typing of task_names
Browse files Browse the repository at this point in the history
  • Loading branch information
esoteric-ephemera committed Mar 20, 2024
1 parent 9a5cc3f commit 1919271
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions emmet-builders/emmet/builders/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
sys.stdout = self._original_stdout


def get_potcar_stats():
def get_potcar_stats(strict: bool = False):
default_settings = EmmetBuildSettings()

stats: dict[str, dict] = {} # type: ignore
Expand All @@ -231,10 +231,11 @@ def get_potcar_stats():
functional = _input._config_dict["POTCAR_FUNCTIONAL"]

for potcar_symbol in _input.CONFIG["POTCAR"].values():
potcar = PotcarSingle.from_symbol_and_functional(
symbol=potcar_symbol, functional=functional
)
summary_stats = potcar._summary_stats.copy()
if strict:
potcar = PotcarSingle.from_symbol_and_functional(
symbol=potcar_symbol, functional=functional
)
summary_stats = potcar._summary_stats.copy()
# fallback method for validation - use header hash and symbol
# note that the potcar_spec assigns PotcarSingle.symbol to "titel"
summary_stats["titel"] = potcar.TITEL
Expand Down
4 changes: 2 additions & 2 deletions emmet-core/emmet/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def from_directory(
store_additional_json: bool = True,
additional_fields: Optional[Dict[str, Any]] = None,
volume_change_warning_tol: float = 0.2,
task_names: Optional[list[str]] | None = None,
task_names: Optional[list[str]] = None,
**vasp_calculation_kwargs,
) -> _T:
"""
Expand Down Expand Up @@ -980,7 +980,7 @@ def _get_run_stats(calcs_reversed: List[Calculation]) -> Dict[str, RunStatistics
def _find_vasp_files(
path: Union[str, Path],
volumetric_files: Tuple[str, ...] = _VOLUMETRIC_FILES,
task_names: Optional[list[str]] | None = None,
task_names: Optional[list[str]] = None,
) -> Dict[str, Any]:
"""
Find VASP files in a directory.
Expand Down

0 comments on commit 1919271

Please sign in to comment.