Skip to content

Commit

Permalink
fix black issues
Browse files Browse the repository at this point in the history
  • Loading branch information
katharina-emde committed Nov 8, 2024
1 parent cfffd85 commit 7ab5ef2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
10 changes: 3 additions & 7 deletions src/registration_library/base/colormapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


def hex_to_rgb(hexa):
return tuple(int(hexa[i: i + 2], 16) for i in (0, 2, 4))
return tuple(int(hexa[i : i + 2], 16) for i in (0, 2, 4))


def rgb_to_hex(r, g, b):
Expand Down Expand Up @@ -389,9 +389,7 @@ def to_sld(
sld += f' <ColorMap type="{color_map_type}" extended="{extended}">\n'

for entry in self.entries:
sld += (
f' <ColorMapEntry color="{entry.color_as_hex()}" quantity="{entry.value}"'
)
sld += f' <ColorMapEntry color="{entry.color_as_hex()}" quantity="{entry.value}"'
if entry.opacity or with_opacity:
if entry.opacity:
sld += f' opacity="{entry.opacity}"'
Expand Down Expand Up @@ -422,9 +420,7 @@ def to_sld(
else:
return sld

def to_cpt(
self, title: str = "Default Title", description: str = "Default Description", output_file: str = None
):
def to_cpt(self, title: str = "Default Title", description: str = "Default Description", output_file: str = None):
cpt = ""

if title:
Expand Down
7 changes: 2 additions & 5 deletions src/registration_library/base/gdal.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ def has_georeference(source: str) -> bool:
try:
source_ds = rio_open(source)
log.debug(
f"Checking: {source}\n crs: {source_ds.crs}\n "
f"gcps: {source_ds.crs}\n transform: {source_ds.crs}"
f"Checking: {source}\n crs: {source_ds.crs}\n " f"gcps: {source_ds.crs}\n transform: {source_ds.crs}"
)

if source_ds is not None:
Expand Down Expand Up @@ -190,9 +189,7 @@ def translate(
)
log.info(f">> gdal_translate {translate_options} {source} {translate_output}")

translate_ds = gdal.Translate(
translate_output, source_ds, options=translate_options.replace("-alpha", "")
)
translate_ds = gdal.Translate(translate_output, source_ds, options=translate_options.replace("-alpha", ""))

if color_table:
if isfile(color_table) and access(color_table, R_OK):
Expand Down

0 comments on commit 7ab5ef2

Please sign in to comment.