Skip to content

Commit

Permalink
Apply black formatting + make ruff happy
Browse files Browse the repository at this point in the history
  • Loading branch information
theroggy committed Nov 3, 2023
1 parent 744162c commit 5521b8c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions benchmarks_zonalstats/benchmarks_pyjeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from pathlib import Path
from typing import List

import os
import pandas as pd
import geopandas as gpd
import pyjeo as pj
Expand All @@ -33,7 +32,7 @@ def _get_package() -> str:


def _get_version() -> str:
nproc = os.environ.get('OMP_NUM_THREADS')
nproc = os.environ.get("OMP_NUM_THREADS")
if nproc is not None:
return f"{pj.__version__} {nproc} threads".replace("v", "")
else:
Expand Down Expand Up @@ -64,7 +63,7 @@ def zonalstats_1band(tmp_dir: Path) -> List[RunResult]:
# rule=["mean", "stdev", "count"],
rule=["mean", "stdev", "sum"],
output="/vsimem/pj.json",
oformat="GeoJSON"
oformat="GeoJSON",
)

print(pd.DataFrame(stats.dict()))
Expand All @@ -79,11 +78,14 @@ def zonalstats_1band(tmp_dir: Path) -> List[RunResult]:
operation_descr=(
f"zonalstats of agri parcels ({nb_poly} polygons) + S2 NDVI BEFL"
),
run_details={}
run_details={},
)
)

logger.info(f"took {secs_taken:.2f}s for {nb_poly} polygons, {stats.properties.getFeatureCount()} results")
logger.info(
f"took {secs_taken:.2f}s for {nb_poly} polygons, "
f"{stats.properties.getFeatureCount()} results"
)

# Return
return results

0 comments on commit 5521b8c

Please sign in to comment.