Skip to content

Commit

Permalink
🐛 Fix value error string, value string in loads.py and element.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Athoy Nilima committed Feb 28, 2024
1 parent 878ddf4 commit ff3bd82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions bluemira/structural/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ class LoadType(Enum):
NODE_LOAD = auto()

@classmethod
def _missing_(cls, value):
def _missing_(cls, value: str):
try:
return cls[value.replace(" ", "_").upper()]
except KeyError:
raise StructuralError(
f"Invalid load: {value}. Choose from:"
f"element_load, distributed_load, node_load"
f"{cls.__name__} has no load type {value}"
f"please select from {*cls._member_names_, }"
) from None


Expand Down
5 changes: 3 additions & 2 deletions bluemira/structural/loads.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ class SubLoadType(Enum):
ALL = auto()

@classmethod
def _missing_(cls, value):
def _missing_(cls, value: str):
try:
return cls[value.upper()]
except KeyError:
raise StructuralError(
f"Unknown SubLoad type {value}. Choose from: force, moment or all"
f"{cls.__name__} has no load type {value}"
f"please select from {*cls._member_names_, }"
) from None


Expand Down

0 comments on commit ff3bd82

Please sign in to comment.