From 27de095dd03260bdb9f5715ba3f03eab53b729e7 Mon Sep 17 00:00:00 2001 From: Liangjie Lu <49219970+jacklj9811@users.noreply.github.com> Date: Sat, 24 Feb 2024 11:25:41 -0800 Subject: [PATCH] Update usage.md Set up a new variable search_product to store the result of search.get_products(). The following search.get_layers() could thus function normally. --- docs/usage.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index ddbf366..c6884dd 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -45,14 +45,14 @@ search: List[Product] = ProductSearch( versions=[ProductVersion.lf_2020], themes=[ProductTheme.vegetation] ) -search = search.get_products() +search_products = search.get_products() # ...returns 3 Products ``` The result of the example is a list of `Products`. Each `Product` is a [pydantic][pydantic] model and thus its fields can be accessed with dot notation: ```python -for product in search: print(product.name) +for product in search_products: print(product.name) # existing vegetation cover 2022 # existing vegetation height 2022 # existing vegetation type 2020 @@ -62,7 +62,7 @@ Each `Product` also has a list of `Availability` models that provides informatio ```python # Grab the first product (existing vegetation cover 2022), and first availability object (LANDFIRE 2020): -search[0].availability[0] +search_products[0].availability[0] # ...returns # ProductAvailability(version=, # regions=[,