Skip to content

Commit

Permalink
🚚 rename class names
Browse files Browse the repository at this point in the history
  • Loading branch information
Athoy Nilima committed Feb 27, 2024
1 parent 22ee7a0 commit 26913ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions bluemira/geometry/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# =============================================================================
# Pre-processing utilities
# =============================================================================
class RotationAxisType(Enum):
class RotationAxis(Enum):
"""Enumeration of rotation axes."""

X = auto()
Expand Down Expand Up @@ -629,22 +629,22 @@ def rotation_matrix(theta: float, axis: Union[str, np.ndarray] = "z") -> np.ndar
The (active) rotation matrix about the axis for an angle theta
"""
if isinstance(axis, str):
axis_str = RotationAxisType(axis)
axis_str = RotationAxis(axis)
# I'm leaving all this in here, because it is easier to understand
# what is going on, and that these are just "normal" rotation matrices
if axis_str is RotationAxisType.Z:
if axis_str is RotationAxis.Z:
r_matrix = np.array([
[np.cos(theta), -np.sin(theta), 0],
[np.sin(theta), np.cos(theta), 0],
[0, 0, 1],
])
elif axis_str is RotationAxisType.Y:
elif axis_str is RotationAxis.Y:
r_matrix = np.array([
[np.cos(theta), 0, np.sin(theta)],
[0, 1, 0],
[-np.sin(theta), 0, np.cos(theta)],
])
elif axis_str is RotationAxisType.X:
elif axis_str is RotationAxis.X:
r_matrix = np.array([
[1, 0, 0],
[0, np.cos(theta), -np.sin(theta)],
Expand Down
10 changes: 5 additions & 5 deletions bluemira/geometry/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def convert(apiobj: cadapi.apiShape, label: str = "") -> BluemiraGeo:
return output


class HullPlaneType(Enum):
class HullPlane(Enum):
"""
Enumeration of planes to perform a hull operation in.
"""
Expand Down Expand Up @@ -730,12 +730,12 @@ def convex_hull_wires_2d(
if plane is None:
raise KeyError("Invalid plane. Must be one of 'xz', 'xy', 'yz'.")

hull_plane = HullPlaneType(plane)
if hull_plane is HullPlaneType.XZ:
hull_plane = HullPlane(plane)
if hull_plane is HullPlane.XZ:
plane_idxs = (0, 2)
elif hull_plane is HullPlaneType.XY:
elif hull_plane is HullPlane.XY:
plane_idxs = (0, 1)
elif hull_plane is HullPlaneType.YZ:
elif hull_plane is HullPlane.YZ:

Check warning on line 738 in bluemira/geometry/tools.py

View check run for this annotation

Codecov / codecov/patch

bluemira/geometry/tools.py#L738

Added line #L738 was not covered by tests
plane_idxs = (1, 2)
else:
raise ValueError(f"Invalid plane: '{plane}'. Must be one of 'xz', 'xy', 'yz'.")
Expand Down

0 comments on commit 26913ea

Please sign in to comment.