Skip to content

Commit

Permalink
Change function name to snake case
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Aug 8, 2024
1 parent 307995d commit 1d0d27d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions docs/notebooks/63_charts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"metadata": {},
"outputs": [],
"source": [
"chart.feature_byFeature(features, xProperty, yProperties, **options)"
"chart.feature_by_feature(features, xProperty, yProperties, **options)"
]
},
{
Expand Down Expand Up @@ -311,7 +311,7 @@
"metadata": {},
"outputs": [],
"source": [
"chart.feature_byProperty(features, xProperties, seriesProperty, **options)"
"chart.feature_by_property(features, xProperties, seriesProperty, **options)"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions examples/notebooks/63_charts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"metadata": {},
"outputs": [],
"source": [
"chart.feature_byFeature(features, xProperty, yProperties, **options)"
"chart.feature_by_feature(features, xProperty, yProperties, **options)"
]
},
{
Expand Down Expand Up @@ -311,7 +311,7 @@
"metadata": {},
"outputs": [],
"source": [
"chart.feature_byProperty(features, xProperties, seriesProperty, **options)"
"chart.feature_by_property(features, xProperties, seriesProperty, **options)"
]
},
{
Expand Down
20 changes: 10 additions & 10 deletions geemap/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ def get_data(self, image, region, xProperty, reducer, scale):
return x_data, y_data


def feature_byFeature(
def feature_by_feature(
features: ee.FeatureCollection, xProperty: str, yProperties: list, **kwargs
):
"""Generates a Chart from a set of features. Plots the value of one or more properties for each feature.
Expand All @@ -887,7 +887,7 @@ def feature_byFeature(
raise Exception(e)


def feature_byProperty(
def feature_by_property(
features: ee.FeatureCollection,
xProperties: Union[list, dict],
seriesProperty: str,
Expand Down Expand Up @@ -1097,7 +1097,7 @@ def grow_bin(bin_size, ref):
raise Exception(e)


def image_byClass(
def image_by_class(
image,
classBand,
region,
Expand Down Expand Up @@ -1159,7 +1159,7 @@ def image_byClass(
return fig.chart


def image_byRegion(image, regions, reducer, scale, xProperty, **kwargs):
def image_by_region(image, regions, reducer, scale, xProperty, **kwargs):
"""
Generates a Chart from an image. Extracts and plots band values in one or more regions in the image, with each band in a separate series.
Expand All @@ -1169,7 +1169,7 @@ def image_byRegion(image, regions, reducer, scale, xProperty, **kwargs):
reducer (str | ee.Reducer): The reducer type for zonal statistics. Can be one of 'mean', 'median', 'sum', 'min', 'max', etc.
scale (int): The scale in meters at which to perform the analysis.
xProperty (str): The name of the property in the feature collection to use as the x-axis values.
**kwargs: Additional keyword arguments to be passed to the `feature_byFeature` function.
**kwargs: Additional keyword arguments to be passed to the `feature_by_feature` function.
Returns:
None
Expand All @@ -1180,10 +1180,10 @@ def image_byRegion(image, regions, reducer, scale, xProperty, **kwargs):
)
bands = image.bandNames().getInfo()
df = ee_to_df(fc)[bands + [xProperty]]
feature_byFeature(df, xProperty, bands, **kwargs)
feature_by_feature(df, xProperty, bands, **kwargs)


def image_doySeries(
def image_doy_series(
imageCollection,
region,
regionReducer,
Expand Down Expand Up @@ -1234,7 +1234,7 @@ def image_doySeries(
line_chart.plot_chart()


def image_doySeriesByRegion(
def image_doy_series_by_region(
imageCollection,
bandName,
regions,
Expand Down Expand Up @@ -1281,7 +1281,7 @@ def image_doySeriesByRegion(
line_chart.plot_chart()


def image_doySeriesByYear(
def image_doy_series_by_year(
imageCollection,
bandName,
region,
Expand Down Expand Up @@ -1543,7 +1543,7 @@ def get_stats(image):
return fig


def image_seriesByRegion(
def image_series_by_region(
imageCollection: ee.ImageCollection,
regions: Union[ee.FeatureCollection, ee.Geometry],
reducer: Optional[Union[str, ee.Reducer]] = None,
Expand Down

0 comments on commit 1d0d27d

Please sign in to comment.