Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search improvements #267

Merged
merged 9 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
run: poetry install
- name: Build docs
run: poetry run bash scripts/build-docs.sh
env:
EARTHDATA_USERNAME: ${{ secrets.EDL_USERNAME }}
EARTHDATA_PASSWORD: ${{ secrets.EDL_PASSWORD }}

- name: Deploy
if: |
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Integration Tests

on:
push:
branches:
- main
paths:
- earthaccess/**
- tests/**
- docs/**
- binder/**

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', '3.11']
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Get full python version
id: full-python-version
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v1
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- name: Install Dependencies
run: poetry install
- name: Test
env:
EARTHDATA_USERNAME: ${{ secrets.EDL_USERNAME }}
EARTHDATA_PASSWORD: ${{ secrets.EDL_PASSWORD }}
EARTHACCESS_TEST_USERNAME: ${{ secrets.EDL_USERNAME }}
EARTHACCESS_TEST_PASSWORD: ${{ secrets.EDL_PASSWORD }}
run: poetry run bash scripts/integration-test.sh
- name: Upload coverage
uses: codecov/codecov-action@v1
7 changes: 1 addition & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: Unit Tests

on:
push:
Expand Down Expand Up @@ -46,11 +46,6 @@ jobs:
- name: Install Dependencies
run: poetry install
- name: Test
env:
EARTHDATA_USERNAME: ${{ secrets.EDL_USERNAME }}
EARTHDATA_PASSWORD: ${{ secrets.EDL_PASSWORD }}
EARTHACCESS_TEST_USERNAME: ${{ secrets.EDL_USERNAME }}
EARTHACCESS_TEST_PASSWORD: ${{ secrets.EDL_PASSWORD }}
run: poetry run bash scripts/test.sh
- name: Upload coverage
uses: codecov/codecov-action@v1
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## Unreleased
* bug fixes:
* granule's size() returned zero
* Added exception handling for fsspec sessions, thanks to @jrbourbeau
* CI changes:
* integration tests are now only run when we push to main (after a merge)
* unit tests run for any branch and opened PR

## [v0.5.2] 2023-04-21
* bug fixes:
* Fixing #230 by removing Benedict as the dict handler, thanks to @psarka!
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@
<img src="https://img.shields.io/pypi/v/earthaccess?color=%2334D058&label=pypi%20package" alt="Package version">
</a>

<a href="https://anaconda.org/conda-forge/earthaccess" target="_blank">
<img src="https://img.shields.io/conda/vn/conda-forge/earthaccess.svg" alt="Conda Versions">
</a>

<a href="https://pypi.org/project/earthaccess/" target="_blank">
<img src="https://img.shields.io/pypi/pyversions/earthaccess.svg" alt="Python Versions">
</a>

<a href='https://earthdata.readthedocs.io/en/latest/?badge=latest'>
<img src='https://readthedocs.org/projects/earthaccess/badge/?version=latest' alt='Documentation Status' />
<img src='https://readthedocs.org/projects/earthdata/badge/?version=latest' alt='Documentation Status' />
</a>

</p>
Expand Down Expand Up @@ -94,12 +98,11 @@ If we are not sure or we don't know how to search for a particular dataset, we c
```python

results = earthaccess.search_data(
short_name='ATL06',
version="005",
short_name='SEA_SURFACE_HEIGHT_ALT_GRIDS_L4_2SATS_5DAY_6THDEG_V_JPL2205',
cloud_hosted=True,
bounding_box=(-10, 20, 10, 50),
temporal=("2020-02", "2020-03"),
count=100
temporal=("1999-02", "2019-03"),
count=10
)


Expand Down Expand Up @@ -140,7 +143,9 @@ This method works best if you are in the same Amazon Web Services (AWS) region a
```python
import xarray as xr

ds = xr.open_mfdataset(earthaccess.open(results))
files = earthaccess.open(results)

ds = xr.open_mfdataset(files)

```

Expand Down
1 change: 1 addition & 0 deletions docs/CONTRIBUTING.md
6 changes: 6 additions & 0 deletions docs/tutorials/authenticate.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
## Authenticate with Earthdata Login

earthaccess can use environment variables, `.netrc` file or interactive input from a user to login with NASA EDL.

If a strategy is not especified, env vars will be used first, then netrc and finally user's input.

```py
import earthaccess

auth = earthaccess.login()
```

If you have a .netrc file with your Earthdata Login credentials
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.14"
"version": "3.9.16"
}
},
"nbformat": 4,
Expand Down
Loading
Loading