Skip to content

Commit aa76c8d

Browse files
author
Jon Duckworth
authored
Merge pull request #514 from l0b0/refactor/remove-str-methods
chore: Remove unused `__str__` methods
2 parents 726be1e + 8b969ac commit aa76c8d

File tree

14 files changed

+12
-57
lines changed

14 files changed

+12
-57
lines changed

pystac/catalog.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737

3838

3939
class CatalogType(str, Enum):
40-
def __str__(self) -> str:
41-
return str(self.value)
42-
4340
SELF_CONTAINED = "SELF_CONTAINED"
4441
"""A 'self-contained catalog' is one that is designed for portability.
4542
Users may want to download an online catalog from and be able to use it on their

pystac/collection.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,6 @@ def from_items(
412412
class ProviderRole(str, Enum):
413413
"""Enumerates the allows values of the Provider "role" field."""
414414

415-
def __str__(self) -> str:
416-
return str(self.value)
417-
418415
LICENSOR = "licensor"
419416
PRODUCER = "producer"
420417
PROCESSOR = "processor"

pystac/extensions/file.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ class ByteOrder(str, Enum):
3030
"""List of allows values for the ``"file:byte_order"`` field defined by the
3131
:stac-ext:`File Info Extension <file>`."""
3232

33-
def __str__(self) -> str:
34-
return str(self.value)
35-
3633
LITTLE_ENDIAN = "little-endian"
3734
BIG_ENDIAN = "big-endian"
3835

pystac/extensions/label.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,13 @@ class LabelRelType(str, Enum):
3232
documentation for details.
3333
"""
3434

35-
def __str__(self) -> str:
36-
return str(self.value)
37-
3835
SOURCE = "source"
3936
"""Used to indicate a link to the source item to which a label item applies."""
4037

4138

4239
class LabelType(str, Enum):
4340
"""Enumerates valid label types ("raster" or "vector")."""
4441

45-
def __str__(self) -> str:
46-
return str(self.value)
47-
4842
VECTOR = "vector"
4943
RASTER = "raster"
5044

@@ -55,9 +49,6 @@ def __str__(self) -> str:
5549
class LabelTask(str, Enum):
5650
"""Enumerates recommended values for "label:tasks" field."""
5751

58-
def __str__(self) -> str:
59-
return str(self.value)
60-
6152
REGRESSION = "regression"
6253
CLASSIFICATION = "classification"
6354
DETECTION = "detection"
@@ -67,9 +58,6 @@ def __str__(self) -> str:
6758
class LabelMethod(str, Enum):
6859
"""Enumerates recommended values for "label:methods" field."""
6960

70-
def __str__(self) -> str:
71-
return str(self.value)
72-
7361
AUTOMATED = "automated"
7462
MANUAL = "manual"
7563

pystac/extensions/raster.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,11 @@
2020

2121

2222
class Sampling(str, enum.Enum):
23-
def __str__(self) -> str:
24-
return str(self.value)
25-
2623
AREA = "area"
2724
POINT = "point"
2825

2926

3027
class DataType(str, enum.Enum):
31-
def __str__(self) -> str:
32-
return str(self.value)
33-
3428
INT8 = "int8"
3529
INT16 = "int16"
3630
INT32 = "int32"

pystac/extensions/scientific.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ class ScientificRelType(str, Enum):
4242
<scientific#relation-types>` documentation for details.
4343
"""
4444

45-
def __str__(self) -> str:
46-
return str(self.value)
47-
4845
CITE_AS = "cite-as"
4946
"""Used to indicate a link to the publication referenced by the ``sci:doi``
5047
field."""

pystac/extensions/version.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ class VersionRelType(str, Enum):
3030
<https://github.com/stac-extensions/version#relation-types>`__ documentation
3131
for details."""
3232

33-
def __str__(self) -> str:
34-
return str(self.value)
35-
3633
LATEST = "latest-version"
3734
"""Indicates a link pointing to a resource containing the latest version."""
3835

pystac/media_type.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
class MediaType(str, Enum):
55
"""A list of common media types that can be used in STAC Asset and Link metadata."""
66

7-
def __str__(self) -> str:
8-
return str(self.value)
9-
107
COG = "image/tiff; application=geotiff; profile=cloud-optimized"
118
GEOJSON = "application/geo+json"
129
GEOPACKAGE = "application/geopackage+sqlite3"

pystac/rel_type.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ class RelType(str, Enum):
1212
specific to those STAC objects.
1313
"""
1414

15-
def __str__(self) -> str:
16-
return str(self.value)
17-
1815
ALTERNATE = "alternate"
1916
CANONICAL = "canonical"
2017
CHILD = "child"

pystac/stac_object.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212

1313

1414
class STACObjectType(str, Enum):
15-
def __str__(self) -> str:
16-
return str(self.value)
17-
1815
CATALOG = "Catalog"
1916
COLLECTION = "Collection"
2017
ITEM = "Feature"

0 commit comments

Comments
 (0)