Skip to content

Commit

Permalink
Merge pull request #10 from MAAP-Project/gedi-subset-0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckwondo authored Jun 7, 2022
2 parents 5fca930 + 3b35352 commit 73f1c63
Show file tree
Hide file tree
Showing 8 changed files with 474 additions and 33 deletions.
43 changes: 42 additions & 1 deletion build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,45 @@ basedir=$(dirname "$(readlink -f "$0")")

set -xeuo pipefail

mamba env create -f "${basedir}/environment.yml"
# Make sure conda is up to date
conda update -y -n base -c conda-forge conda

# Install dependencies from lock file for speed and reproducibility
case $(uname) in
Linux)
platform="linux"
;;
Darwin)
platform="osx"
;;
*)
echo >&2 "Unsupported platform: $(uname)"
exit 1
;;
esac

conda create -y -n gedi_subset --file "${basedir}/gedi-subset/conda-${platform}-64.lock"

# Install maap-py, since it cannot be specified in the lock file
conda run --no-capture-output -n gedi_subset pip install "git+https://github.com/MAAP-Project/maap-py.git@1bfa99d#egg=maappy"

# Fail build if finicky mix of fiona and gdal isn't correct, so that we don't
# have to wait to execute a DPS job to find out.
conda run --no-capture-output -n gedi_subset python -c '
import geopandas as gpd
import tempfile
import warnings
from shapely.geometry import Point
# Make sure pip install worked
from maap.maap import MAAP
warnings.filterwarnings("ignore", message=".*initial implementation of Parquet.*")
d = {"col1": ["name1", "name2"], "geometry": [Point(1, 2), Point(2, 1)]}
gdf = gpd.GeoDataFrame(d, crs="EPSG:4326")
with tempfile.TemporaryFile() as fp:
gdf.to_parquet(fp)
assert gdf.equals(gpd.read_parquet(fp))
'
23 changes: 11 additions & 12 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
name: gedi_subset
channels:
- defaults
- conda-forge
- defaults
dependencies:
- python=3.10
- boto3
- cachetools
- gdal>=3.4
- geopandas
- h5py
- pyarrow
- returns
- shapely
- typer
- python==3.10.4
- boto3==1.24.1
- cachetools==5.0.0
- returns==0.19.0
- typer==0.4.1
- geopandas==0.10.2
- h5py==3.6.0
- pyarrow==8.0.0
- shapely==1.8.2
- pip
- pip:
- git+https://github.com/MAAP-Project/maap-py.git#egg=maappy
- git+https://github.com/MAAP-Project/maap-py.git@1bfa99d#egg=maappy
18 changes: 17 additions & 1 deletion gedi-subset/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,23 @@ variation of [Semantic Versioning], with the following difference: each version
is prefixed with `gedi-subset-` (e.g., `gedi-subset-0.1.0`) to allow for
distinct lines of versioning of independent work in sibling directories.

## [gedi-subset-0.2.0] - 2022-06-01
## [gedi-subset-0.2.1] - 2022-06-07

Hotfix replacement for `gedi-subset-0.2.0`.

### Fixed

- Resolved the following runtime error during DPS job execution that occurs with
version `gedi-subset-0.2.0`:

```plain
ImportError: Missing optional dependency 'pyarrow.parquet'.
```

This appears to be due to a recent release of one or more unpinned transitive
dependencies. This was resolved with a `conda` lock file.

## [gedi-subset-0.2.0] - 2022-06-01 [YANKED]

## Added

Expand Down
14 changes: 5 additions & 9 deletions gedi-subset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,9 @@ To run a GEDI subsetting DPS job, you must supply the following inputs:
- `limit`: Maximum number of GEDI granule data files to download (among those
that intersect the specified AOI). (**Default:** 10,000)

**IMPORTANT:** When supplying input values via the ADE UI, for convenience, to
accept _all_ default values, you may leave _all_ optional inputs blank.
However, if you supply a value for _any_ optional input, you must enter a dash
(`-`) as the input value for _all other_ optional inputs. This ensures that
the input values remain correctly ordered for the underlying script to which the
inputs are supplied. Otherwise, your job may fail due to invalid script
arguments, or might produce unpredictable results.
**IMPORTANT:** When supplying input values via the ADE UI, to accept a default
input value, enter a dash (`-`) as the input value, otherwise the UI will show
an error message if you leave any input blank.

If your AOI is a publicly available geoBoundary, see
[Getting the GeoJSON URL for a geoBoundary](#getting-the-geojson-url-for-a-geoboundary)
Expand Down Expand Up @@ -249,8 +245,8 @@ able to register the new version of the algorithm, as follows, within the ADE:
1. Pull the latest code from GitHub (to obtain merged PR, if necessary):

```bash
git pull origin main
git checkout main
git pull origin
```

1. Push the latest code to GitLab (replace `ade` with the appropriate remote
Expand All @@ -268,7 +264,7 @@ able to register the new version of the algorithm, as follows, within the ADE:
1. Confirm that the value of the **version** field matches the GitHub release
version you created above. If not, click **Cancel** and review earlier
steps. If so, click **Ok**, which will trigger a build job that will take
several minutes.
about 30 minutes.
1. Check the build job status at
<https://repo.ops.maap-project.org/root/register-job/-/jobs>. If the job
fails, you will need to correct the issue (and likely create a patch release,
Expand Down
2 changes: 1 addition & 1 deletion gedi-subset/algorithm_config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description: Subset GEDI L4A granules within an area of interest (AOI)
algo_name: gedi-subset
version: gedi-subset-0.2.0
version: gedi-subset-0.2.1
environment: ubuntu
repository_url: https://repo.ops.maap-project.org/data-team/maap-documentation-examples.git
docker_url: mas.maap-project.org:5000/root/ade-base-images/r:latest
Expand Down
Loading

0 comments on commit 73f1c63

Please sign in to comment.