-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from wri/bugfix/pytest
Bugfix/pytest
- Loading branch information
Showing
9 changed files
with
169 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
earthengine-api==0.1.408 | ||
geocube==0.4.2 | ||
geopandas==0.14.1 | ||
rioxarray==0.15.0 | ||
odc-stac==0.3.8 | ||
pystac-client==0.7.5 | ||
pytest==7.4.3 | ||
xarray-spatial==0.3.7 | ||
xee==0.0.3 | ||
utm==0.7.0 | ||
osmnx==1.9.3 | ||
dask[complete]==2023.11.0 | ||
matplotlib==3.8.2 | ||
s3fs==2024.5.0 | ||
geemap==0.32.0 | ||
pip==23.3.1 | ||
boto3==1.34.124 | ||
scikit-learn==1.5.0 | ||
overturemaps==0.6.0 | ||
git+https://github.com/isciences/exactextract |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Dev CIF API CI/CD | ||
|
||
on: | ||
push: | ||
branches: [ "bugfix/pytest" ] | ||
|
||
permissions: | ||
contents: read | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: ["3.10"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Linux dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y gdal-bin libgdal-dev | ||
- name: Install Packages | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r .github/requirements.txt | ||
pip install GDAL==`gdal-config --version` | ||
- name: Run Tests | ||
env: | ||
GOOGLE_APPLICATION_USER: ${{ secrets.GOOGLE_APPLICATION_USER }} | ||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | ||
run: | | ||
pytest tests |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,37 @@ | ||
from .metrics import * | ||
import os | ||
import ee | ||
import warnings | ||
|
||
import ee | ||
|
||
from .metrics import * | ||
|
||
# initialize ee | ||
if "GOOGLE_APPLICATION_CREDENTIALS" in os.environ and "GOOGLE_APPLICATION_USER" in os.environ: | ||
if ( | ||
"GOOGLE_APPLICATION_CREDENTIALS" in os.environ | ||
and "GOOGLE_APPLICATION_USER" in os.environ | ||
): | ||
print("Authenticating to GEE with configured credentials file.") | ||
CREDENTIAL_FILE = os.environ["GOOGLE_APPLICATION_CREDENTIALS"] | ||
GEE_SERVICE_ACCOUNT = os.environ["GOOGLE_APPLICATION_USER"] | ||
auth = ee.ServiceAccountCredentials(GEE_SERVICE_ACCOUNT, CREDENTIAL_FILE) | ||
ee.Initialize(auth, opt_url='https://earthengine-highvolume.googleapis.com') | ||
if CREDENTIAL_FILE.endswith(".json"): | ||
auth = ee.ServiceAccountCredentials( | ||
GEE_SERVICE_ACCOUNT, key_file=CREDENTIAL_FILE | ||
) | ||
else: | ||
auth = ee.ServiceAccountCredentials( | ||
GEE_SERVICE_ACCOUNT, key_data=CREDENTIAL_FILE | ||
) | ||
ee.Initialize(auth, opt_url="https://earthengine-highvolume.googleapis.com") | ||
else: | ||
print("Could not find GEE credentials file, so prompting authentication.") | ||
ee.Authenticate() | ||
ee.Initialize(opt_url='https://earthengine-highvolume.googleapis.com') | ||
ee.Initialize(opt_url="https://earthengine-highvolume.googleapis.com") | ||
|
||
|
||
# set for AWS requests | ||
os.environ["AWS_REQUEST_PAYER"] = "requester" | ||
|
||
# disable warning messages | ||
warnings.filterwarnings('ignore', module='xee') | ||
warnings.filterwarnings('ignore', module='dask') | ||
warnings.filterwarnings('ignore', module='xarray') | ||
|
||
warnings.filterwarnings("ignore", module="xee") | ||
warnings.filterwarnings("ignore", module="dask") | ||
warnings.filterwarnings("ignore", module="xarray") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
testpaths = tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.