|
1 |
| -# flake8: noqa |
2 | 1 | from typing import Dict, List, Any, Optional, cast, TYPE_CHECKING
|
3 | 2 |
|
4 | 3 | import pystac
|
@@ -47,17 +46,19 @@ def validate_dict(
|
47 | 46 | ) -> List[Any]:
|
48 | 47 | """Validate a stac object serialized as JSON into a dict.
|
49 | 48 |
|
50 |
| - This method delegates to the call to :meth:`pystac.validation.STACValidator.validate` |
51 |
| - for the STACValidator registered via :meth:`~pystac.validation.set_validator` or |
| 49 | + This method delegates to the call to |
| 50 | + :meth:`pystac.validation.STACValidator.validate` for the STACValidator registered |
| 51 | + via :meth:`~pystac.validation.set_validator` or |
52 | 52 | :class:`~pystac.validation.JsonSchemaSTACValidator` by default.
|
53 | 53 |
|
54 | 54 | Args:
|
55 | 55 | stac_dict : Dictionary that is the STAC json of the object.
|
56 | 56 | stac_object_type : The stac object type of the object encoded in stac_dict.
|
57 | 57 | One of :class:`~pystac.STACObjectType`. If not supplied, this will use
|
58 | 58 | PySTAC's identification logic to identify the object type.
|
59 |
| - stac_version : The version of STAC to validate the object against. If not supplied, |
60 |
| - this will use PySTAC's identification logic to identify the stac version |
| 59 | + stac_version : The version of STAC to validate the object against. If not |
| 60 | + supplied, this will use PySTAC's identification logic to identify the stac |
| 61 | + version |
61 | 62 | extensions : Extension IDs for this stac object. If not supplied,
|
62 | 63 | PySTAC's identification logic to identify the extensions.
|
63 | 64 | href : Optional HREF of the STAC object being validated.
|
@@ -120,8 +121,8 @@ def validate_all(
|
120 | 121 | the StacIO.default() instance is used.
|
121 | 122 |
|
122 | 123 | Raises:
|
123 |
| - STACValidationError: This will raise a STACValidationError if this or any contained |
124 |
| - catalog, collection or item has a validation error. |
| 124 | + STACValidationError: This will raise a STACValidationError if this or any |
| 125 | + contained catalog, collection or item has a validation error. |
125 | 126 | """
|
126 | 127 | if stac_io is None:
|
127 | 128 | stac_io = pystac.StacIO.default()
|
@@ -165,9 +166,10 @@ def get_validator(cls) -> STACValidator:
|
165 | 166 | import jsonschema
|
166 | 167 | except ImportError:
|
167 | 168 | raise Exception(
|
168 |
| - 'Cannot validate with default validator because package "jsonschema" ' |
169 |
| - "is not installed. Install pystac with the validation optional requirements " |
170 |
| - "(e.g. pip install pystac[validation]) to install jsonschema" |
| 169 | + "Cannot validate with default validator because package" |
| 170 | + ' "jsonschema" is not installed. Install pystac with the validation' |
| 171 | + " optional requirements (e.g. pip install pystac[validation]) to" |
| 172 | + " install jsonschema" |
171 | 173 | )
|
172 | 174 | cls._validator = JsonSchemaSTACValidator()
|
173 | 175 |
|
|
0 commit comments