Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ghislainv/geefcc
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainv committed Jun 19, 2024
2 parents af8aff2 + 94e7725 commit 3ece029
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion geefcc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
from .sum_raster_bands import sum_raster_bands
from .misc import make_dir

# GDAL exceptions
# Stop GDAL printing both warnings and errors to STDERR
gdal.PushErrorHandler('CPLQuietErrorHandler')
# GDAL exceptions for errors (warnings won't raise an exception)
gdal.UseExceptions()

# End
2 changes: 1 addition & 1 deletion geefcc/geeic2geotiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def geeic2geotiff(index, extent, ntiles, forest, proj, scale, out_dir):
"""

ofile = os.path.join(out_dir, f"forest_{index}.tif")
if not os.path.isfile(ofile):
if (not os.path.isfile(ofile)) or (os.path.getsize(ofile) == 0):
# Open dataset
ds = (
xr.open_dataset(
Expand Down
2 changes: 1 addition & 1 deletion geefcc/get_fcc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Get forest cover change data."""

import os
import multiprocessing as mp
import multiprocess as mp

from .get_extent_from_aoi import get_extent_from_aoi
from .misc import make_dir
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ numpy
gdal
xarray
xee
multiprocess
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def find_version(pkg_name):
packages=["geefcc", "geefcc/misc"],
package_dir={"geefcc": "geefcc", "misc": "geefcc/misc"},
entry_points={"console_scripts": ["geefcc = geefcc.geefcc:main"]},
install_requires=["numpy", "gdal", "xarray", "xee"],
install_requires=["numpy", "gdal", "xarray", "xee", "multiprocess"],
extras_require={
"interactive": ["cartopy", "rioxarray",
"matplotlib", "geopandas"]},
Expand Down

0 comments on commit 3ece029

Please sign in to comment.