Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion prepare_layers/make_food_current_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
from queue import Queue
from typing import NamedTuple
from osgeo import gdal
gdal.SetCacheMax(4 * 1024 * 1024 * 1024)

import numpy as np
import yirgacheffe as yg
from yirgacheffe.layers import RasterLayer

gdal.SetCacheMax(4 * 1024 * 1024 * 1024)

NULL_CODE = 0
CROP_CODE = 1401
PASTURE_CODE = 1402
Expand Down
10 changes: 5 additions & 5 deletions prepare_species/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def tidy_reproject_save(
target_crs = src_crs #pyproj.CRS.from_string(target_projection)

graw = gdf.loc[0].copy()
grow = aoh.tidy_data(graw)
grow = aoh.tidy_data(graw) # type: ignore
output_path = output_directory_path / f"{grow.id_no}_{grow.season}.geojson"
res = gpd.GeoDataFrame(grow.to_frame().transpose(), crs=src_crs, geometry="geometry")
res_projected = res.to_crs(target_crs)
Expand Down Expand Up @@ -266,7 +266,7 @@ def process_and_save(
if len(geometries_breeding) == 0:
logger.debug("Dropping %s as no breeding geometries", id_no)
return
report.has_breeding_geoemetry = True
report.has_breeding_geometry = True
geometry_breeding = shapely.union_all(geometries_breeding)

geometries_seasons_non_breeding = set(geometries.keys())
Expand All @@ -275,7 +275,7 @@ def process_and_save(
if len(geometries_non_breeding) == 0:
logger.debug("Dropping %s as no non-breeding geometries", id_no)
return
report.has_nonbreeding_geoemetry = True
report.has_nonbreeding_geometry = True
geometry_non_breeding = shapely.union_all(geometries_non_breeding)

habitats_seasons_breeding = set(habitats.keys())
Expand All @@ -286,7 +286,7 @@ def process_and_save(
if len(habitats_breeding) == 0:
logger.debug("Dropping %s as no breeding habitats", id_no)
return
report.has_breeding_habitats = True
report.has_breeding_habitat = True

habitats_seasons_non_breeding = set(habitats.keys())
habitats_seasons_non_breeding.discard(2)
Expand All @@ -296,7 +296,7 @@ def process_and_save(
if len(habitats_non_breeding) == 0:
logger.debug("Dropping %s as no non-breeding habitats", id_no)
return
report.has_nonbreeding_habitats = True
report.has_nonbreeding_habitat = True

gdf = gpd.GeoDataFrame(
[[
Expand Down
2 changes: 1 addition & 1 deletion usecases/query_deltap_psql.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def query_deltap(
e = RasterLayer.empty_raster_layer_like(mask, filename=os.path.join(outputs_path, f"{row.Rsrv_Code}_mask.tif"))
mask.save(e)

query_deltap_per_project(row.Rsrv_Code, row.geometry, mask, corpus, outputs_path)
query_deltap_per_project(str(row.Rsrv_Code), row.geometry, mask, corpus, outputs_path)


def main() -> None:
Expand Down