@@ -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 )
6667class 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