Skip to content

Commit c3ef53d

Browse files
committed
Respond to PR review
1 parent 9a7d4bc commit c3ef53d

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

pystac/extensions/classification.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
)
1818

1919
import pystac
20+
import pystac.extensions.item_assets as item_assets
2021
from pystac.extensions.base import (
2122
ExtensionManagementMixin,
2223
PropertiesExtension,
2324
SummariesExtension,
2425
)
2526
from pystac.extensions.hooks import ExtensionHooks
26-
import pystac.extensions.item_assets as item_assets
2727
from pystac.extensions.raster import RasterBand
2828
from pystac.serialization.identify import STACJSONDescription, STACVersionID
2929
from pystac.utils import get_required, map_opt
@@ -86,8 +86,7 @@ def apply(
8686
), "Must format color hints as '^([0-9A-F]{6})$'"
8787

8888
if color_hint is not None:
89-
color_hint_pattern = re.compile("^([0-9A-F]{6})$")
90-
match = color_hint_pattern.match(color_hint)
89+
match = COLOR_HINT_PATTERN.match(color_hint)
9190
assert (
9291
color_hint is None or match is not None and match.group() == color_hint
9392
), "Must format color hints as '^([0-9A-F]{6})$'"

tests/extensions/test_classification.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
from copy import deepcopy
2-
from datetime import datetime
3-
from dateutil.parser import parse
41
import json
52
import logging
3+
from copy import deepcopy
4+
from datetime import datetime
65
from typing import Any, Dict, List, cast
76

7+
import pytest
8+
from dateutil.parser import parse
9+
810
import pystac
911
from pystac import Collection, Item
1012
from pystac.extensions.classification import (
11-
Bitfield,
1213
CLASSES_PROP,
14+
Bitfield,
1315
Classification,
1416
ClassificationExtension,
1517
)
1618
from pystac.extensions.item_assets import ItemAssetsExtension
1719
from pystac.extensions.raster import RasterBand, RasterExtension
18-
import pytest
1920
from tests.utils import TestCases
2021

2122
logging.basicConfig(level=logging.DEBUG)
@@ -202,14 +203,6 @@ def test_create() -> None:
202203
],
203204
)
204205

205-
assert (
206-
field.__repr__() == "<Bitfield offset=8 length=2 classes=["
207-
"<Classification value=0 description=No confidence level set>, "
208-
"<Classification value=1 description=Low confidence cloud>, "
209-
"<Classification value=2 description=Medium confidence cloud>, "
210-
"<Classification value=3 description=High confidence cloud>]>"
211-
)
212-
213206
logger.info(field)
214207

215208

0 commit comments

Comments
 (0)