Skip to content

Commit

Permalink
Sandbox image upgrade (#552)
Browse files Browse the repository at this point in the history
* Remove manual setting of variable USE_PYGEOS

* Bump version

* Remove flake8 constraint

* Fix ValueError in subpixel_contours

* Update build system dependencies

* Set crop default to False

* Bump version

* Update setuptools requirement

* Fix apps not available in 2.5.1

* Fix RecursionError in Intertidal_elevation notebook

* Update Change_filmstrips notebook

* Fix recursion error

* Fix crop parameter

* Update window size for lee filter

* Regenerate model file

* Update phenology plotting

* Bump version

* Update readme for tools

* Update conda environment file to match sandbox upgrade

* Update python version for precommit

* Fix parallel_apply

* Remove environment variable USE_PYGEOS
  • Loading branch information
vikineema authored Oct 17, 2024
1 parent 8ed4e48 commit b90b974
Show file tree
Hide file tree
Showing 19 changed files with 1,454 additions and 939 deletions.
64 changes: 27 additions & 37 deletions Real_world_examples/Change_filmstrips.ipynb

Large diffs are not rendered by default.

203 changes: 110 additions & 93 deletions Real_world_examples/Intertidal_elevation.ipynb

Large diffs are not rendered by default.

372 changes: 233 additions & 139 deletions Real_world_examples/Intertidal_elevation_S2.ipynb

Large diffs are not rendered by default.

89 changes: 44 additions & 45 deletions Real_world_examples/Radar_water_detection.ipynb

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 1 addition & 1 deletion Tools/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.10.6
python: python3.10.12

default_stages: [pre-commit, pre-push]

Expand Down
6 changes: 3 additions & 3 deletions Tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ This module is automatically installed on the Digital Earth Africa Sandbox. If f
You can install the latest version of `deafrica-tools` from PyPI using:

```
python -m pip install --extra-index-url="https://packages.dea.ga.gov.au" deafrica-tools
python -m pip install deafrica-tools
```

or install the package directly from the `Tools` directory to incorperate local changes:

```
python -m pip install --extra-index-url="https://packages.dea.ga.gov.au" Tools/
python -m pip install Tools/
```
To install this module from the source on any other system with `pip`:

```
python -m pip install --extra-index-url="https://packages.dea.ga.gov.au" git+https://github.com/digitalearthafrica/deafrica-sandbox-notebooks.git#subdirectory=Tools
python -m pip install git+https://github.com/digitalearthafrica/deafrica-sandbox-notebooks.git#subdirectory=Tools
```


Expand Down
2 changes: 1 addition & 1 deletion Tools/deafrica_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__locales__ = __path__[0] + "/locales"

__version__ = "2.5.2"
__version__ = "2.5.3"


def set_lang(lang=None):
Expand Down
7 changes: 0 additions & 7 deletions Tools/deafrica_tools/app/animations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
Satellite imagery animation widget, which can be used to interactively
produce animations for multiple DE Africa products.
"""

# Force GeoPandas to use Shapely instead of PyGEOS
# In a future release, GeoPandas will switch to using Shapely by default.
import os

os.environ["USE_PYGEOS"] = "0"

import datetime
import itertools
import json
Expand Down
6 changes: 0 additions & 6 deletions Tools/deafrica_tools/areaofinterest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
Function for defining an area of interest using either a point and buffer or a vector file.
"""

# Force GeoPandas to use Shapely instead of PyGEOS
# In a future release, GeoPandas will switch to using Shapely by default.
import os

os.environ["USE_PYGEOS"] = "0"

import geopandas as gpd
from geojson import Feature, FeatureCollection, Point
from shapely.geometry import box
Expand Down
2 changes: 1 addition & 1 deletion Tools/deafrica_tools/datahandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ def parallel_apply(ds, dim, func, *args):
with ProcessPoolExecutor() as executor:

# Apply func in parallel
groups = [group for (i, group) in ds.groupby(dim)]
groups = [group.squeeze(dim=dim) for (i, group) in ds.groupby(dim)]
to_iterate = (groups, *(repeat(i, len(groups)) for i in args))
out_list = list(tqdm(executor.map(func, *to_iterate), total=len(groups)))

Expand Down
Loading

0 comments on commit b90b974

Please sign in to comment.