Skip to content

Commit

Permalink
fix: fix type hint from float to Number
Browse files Browse the repository at this point in the history
  • Loading branch information
nmaarnio committed Sep 18, 2024
1 parent d36dad2 commit 5d93c8c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions eis_toolkit/exploratory_analyses/descriptive_statistics.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from numbers import Number

import geopandas as gpd
import numpy as np
import pandas as pd
Expand All @@ -10,7 +12,9 @@
from eis_toolkit.exceptions import InvalidColumnException, InvalidRasterBandException


def _descriptive_statistics(data: Union[rasterio.io.DatasetReader, pd.DataFrame, gpd.GeoDataFrame]) -> Dict[str, float]:
def _descriptive_statistics(
data: Union[rasterio.io.DatasetReader, pd.DataFrame, gpd.GeoDataFrame]
) -> Dict[str, Number]:
statistics = DescrStatsW(data)
min = np.min(data)
max = np.max(data)
Expand Down Expand Up @@ -69,7 +73,7 @@ def descriptive_statistics_dataframe(


@beartype
def descriptive_statistics_raster(input_data: rasterio.io.DatasetReader, band: int = 1) -> Dict[str, float]:
def descriptive_statistics_raster(input_data: rasterio.io.DatasetReader, band: int = 1) -> Dict[str, Number]:
"""Compute descriptive statistics from raster data.
Computes the following statistics:
Expand Down

0 comments on commit 5d93c8c

Please sign in to comment.