Skip to content

Commit f6ed297

Browse files
feat: allow for some additional extrusion direction names (#1534)
Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
1 parent 9cb2ac2 commit f6ed297

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

doc/changelog.d/1534.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
allow for some additional extrusion direction names

src/ansys/geometry/core/designer/component.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ class ExtrusionDirection(Enum):
107107
@classmethod
108108
def from_string(cls, string: str, use_default_if_error: bool = False) -> "ExtrusionDirection":
109109
"""Convert a string to an ``ExtrusionDirection`` enum."""
110-
if string == "+":
110+
lcase_string = string.lower()
111+
if lcase_string in ("+", "p", "pos", "positive"):
111112
return cls.POSITIVE
112-
elif string == "-":
113+
elif lcase_string in ("-", "n", "neg", "negative"):
113114
return cls.NEGATIVE
114115
elif use_default_if_error:
115116
from ansys.geometry.core.logger import LOG

0 commit comments

Comments
 (0)