Skip to content

Commit 64cf7b4

Browse files
committed
black
1 parent 74ad790 commit 64cf7b4

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

src/actinia/mapset.py

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ def list_mapsets_request(
191191
timeout=actinia.timeout,
192192
)["process_results"]
193193
return {
194-
mname: Mapset(mname, location_name, actinia, auth) for mname in mapset_names
194+
mname: Mapset(mname, location_name, actinia, auth)
195+
for mname in mapset_names
195196
}
196197

197198
@classmethod
@@ -222,7 +223,9 @@ def create_mapset_request(
222223
223224
"""
224225
# check if mapset exists
225-
existing_mapsets = cls.list_mapsets_request(location_name, actinia, auth)
226+
existing_mapsets = cls.list_mapsets_request(
227+
location_name, actinia, auth
228+
)
226229
if mapset_name in existing_mapsets:
227230
log.warning(f"Mapset <{mapset_name}> already exists.")
228231
return existing_mapsets[mapset_name]
@@ -254,9 +257,13 @@ def delete_mapset_request(
254257
255258
"""
256259
# check if mapset exists
257-
existing_mapsets = cls.list_mapsets_request(location_name, actinia, auth)
260+
existing_mapsets = cls.list_mapsets_request(
261+
location_name, actinia, auth
262+
)
258263
if mapset_name not in existing_mapsets:
259-
log.warning(f"Mapset <{mapset_name}> does not exist and cannot be deleted.")
264+
log.warning(
265+
f"Mapset <{mapset_name}> does not exist and cannot be deleted."
266+
)
260267
return
261268

262269
url = cls.__request_url(actinia.url, location_name, mapset_name)
@@ -476,7 +483,9 @@ def upload_vector(self, layer_name: str, vector_file: str) -> None:
476483
and text if request fails.
477484
478485
"""
479-
files = {"file": (vector_file, Path(vector_file).open("rb"))} # NOQA: SIM115
486+
files = {
487+
"file": (vector_file, Path(vector_file).open("rb"))
488+
} # NOQA: SIM115
480489
url = (
481490
f"{self.__actinia.url}/locations/{self.__location_name}/"
482491
f"mapsets/{self.name}/vector_layers/{layer_name}"
@@ -573,7 +582,9 @@ def __check_strds_existence(self, strds_name: str) -> None:
573582
msg = f"SpaceTimeRasterDataset <{strds_name}> does not exist"
574583
raise RuntimeError(msg)
575584

576-
def get_strds(self, *, force: bool = False) -> list[SpaceTimeRasterDataset]:
585+
def get_strds(
586+
self, *, force: bool = False
587+
) -> list[SpaceTimeRasterDataset]:
577588
"""Return SpaceTimeRasterDatasets of the given mapsets.
578589
579590
Parameters
@@ -583,7 +594,8 @@ def get_strds(self, *, force: bool = False) -> list[SpaceTimeRasterDataset]:
583594
584595
Returns
585596
-------
586-
dict[SpaceTimeRasterDataset: str]: A dict with the SpaceTimeRasterDatasets
597+
strds: dict[SpaceTimeRasterDataset: str]
598+
A dict with the SpaceTimeRasterDatasets
587599
588600
"""
589601
if self.strds is None or force is True:
@@ -772,7 +784,9 @@ def compute_strds_statistics(
772784
url += f"sampling_{'a' if async_request else ''}sync"
773785
return request_and_check("POST", url, **postkwargs)
774786

775-
def create_processing_job(self, pc: str | dict, name: Optional(str) = None) -> Job:
787+
def create_processing_job(
788+
self, pc: str | dict, name: Optional(str) = None
789+
) -> Job:
776790
"""Create a processing job with a given processing chain.
777791
778792
Parameters
@@ -826,7 +840,7 @@ def create_processing_job(self, pc: str | dict, name: Optional(str) = None) -> J
826840
# TODO: # NOQA: FIX002, TD002, TD003
827841
# * /locations/{location_name}/mapsets/{mapset_name}/processing - POST
828842
# * /locations/{location_name}/mapsets/{mapset_name}/processing_async - POST
829-
# * /locations/{location_name}/mapsets/{mapset_name}/lock - GET, DELETE, POST
830-
# * /locations/{location_name}/mapsets/{mapset_name}/raster_layers - DELETE, PUT
843+
# * /locations/{location_name}/mapsets/{mapset_name}/lock - GET/DELETE/POST
844+
# * /locations/{location_name}/mapsets/{mapset_name}/raster_layers - DELETE/PUT
831845
# * /locations/{location_name}/mapsets/{mapset_name}/strds - GET
832846
# * /locations/{location_name}/mapsets/{mapset_name}/vector_layers

0 commit comments

Comments
 (0)