Skip to content

Commit fa7f3ee

Browse files
mkdocs strict mode checks. (#1139)
* enable strict mode docs in mkdocs.yml * fix intra-doc link * Update doc strings for strict mkdocs checking. * Fix mangled links. * doc tests need pytest and tooling. Add to noxfile.
1 parent 2bfd1b7 commit fa7f3ee

File tree

9 files changed

+51
-17
lines changed

9 files changed

+51
-17
lines changed

docs/cli/cli-data.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ command will do the same thing as the previous one:
4141
planet data search PSScene --filter filter.json | jq > recent-psscene.json
4242
```
4343

44-
You can read a bit [more about jq]((cli-intro.md#jq) in the CLI intro.
44+
You can read a bit [more about jq](cli-intro.md#jq) in the CLI intro.
4545

4646
### Output to stdin
4747

@@ -412,7 +412,7 @@ Will result in output like:
412412
You can see how the yearly output of Planet has gone up, though it actually went down in 2022 as the upgrade to SuperDove meant much larger swaths, so the number of individual items went down even as we captured the whole earth.
413413

414414
The API does not support an 'all time' interval to get the total of all collections for an area, but
415-
you can easily use [jq]((cli-intro.md#jq) to total up the results of an interval count:
415+
you can easily use [jq](cli-intro.md#jq) to total up the results of an interval count:
416416

417417
```sh
418418
curl -s https://raw.githubusercontent.com/ropensci/geojsonio/main/inst/examples/california.geojson \

docs/cli/cli-orders.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The `--pretty` flag is built into most Planet CLI commands, and it formats the J
4242
more readable.
4343

4444
You can also use `jq`, a powerful command-line JSON-processing tool, that is mentioned in
45-
the [CLI introduction]((cli-intro.md#jq).
45+
the [CLI introduction](cli-intro.md#jq).
4646

4747
```sh
4848
planet orders list | jq
@@ -635,6 +635,7 @@ To clip and composite you need to specify the clip in the tools (instead of `--c
635635
not use `--clip` and `--tools` in the same call. There is not yet CLI calls to generate the `tools.json`,
636636
so you can just use the [following json](https://raw.githubusercontent.com/planetlabs/planet-client-python/main/docs/cli/request-json/tools-clip-composite.json):
637637

638+
<a name="geometry.geojson"></a>
638639
```json
639640
[
640641
{
@@ -882,7 +883,7 @@ planet orders request \
882883
```
883884

884885
Or get the 5 latest cloud free images in an area and create an order that clips to that area, using
885-
[geometry.geojson](data/geometry.geojson) from above:
886+
[geometry.geojson](#geometry.geojson) from above:
886887

887888
```sh
888889
ids=$(planet data filter --geom geometry.geojson --range clear_percent gt 90 \

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ site_description: >-
77
repo_name: planetlabs/planet-client-python
88
repo_url: https://github.com/planetlabs/planet-client-python
99
edit_uri: ""
10+
strict: true
1011

1112
theme:
1213
name: 'material'

noxfile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def lint(session):
6868

6969
@nox.session
7070
def docs_test(session):
71-
session.install("-e", ".[docs]")
71+
session.install("-e", ".[docs, test]")
7272

7373
options = session.posargs
7474

@@ -88,6 +88,7 @@ def docs_test(session):
8888

8989
@nox.session
9090
def docs(session):
91+
"""Build documentation locally"""
9192
session.install("-e", ".[docs]")
9293

9394
session.run("mkdocs", "build")

planet/clients/data.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ async def search(
141141
search_filter: Structured search criteria to apply. If None,
142142
no search criteria is applied.
143143
sort: Field and direction to order results by. Valid options are
144-
given in SEARCH_SORT.
144+
given in SEARCH_SORT.
145145
name: The name of the saved search.
146146
limit: Maximum number of results to return. When set to 0, no
147147
maximum is applied.
@@ -368,7 +368,7 @@ async def run_search(self,
368368
Parameters:
369369
search_id: Stored search identifier.
370370
sort: Field and direction to order results by. Valid options are
371-
given in SEARCH_SORT.
371+
given in SEARCH_SORT.
372372
limit: Maximum number of results to return. When set to 0, no
373373
maximum is applied.
374374
@@ -531,7 +531,7 @@ async def get_asset(self,
531531
Raises:
532532
planet.exceptions.APIError: On API error.
533533
planet.exceptions.ClientError: If asset type identifier is not
534-
valid.
534+
valid.
535535
"""
536536
item_type_id = validate_data_item_type(item_type_id)
537537
assets = await self.list_item_assets(item_type_id, item_id)
@@ -554,7 +554,7 @@ async def activate_asset(self, asset: dict):
554554
Raises:
555555
planet.exceptions.APIError: On API error.
556556
planet.exceptions.ClientError: If asset description is not
557-
valid.
557+
valid.
558558
"""
559559
try:
560560
status = asset['status']
@@ -670,7 +670,7 @@ async def download_asset(self,
670670
Raises:
671671
planet.exceptions.APIError: On API error.
672672
planet.exceptions.ClientError: If asset is not active or asset
673-
description is not valid.
673+
description is not valid.
674674
"""
675675
try:
676676
location = asset['location']

planet/clients/subscriptions.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ async def list_subscriptions(self,
113113
limit (int): limit the number of subscriptions in the
114114
results. When set to 0, no maximum is applied.
115115
page_size (int): number of subscriptions to return per page.
116-
TODO: user_id
117116
118117
Datetime args (created, end_time, start_time, updated) can either be a
119118
date-time or an interval, open or closed. Date and time expressions adhere
@@ -132,6 +131,8 @@ async def list_subscriptions(self,
132131
ClientError: on a client error.
133132
"""
134133

134+
# TODO from old doc string, which breaks strict document checking:
135+
# Add Parameter user_id
135136
class _SubscriptionsPager(Paged):
136137
"""Navigates pages of messages about subscriptions."""
137138
ITEMS_KEY = 'subscriptions'
@@ -209,7 +210,7 @@ async def bulk_create_subscriptions(self, requests: List[dict]) -> Dict:
209210
210211
Args:
211212
requests (List[dict]): A list of dictionaries where each dictionary
212-
represents a subscription to be created.
213+
represents a subscription to be created.
213214
214215
Raises:
215216
APIError: If the API returns an error response.
@@ -368,7 +369,6 @@ async def get_results(self,
368369
filter out results with status not in this set.
369370
limit (int): limit the number of subscriptions in the
370371
results. When set to 0, no maximum is applied.
371-
TODO: created, updated, completed, user_id
372372
373373
Yields:
374374
dict: description of a subscription results.
@@ -378,6 +378,8 @@ async def get_results(self,
378378
ClientError: on a client error.
379379
"""
380380

381+
# TODO from old doc string, which breaks strict document checking:
382+
# Add Parameters created, updated, completed, user_id
381383
class _ResultsPager(Paged):
382384
"""Navigates pages of messages about subscription results."""
383385
ITEMS_KEY = 'results'
@@ -415,7 +417,6 @@ async def get_results_csv(
415417
subscription_id (str): id of a subscription.
416418
status (Set[str]): pass result with status in this set,
417419
filter out results with status not in this set.
418-
TODO: created, updated, completed, user_id
419420
420421
Yields:
421422
str: a row from a CSV file.
@@ -424,6 +425,8 @@ async def get_results_csv(
424425
APIError: on an API server error.
425426
ClientError: on a client error.
426427
"""
428+
# TODO from old doc string, which breaks strict document checking:
429+
# Add Parameters created, updated, completed, user_id
427430
url = f'{self._base_url}/{subscription_id}/results'
428431
params = {'status': [val for val in status or {}], 'format': 'csv'}
429432

planet/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def client(self,
456456
A client instance.
457457
458458
Raises:
459-
ClientError when no such client can be had.
459+
planet.exceptions.ClientError: when no such client can be had.
460460
461461
"""
462462
# To avoid circular dependency.

planet/order_request.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,21 @@ def band_math_tool(b1: str,
620620
in these files.
621621
622622
Parameters:
623-
b1-b15: An expression defining how the output band should be computed.
623+
b1: An expression defining how the output band should be computed.
624+
b2: An expression defining how the output band should be computed.
625+
b3: An expression defining how the output band should be computed.
626+
b4: An expression defining how the output band should be computed.
627+
b5: An expression defining how the output band should be computed.
628+
b6: An expression defining how the output band should be computed.
629+
b7: An expression defining how the output band should be computed.
630+
b8: An expression defining how the output band should be computed.
631+
b9: An expression defining how the output band should be computed.
632+
b10: An expression defining how the output band should be computed.
633+
b11: An expression defining how the output band should be computed.
634+
b12: An expression defining how the output band should be computed.
635+
b13: An expression defining how the output band should be computed.
636+
b14: An expression defining how the output band should be computed.
637+
b15: An expression defining how the output band should be computed.
624638
pixel_type: A value indicating what the output pixel type should be.
625639
626640
Raises:

planet/subscription_request.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,21 @@ def band_math_tool(b1: str,
613613
in these files.
614614
615615
Parameters:
616-
b1-b15: An expression defining how the output band should be computed.
616+
b1: An expression defining how the output band should be computed.
617+
b2: An expression defining how the output band should be computed.
618+
b3: An expression defining how the output band should be computed.
619+
b4: An expression defining how the output band should be computed.
620+
b5: An expression defining how the output band should be computed.
621+
b6: An expression defining how the output band should be computed.
622+
b7: An expression defining how the output band should be computed.
623+
b8: An expression defining how the output band should be computed.
624+
b9: An expression defining how the output band should be computed.
625+
b10: An expression defining how the output band should be computed.
626+
b11: An expression defining how the output band should be computed.
627+
b12: An expression defining how the output band should be computed.
628+
b13: An expression defining how the output band should be computed.
629+
b14: An expression defining how the output band should be computed.
630+
b15: An expression defining how the output band should be computed.
617631
pixel_type: A value indicating what the output pixel type should be.
618632
619633
Raises:

0 commit comments

Comments
 (0)