Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion geemap/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ def image_histogram(
min_bucket_width: float,
max_raw: int,
max_pixels: int,
reducer_args: dict[str, Any] = {},
reducer_args: dict[str, Any] | None = None,
**kwargs: dict[str, Any],
) -> bq.Figure:
"""Creates a histogram for each band of the specified image within the given region.
Expand All @@ -1576,6 +1576,9 @@ def image_histogram(
Returns:
The bqplot figure containing the histograms.
"""
if reducer_args is None:
reducer_args = {}

# Calculate the histogram data.
histogram = image.reduceRegion(
reducer=ee.Reducer.histogram(
Expand Down
10 changes: 8 additions & 2 deletions geemap/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3857,7 +3857,7 @@ def search_ee_data(
regex: bool = False,
source: str = "ee",
types=None,
keys: list[str] = ["id", "provider", "tags", "title"],
keys: list[str] | None = None,
):
"""Searches Earth Engine data catalog.

Expand All @@ -3875,6 +3875,9 @@ def search_ee_data(
Returns:
list: Returns a list of assets.
"""
if keys is None:
keys = ["id", "provider", "tags", "title"]

if isinstance(keywords, str):
keywords = keywords.split(" ")

Expand Down Expand Up @@ -12457,7 +12460,7 @@ def download_ee_image_tiles_parallel(
scale_offset: bool = False,
unmask_value: float | None = None,
column: str | None = None,
job_args: dict[str, Any] = {"n_jobs": -1},
job_args: dict[str, Any] | None = None,
ee_init: bool = True,
project_id: str | None = None,
**kwargs,
Expand Down Expand Up @@ -12500,6 +12503,9 @@ def download_ee_image_tiles_parallel(
"""
import joblib

if job_args is None:
job_args = {"n_jobs": -1}

start = time.time()

if not isinstance(features, ee.FeatureCollection):
Expand Down
5 changes: 2 additions & 3 deletions geemap/deck.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,15 @@ def add_layer(self, layer, layer_name: str | None = None, **kwargs) -> None:
def add_ee_layer(
self,
ee_object,
# TODO(schwehr): Do not use a mutable object as the default.
vis_params: dict[Any, Any] = {},
vis_params: dict[Any, Any] | None = None,
name: str | None = None,
**kwargs,
):
"""Adds a given EE object to the map as a layer.

Args:
ee_object (Collection|Feature|Image|MapId): The object to add to the map.
vis_params: The visualization parameters. Defaults to {}.
vis_params: The visualization parameters. Defaults to None.
name: The name of the layer. Defaults to 'Layer N'.
**kwargs: Additional keyword arguments for the pydeck Layer object.
"""
Expand Down
4 changes: 2 additions & 2 deletions geemap/plotlymap.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def add_tile_layer(
def add_ee_layer(
self,
ee_object,
vis_params={},
vis_params=None,
name: str | None = None,
shown: bool = True,
opacity: float = 1.0,
Expand All @@ -429,7 +429,7 @@ def add_ee_layer(

Args:
ee_object (Collection|Feature|Image|MapId): The object to add to the map.
vis_params (dict, optional): The visualization parameters. Defaults to {}.
vis_params (dict, optional): The visualization parameters. Defaults to None.
name: The name of the layer. Defaults to 'Layer N'.
shown: A flag indicating whether the layer should be on by default.
opacity: The layer's opacity represented as a number between 0 and 1.
Expand Down