Skip to content

Commit

Permalink
ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
jtherrmann committed Jan 11, 2025
1 parent 6e90f6a commit 99507dd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/asf_tools/composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ def make_composite(out_name: str, rasters: list[str], resolution: float | None =
for raster, info in raster_info.items():
log.info(f'Processing raster {raster}')
log.debug(
f"Raster upper left: {info['cornerCoordinates']['upperLeft']}; "
f"lower right: {info['cornerCoordinates']['lowerRight']}"
f'Raster upper left: {info["cornerCoordinates"]["upperLeft"]}; '
f'lower right: {info["cornerCoordinates"]["lowerRight"]}'
)

values = read_as_array(raster)
Expand Down Expand Up @@ -261,7 +261,7 @@ def main():
'-r',
'--resolution',
type=float,
help='Desired output resolution in meters ' '(default is the max resolution of all the input files)',
help='Desired output resolution in meters (default is the max resolution of all the input files)',
)
parser.add_argument('-v', '--verbose', action='store_true', help='Turn on verbose logging')
args = parser.parse_args()
Expand Down
4 changes: 2 additions & 2 deletions src/asf_tools/hydrosar/flood_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def _get_cli(interface: Literal['hyp3', 'main']) -> argparse.ArgumentParser:
'--known-water-threshold',
type=optional_float,
default=None,
help='Threshold for extracting known water area in percent.' ' If `None`, threshold will be calculated.',
help='Threshold for extracting known water area in percent. If `None`, threshold will be calculated.',
)
parser.add_argument(
'--minimization-metric',
Expand Down Expand Up @@ -421,7 +421,7 @@ def _get_cli(interface: Literal['hyp3', 'main']) -> argparse.ArgumentParser:
type=int,
nargs=2,
default=[0, 15],
help='Minimum and maximum bound on the flood depths calculated using the iterative ' 'estimator.',
help='Minimum and maximum bound on the flood depths calculated using the iterative estimator.',
)
else:
raise NotImplementedError(f'Unknown interface: {interface}')
Expand Down
3 changes: 1 addition & 2 deletions src/asf_tools/hydrosar/hand/calculate.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ def main():
'--acc-threshold',
type=none_or_int,
default=100,
help='Accumulation threshold for determining the drainage mask. '
'If `None`, the mean accumulation value is used',
help='Accumulation threshold for determining the drainage mask. If `None`, the mean accumulation value is used',
)

parser.add_argument('-v', '--verbose', action='store_true', help='Turn on verbose logging')
Expand Down
2 changes: 1 addition & 1 deletion src/asf_tools/watermasking/generate_osm_tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def extract_water(water_file, lat, lon, tile_width_deg, tile_height_deg, interio
tile_geojson = tile + '.geojson'

# Extract tile from the main pbf, then convert it to a tif.
bbox = f'--bbox {lon},{lat},{lon+tile_width_deg},{lat+tile_height_deg}'
bbox = f'--bbox {lon},{lat},{lon + tile_width_deg},{lat + tile_height_deg}'
extract_command = f'osmium extract -s smart -S tags=natural=water {bbox} {water_file} -o {tile_pbf}'.split(' ')
export_command = f'osmium export --geometry-types=polygon {tile_pbf} -o {tile_geojson}'.split(' ')
subprocess.run(extract_command)
Expand Down

0 comments on commit 99507dd

Please sign in to comment.