Skip to content

Commit

Permalink
Add a Numpy array converter to ABC attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
rafmudaf committed Dec 1, 2023
1 parent 17cad6b commit 4624c5e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions floris/simulation/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@

import attrs
import numpy as np
from attrs import define, field
from attrs import (
cmp_using,
define,
field,
)

from floris.simulation import BaseClass
from floris.type_dec import (
floris_array_converter,
floris_float_type,
Expand All @@ -36,7 +41,7 @@


@define
class Grid(ABC):
class Grid(ABC, BaseClass):
"""
Grid should establish domain bounds based on given criteria,
and develop three arrays to contain components of the grid
Expand Down Expand Up @@ -66,7 +71,7 @@ class Grid(ABC):
time_series (:py:obj:`bool`): Flag to indicate whether the supplied wind data is a time
series.
"""
turbine_coordinates: NDArrayFloat = field()
turbine_coordinates: NDArrayFloat = field(converter=floris_array_converter)
turbine_diameters: NDArrayFloat = field(converter=floris_array_converter)
grid_resolution: int | Iterable = field()
wind_directions: NDArrayFloat = field(converter=floris_array_converter)
Expand Down

0 comments on commit 4624c5e

Please sign in to comment.