Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#208)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 4, 2025
1 parent 3c6bcc9 commit 966bffc
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: mixed-line-ending

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.8.6"
rev: "v0.9.4"
hooks:
- id: ruff
args: ["--fix"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/mtbs/02_downsampling_and_reprojection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
" resampling = \"mode\"\n",
" else:\n",
" resampling = \"near\"\n",
" cmd = (\"gdalwarp \" \"-t_srs '{}' \" \"-te {} \" \"-tr {} {} \" \"-r {} \" \"{} \" \"{}\").format(\n",
" cmd = (\"gdalwarp -t_srs '{}' -te {} -tr {} {} -r {} {} {}\").format(\n",
" crs,\n",
" extent,\n",
" resolution,\n",
Expand Down
6 changes: 2 additions & 4 deletions scripts/mtbs/05_monthly_downsampling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@
" f = get_file(region, fire, year, month)\n",
" crs, extent = projections(\"albers\", region)\n",
" resampling = \"average\"\n",
" cmd = (\n",
" \"gdalwarp \" \"-t_srs '{}' \" \"-te {} \" \"-tr {} {} \" \"-r {} \" \"{} \" \"{}\"\n",
" ).format(\n",
" cmd = (\"gdalwarp -t_srs '{}' -te {} -tr {} {} -r {} {} {}\").format(\n",
" crs,\n",
" extent,\n",
" resolution,\n",
Expand Down Expand Up @@ -129,7 +127,7 @@
" files = [get_file(\"conus\", \"vlf\", year, month + 1)[\"source\"] for month in range(12)]\n",
" crs, extent = projections(\"albers\", region)\n",
" resampling = \"sum\"\n",
" cmd = (\"gdalwarp \" \"-t_srs '{}' \" \"-te {} \" \"-tr {} {} \" \"-r {} \" \"{} \" \"{}\").format(\n",
" cmd = (\"gdalwarp -t_srs '{}' -te {} -tr {} {} -r {} {} {}\").format(\n",
" crs,\n",
" extent,\n",
" resolution,\n",
Expand Down
2 changes: 1 addition & 1 deletion scripts/mtbs/05_monthly_mtbs_to_zarr.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
" coords = calc_coords(dst_shape, dst_transform, dst_crs)\n",
"\n",
" for month in range(12):\n",
" src_path_month = f\"/Users/freeman/workdir/carbonplan-data/raw/mtbs/conus/30m/area/{year}.{month+1}.tif\"\n",
" src_path_month = f\"/Users/freeman/workdir/carbonplan-data/raw/mtbs/conus/30m/area/{year}.{month + 1}.tif\"\n",
" with rasterio.open(src_path_month, \"r\"):\n",
" src_nodata = 6\n",
" resampling = Resampling.average\n",
Expand Down
2 changes: 1 addition & 1 deletion scripts/mtbs/06_annual_downsampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
print(source)
crs, extent = projections("albers", region)
resampling = "nearest"
cmd = ("gdalwarp " "-t_srs '{}' " "-te {} " "-tr {} {} " "-r {} " "{} " "{}").format(
cmd = ("gdalwarp -t_srs '{}' -te {} -tr {} {} -r {} {} {}").format(
crs,
extent,
resolution,
Expand Down
6 changes: 2 additions & 4 deletions scripts/nftd/02_downsampling_and_reprojection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
" resampling = \"mode\"\n",
" else:\n",
" resampling = \"near\"\n",
" cmd = (\"gdalwarp \" \"-t_srs '{}' \" \"-te {} \" \"-tr {} {} \" \"-r {} \" \"{} \" \"{}\").format(\n",
" cmd = (\"gdalwarp -t_srs '{}' -te {} -tr {} {} -r {} {} {}\").format(\n",
" crs,\n",
" extent,\n",
" resolution,\n",
Expand Down Expand Up @@ -185,9 +185,7 @@
" with rasterio.open(\"./thresholded.tif\", \"w\", **profile) as dst:\n",
" dst.write(out, 1)\n",
"\n",
" cmd = (\n",
" \"gdalwarp \" \"-t_srs '{}' \" \"-te {} \" \"-tr {} {} \" \"-r {} \" \"-ot Float32 \" \"{} \" \"{}\"\n",
" ).format(\n",
" cmd = (\"gdalwarp -t_srs '{}' -te {} -tr {} {} -r {} -ot Float32 {} {}\").format(\n",
" crs,\n",
" extent,\n",
" resolution,\n",
Expand Down
13 changes: 2 additions & 11 deletions scripts/nlcd/02_downsampling_and_reprojection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
" resampling = \"near\"\n",
" else:\n",
" resampling = \"mode\"\n",
" cmd = (\"gdalwarp \" \"-t_srs '{}' \" \"-te {} \" \"-tr {} {} \" \"-r {} \" \"{} \" \"{}\").format(\n",
" cmd = (\"gdalwarp -t_srs '{}' -te {} -tr {} {} -r {} {} {}\").format(\n",
" crs,\n",
" extent,\n",
" resolution,\n",
Expand Down Expand Up @@ -206,16 +206,7 @@
" with rasterio.open(\"./thresholded.tif\", \"w\", **profile) as dst:\n",
" dst.write(out, 1)\n",
"\n",
" cmd = (\n",
" \"gdalwarp \"\n",
" \"-t_srs '{}' \"\n",
" \"-te {} \"\n",
" \"-tr {} {} \"\n",
" \"-r {} \"\n",
" \"-ot Float32 \"\n",
" \"{} \"\n",
" \"{}\"\n",
" ).format(\n",
" cmd = (\"gdalwarp -t_srs '{}' -te {} -tr {} {} -r {} -ot Float32 {} {}\").format(\n",
" crs,\n",
" extent,\n",
" resolution,\n",
Expand Down

0 comments on commit 966bffc

Please sign in to comment.