Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ceholden committed Dec 6, 2024
1 parent 77f367c commit 9251992
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions hls_vi/generate_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,12 @@ class Index(Enum):
SAVI = ("Soil-Adjusted Vegetation Index",)
TVI = ("Triangular Vegetation Index", 0.01)

def __init__(self, long_name: str, scale_factor: SupportsFloat = 0.0001, fill_value: int = -19_999) -> None:
def __init__(
self,
long_name: str,
scale_factor: SupportsFloat = 0.0001,
fill_value: int = -19_999,
) -> None:
function_name = self.name.lower()
index_function: Optional[IndexFunction] = globals().get(function_name)

Expand All @@ -381,9 +386,7 @@ def __call__(self, data: BandData) -> np.ma.masked_array:
# the min/max bounds of an int16 to prevent values wrapping around
int16_info = np.iinfo("int16")
scaled_index = np.ma.clip(
scaled_index,
a_min=int16_info.min,
a_max=int16_info.max
scaled_index, a_min=int16_info.min, a_max=int16_info.max
)

# We need to round to whole numbers (i.e., 0 decimal places, which is
Expand Down

0 comments on commit 9251992

Please sign in to comment.