Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make calc type enums IgnoreCase #1108

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion emmet-core/dev_scripts/generate_enums.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module to define various calculation types as Enums for VASP."""

from __future__ import annotations
from importlib.resources import files as import_resource_files
from itertools import product
Expand Down Expand Up @@ -130,7 +131,11 @@ def generate_vasp_enums_file(enum_file_name: str | None = None) -> None:
enum_name,
docstr[enum_name],
sorted_enums,
enum_class=("IgnoreCase" if enum_name == "RunType" else "Value")
enum_class=(
"IgnoreCase"
if enum_name in ["RunType", "CalcType"]
else "Value"
)
+ "Enum",
)
)
Expand Down
2 changes: 1 addition & 1 deletion emmet-core/emmet/core/vasp/calc_types/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class TaskType(ValueEnum):
Unrecognized = "Unrecognized"


class CalcType(ValueEnum):
class CalcType(IgnoreCaseEnum):
"""VASP calculation types."""

AM05_DFPT = "AM05 DFPT"
Expand Down