Skip to content

Commit

Permalink
feat: allow for some additional extrusion direction names (#1534)
Browse files Browse the repository at this point in the history
Co-authored-by: pyansys-ci-bot <[email protected]>
  • Loading branch information
RobPasMue and pyansys-ci-bot authored Nov 12, 2024
1 parent 9cb2ac2 commit f6ed297
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/changelog.d/1534.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allow for some additional extrusion direction names
5 changes: 3 additions & 2 deletions src/ansys/geometry/core/designer/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ class ExtrusionDirection(Enum):
@classmethod
def from_string(cls, string: str, use_default_if_error: bool = False) -> "ExtrusionDirection":
"""Convert a string to an ``ExtrusionDirection`` enum."""
if string == "+":
lcase_string = string.lower()
if lcase_string in ("+", "p", "pos", "positive"):
return cls.POSITIVE
elif string == "-":
elif lcase_string in ("-", "n", "neg", "negative"):
return cls.NEGATIVE
elif use_default_if_error:
from ansys.geometry.core.logger import LOG
Expand Down

0 comments on commit f6ed297

Please sign in to comment.