Skip to content

Commit e26f95b

Browse files
committed
linter formatting
1 parent 3bef3ec commit e26f95b

File tree

5 files changed

+10
-29
lines changed

5 files changed

+10
-29
lines changed

pystac/catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ def save(self, catalog_type=None):
599599
include_self_link = False
600600
# include a self link if this is the root catalog or if ABSOLUTE_PUBLISHED catalog
601601
if ((self.get_self_href() == self.get_root_link().get_absolute_href()
602-
and root.catalog_type != CatalogType.SELF_CONTAINED)
602+
and root.catalog_type != CatalogType.SELF_CONTAINED)
603603
or root.catalog_type == CatalogType.ABSOLUTE_PUBLISHED):
604604
include_self_link = True
605605

pystac/link.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from pystac.stac_io import STAC_IO
55
from pystac.utils import (make_absolute_href, make_relative_href, is_absolute_href)
66

7-
87
HIERARCHICAL_LINKS = ['root', 'child', 'parent', 'collection', 'item', 'items']
98

109

@@ -50,12 +49,7 @@ class Link:
5049
to resolve objects, and will create absolute HREFs from relative HREFs against
5150
the owner's self HREF.
5251
"""
53-
def __init__(self,
54-
rel,
55-
target,
56-
media_type=None,
57-
title=None,
58-
properties=None):
52+
def __init__(self, rel, target, media_type=None, title=None, properties=None):
5953
self.rel = rel
6054
self.target = target # An object or an href
6155
self.media_type = media_type
@@ -204,10 +198,7 @@ def clone(self):
204198
Link: The cloned link.
205199
"""
206200

207-
return Link(rel=self.rel,
208-
target=self.target,
209-
media_type=self.media_type,
210-
title=self.title)
201+
return Link(rel=self.rel, target=self.target, media_type=self.media_type, title=self.title)
211202

212203
@staticmethod
213204
def from_dict(d):
@@ -229,11 +220,7 @@ def from_dict(d):
229220
if any(d):
230221
properties = d
231222

232-
return Link(rel=rel,
233-
target=href,
234-
media_type=media_type,
235-
title=title,
236-
properties=properties)
223+
return Link(rel=rel, target=href, media_type=media_type, title=title, properties=properties)
237224

238225
@staticmethod
239226
def root(c):

tests/test_catalog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
from collections import defaultdict
77

88
import pystac
9-
from pystac import (Catalog, Collection, CatalogType,
10-
Item, Asset, MediaType, Extensions, HIERARCHICAL_LINKS)
9+
from pystac import (Catalog, Collection, CatalogType, Item, Asset, MediaType, Extensions,
10+
HIERARCHICAL_LINKS)
1111
from pystac.extensions.label import LabelClasses
1212
from pystac.validation import STACValidationError
1313
from pystac.utils import is_absolute_href

tests/test_link.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ def test_relative(self):
5656
rel = 'my rel'
5757
target = '../elsewhere'
5858
mime_type = 'example/stac_thing'
59-
link = pystac.Link(rel,
60-
target,
61-
mime_type,
62-
'a title',
63-
properties={'a': 'b'})
59+
link = pystac.Link(rel, target, mime_type, 'a title', properties={'a': 'b'})
6460
expected_dict = {
6561
'rel': rel,
6662
'href': target,

tests/test_writing.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def validate_file(self, path, object_type):
3131
return validate_dict(d, object_type)
3232

3333
def validate_link_types(self, root_href, catalog_type):
34-
3534
def validate_asset_href_type(item, item_href, link_type):
3635
for asset in item.assets.values():
3736
if not is_absolute_href(asset.href):
@@ -110,10 +109,9 @@ def test_testcases(self):
110109
for catalog in TestCases.all_test_catalogs():
111110
catalog = catalog.full_copy()
112111
ctypes = [
113-
CatalogType.ABSOLUTE_PUBLISHED,
114-
CatalogType.RELATIVE_PUBLISHED,
115-
CatalogType.SELF_CONTAINED
116-
]
112+
CatalogType.ABSOLUTE_PUBLISHED, CatalogType.RELATIVE_PUBLISHED,
113+
CatalogType.SELF_CONTAINED
114+
]
117115
for catalog_type in ctypes:
118116
with self.subTest(title='Catalog {} [{}]'.format(catalog.id, catalog_type)):
119117
self.do_test(catalog, catalog_type)

0 commit comments

Comments
 (0)