Skip to content

Commit

Permalink
updating docstring and adding warning when using default_assets
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan McCarthy committed Sep 3, 2024
1 parent 258cfe0 commit 71d5c59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion rio_tiler/io/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,12 @@ def tile(
if expression:
assets = self.parse_expression(expression, asset_as_band=asset_as_band)

assets = assets or self.default_assets
if not assets and self.default_assets:
warnings.warn(
f"No assets/expression passed, defaults to {self.default_assets}",
UserWarning,
)
assets = self.default_assets

if not assets:
raise MissingAssets(
Expand Down
2 changes: 1 addition & 1 deletion rio_tiler/io/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class STACReader(MultiBaseReader):
exclude_assets (set of string, optional): Exclude specific assets.
include_asset_types (set of string, optional): Only include some assets base on their type.
exclude_asset_types (set of string, optional): Exclude some assets base on their type.
default_assets (set of string, optional): Default assets to use if none are defined.
default_assets (list of string, optional): Default assets to use if none are defined.
reader (rio_tiler.io.BaseReader, optional): rio-tiler Reader. Defaults to `rio_tiler.io.Reader`.
reader_options (dict, optional): Additional option to forward to the Reader. Defaults to `{}`.
fetch_options (dict, optional): Options to pass to `rio_tiler.io.stac.fetch` function fetching the STAC Items. Defaults to `{}`.
Expand Down

0 comments on commit 71d5c59

Please sign in to comment.