Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

Commit 428562f

Browse files
committed
1 parent aaf8386 commit 428562f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/esa_apex_toolbox/algorithms.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def from_link_object(cls, data: dict) -> UdpLink:
6262
title=data.get("title"),
6363
)
6464

65+
6566
@dataclasses.dataclass(frozen=True)
6667
class ServiceLink:
6768
href: str
@@ -123,23 +124,23 @@ def from_ogc_api_record(cls, src: Union[dict, str, Path]) -> Algorithm:
123124
udp_link = udp_links[0] if udp_links else None
124125

125126
service_links = [ServiceLink.from_link_object(link) for link in links if link.get("rel") == LINK_REL.SERVICE]
126-
if len(udp_links) == 0:
127-
raise InvalidMetadataError("No service links found, the algorithm requires at least one valid service that is known to execute it.")
128-
129-
127+
if len(service_links) == 0:
128+
raise InvalidMetadataError(
129+
"No service links found, the algorithm requires at least one valid service that is known to execute it."
130+
)
130131

131-
pis = [ c for c in properties.get("contacts",[]) if "principal investigator" in c.get("roles",[]) ]
132+
pis = [c for c in properties.get("contacts", []) if "principal investigator" in c.get("roles", [])]
132133
pi_org = pis[0].get("organization", None) if pis else None
133134

134-
service_license = data.get("license",None)
135+
service_license = data.get("license", None)
135136
return cls(
136137
id=data["id"],
137138
title=properties.get("title"),
138139
description=properties.get("description"),
139140
udp_link=udp_link,
140141
service_links=service_links,
141142
license=service_license,
142-
organization = pi_org
143+
organization=pi_org,
143144
)
144145

145146

0 commit comments

Comments
 (0)