stats generator is created doing gen_zonal_stats() and then the total length of the generator (for tqdm to know) is done doing total=sum(1 for _ in stats). Not sure how I feel about this.
if progress == True, the zonal_stats() function will return the list comprehension using the tqdm module, if not it will return the original generator list-initialization.
Added tqdm in project.optional-dependencies in pyproject.toml.
stats
generator is created doinggen_zonal_stats()
and then the total length of the generator (fortqdm
to know) is done doingtotal=sum(1 for _ in stats)
. Not sure how I feel about this.progress == True
, thezonal_stats()
function will return the list comprehension using thetqdm
module, if not it will return the original generator list-initialization.