Skip to content

Commit

Permalink
Remove a redundant Vec3 method
Browse files Browse the repository at this point in the history
  • Loading branch information
rafmudaf committed Dec 1, 2023
1 parent 9e5a6a7 commit 00e8b6b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion floris/tools/floris_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ def get_turbine_layout(self, z=False):
np.array: lists of x, y, and (optionally) z coordinates of
each turbine
"""
xcoords, ycoords, zcoords = np.array([c.elements for c in self.floris.farm.coordinates]).T
xcoords, ycoords, zcoords = np.array([c.components for c in self.floris.farm.coordinates]).T
if z:
return xcoords, ycoords, zcoords
else:
Expand Down
9 changes: 0 additions & 9 deletions floris/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,8 @@ class Vec3:
Args:
components (list(numeric, numeric, numeric), numeric): All three vector
components.
string_format (str, optional): Format to use in the
overloaded __str__ function. Defaults to None.
"""
components: NDArrayFloat = field(converter=floris_array_converter)
# NOTE: this does not convert elements to float if they are given as int. Is this ok?

@components.validator
def _check_components(self, attribute, value) -> None:
Expand Down Expand Up @@ -117,12 +114,6 @@ def x3(self):
def x3(self, value):
self.components[2] = float(value)

@property
def elements(self) -> Tuple[float, float, float]:
# TODO: replace references to elements with components
# and remove this @property
return self.components


def cosd(angle):
"""
Expand Down
6 changes: 3 additions & 3 deletions tests/vec3_unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ def test_equality(vec3_fixture):
assert vec3_fixture != rhs


def test_elements_property(vec3_fixture):
"""Ensure that the x1, x2, and x3 elements match the expected values.
def test_components_property(vec3_fixture):
"""Ensure that the x1, x2, and x3 components match the expected values.
"""
x1, x2, x3 = vec3_fixture.elements
x1, x2, x3 = vec3_fixture.components
assert 4.0 == x1
assert 4.0 == x2
assert 0.0 == x3

0 comments on commit 00e8b6b

Please sign in to comment.