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

[WIP] New files for putting icepyx examples on pangeo-gallery #125

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
94acb79
Let travis test everything in icepyx
weiji14 Jun 4, 2020
74dd0e3
Fix test_granule_info
weiji14 Jun 4, 2020
929594e
Fix test_correct_granule_list_returned
weiji14 Jun 8, 2020
8026be1
Reformat CONTRIBUTORS.rst, add myself, fix typo
dshean Jun 16, 2020
58ed1ea
Test everything except behind_NSIDC_API_login.py
weiji14 Jun 16, 2020
16f83e8
add pr builds to travis
JessicaS11 Jun 16, 2020
8da8239
Merge branch 'development' into development
JessicaS11 Jun 16, 2020
f4aee1d
Merge pull request #76 from dshean/development
JessicaS11 Jun 16, 2020
fcbe215
codeblock defined as none is not compatible with pypi markup
loudTom Jun 18, 2020
823cf34
Added T Johnson to list of contributors
loudTom Jun 18, 2020
aefbf6f
Add codecov
Jun 18, 2020
e948fa6
Updated Contributers, added my name
annavalentine Jun 18, 2020
9a7eab6
Add dev requirements and specify travis install
Jun 18, 2020
b71d574
Fix codecov badge links (use icesat2py repo)
Jun 18, 2020
35444ec
Updated installation instructions
loudTom Jun 18, 2020
96bab86
Changed installation instructions on readthedocs
loudTom Jun 18, 2020
ca0b4fe
Merge pull request #84 from icesat2py/anna_dev2
JessicaS11 Jun 18, 2020
7cd1795
Merge branch 'development' into codecov
JessicaS11 Jun 18, 2020
7bf566c
Merge pull request #88 from wallinb/codecov
JessicaS11 Jun 18, 2020
9f25d59
Merge branch 'development' into tj_dev
JessicaS11 Jun 18, 2020
67619f8
Merge pull request #85 from icesat2py/tj_dev
JessicaS11 Jun 18, 2020
9809159
Update codecov badge to point to 'development' branch
wallinb Jun 18, 2020
709cbd0
Merge branch 'development' into tj_docs
JessicaS11 Jun 24, 2020
62ce481
Merge pull request #89 from icesat2py/tj_docs
JessicaS11 Jun 24, 2020
16466f8
Merge branch 'development' into readme-fix
JessicaS11 Jun 24, 2020
98e68fa
Merge pull request #90 from icesat2py/readme-fix
JessicaS11 Jun 24, 2020
9f5e8a4
Merge branch 'development' into travis_test_all
JessicaS11 Jun 26, 2020
82f4aec
Merge pull request #61 from icesat2py/travis_test_all
JessicaS11 Jun 26, 2020
f9d96d1
add try/except for gaierror to address #97 (#98)
tsutterley Jul 6, 2020
6f8103f
add Black (pre-commit hook) and flake8 (PR annotations) runs (#96)
JessicaS11 Jul 7, 2020
af07b77
Docs and travis updates and add pypi build (#95)
JessicaS11 Jul 8, 2020
c711011
change Icesat2data class to Query class (#102)
JessicaS11 Jul 16, 2020
9cf1a59
Add cycles and tracks keywords to address #101 (#103)
tsutterley Jul 22, 2020
69d5a59
fix bounding box assertions to allow crossing dateline (#113)
JessicaS11 Jul 31, 2020
d490ab5
add release notes and update contact info (#115)
JessicaS11 Aug 14, 2020
4b1f9d0
relative imports and import icepyx as ipx (#118)
JessicaS11 Aug 17, 2020
4f5cd54
fix version in setup
JessicaS11 Aug 18, 2020
cc81135
Merge branch 'development' into master
JessicaS11 Aug 18, 2020
30b8489
update master to development (#122)
JessicaS11 Aug 18, 2020
69d7e21
test travis push to PyPI with tagged release (#124)
JessicaS11 Aug 18, 2020
13960f1
fix version (#120)
JessicaS11 Aug 18, 2020
4fdb6fc
fix PyPI build activation with Travis (#126)
JessicaS11 Aug 19, 2020
91ef1e9
fix password info for travis PyPI
JessicaS11 Aug 19, 2020
f293554
add note about authentication settings
JessicaS11 Aug 19, 2020
076e776
[WIP] New files for putting icepyx examples on pangeo-gallery
salvis2 Jul 7, 2020
9067503
Update paths to only build notebooks in the examples/ folder
salvis2 Aug 18, 2020
fe57648
Attempt to use a thumbnail that isn't in the root directory
salvis2 Aug 18, 2020
975ae6c
Use latest ICESat-2 Hackweek image for now
salvis2 Aug 18, 2020
f4dc945
Enable the Action of the development branch
salvis2 Aug 26, 2020
96a6fc3
Enable dev branch for pushes too
salvis2 Aug 26, 2020
5427476
Add newline
salvis2 Aug 26, 2020
b2d44f3
Try looking at the development branch to get a successful test build
salvis2 Aug 27, 2020
d5ef772
Second test of build
salvis2 Aug 27, 2020
88404c9
Newline to pass linting action
salvis2 Aug 27, 2020
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
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[run]
branch = True
source = icepyx
omit =
setup.py
test/*
doc/*
78 changes: 78 additions & 0 deletions .github/workflows/binderbot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Binderbot
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- development
- master
paths:
- 'examples/*.ipynb'
- 'binder-gallery.yaml'
- 'doc/source/_static/icepyx_logo.png'
pull_request:
branches:
- development
- master
paths:
- 'examples/*.ipynb'
- 'binder-gallery.yaml'
- 'doc/source/_static/icepyx_logo.png'

jobs:
build:
name: Binderbot Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: parse config
id: parse
uses: CumulusDS/[email protected]
with:
file: binder-gallery.yaml
gallery_repository: gallery_repository
binder_url: binder_url
binder_repo: binder_repo
binder_ref: binder_ref
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. I think the problem is that the only record of the Dockerfile is on my enable-gallery branch. binder-gallery.yaml is told to look on the master branch for the image information and doesn't find anything, so it gets the error:

ModuleNotFoundError: No module named 'xarray'

Seems like another thing that won't be properly tested until the merge happens.

Would it be possible to set the binder_ref to just point to the branch it is building on? E.g. development in this case.

Might be good to share a link to the pangeo-gallery documentation somewhere, so that others will know how this can be configured in the future.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I can change that for a test to see if it builds correctly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it will help, but you can try to run Github Actions locally using https://github.com/nektos/act. Might be easier than just trial and error pushes to this Pull Request.

binderbot_target_branch: binderbot_target_branch
- name: Verify output
run: |
echo gallery_repository: "${{ steps.parse.outputs.gallery_repository }}"
echo binder_url: "${{ steps.parse.outputs.binder_url }}"
echo binder_repo: "${{ steps.parse.outputs.binder_repo }}"
echo binder_ref: "${{ steps.parse.outputs.binder_ref }}"
echo binderbot_target_branch: "${{ steps.parse.outputs.binderbot_target_branch }}"
- uses: actions/setup-python@v1
with:
python-version: '3.8'
architecture: 'x64'
- name: Install Binderbot from github master
run: pip install git+https://github.com/pangeo-gallery/binderbot.git
- name: Create Clean Branch
run: |
git checkout --orphan ${{ steps.parse.outputs.binderbot_target_branch }}
git rm --cached -r .
- name: Build notebooks using Binderbot
run: |
python -m binderbot.cli \
--binder-url ${{ steps.parse.outputs.binder_url }} \
--repo ${{ steps.parse.outputs.binder_repo }} \
--ref ${{ steps.parse.outputs.binder_ref }} \
examples/*.ipynb
- name: Commit files
if: github.ref == 'refs/heads/master'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add binder-gallery.yaml doc/source/_static/icepyx_logo.png examples/*.ipynb
git commit -m "Binderbot output"
- name: Push commit
if: github.ref == 'refs/heads/master'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.parse.outputs.binderbot_target_branch }}
force: true
- name: Trigger repository dispatch on Pangeo Gallery
if: github.ref == 'refs/heads/master'
run: curl -f https://pangeo-gallery-bot.herokuapp.com/gallery/submodule-dispatch/${{ github.repository }}
Comment on lines +64 to +80
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the if: github.ref == 'refs/heads/master' line(s), it seems that the commit-push-deploy will only happen on the master branch (which is good). Would it make sense then to run this binderbot GIthub Action on Pull Requests targeting both the master and development branches then, so we can test that it works on development too? (See suggestion on other comment).

Would it make sense to add this as part of the test suite (currently done with Travis CI)? It tests both the branch and the PR merge.

I have never really messed with Travis CI, I could probably do it with GitHub Actions though. If you know a bit about Travis, does it seem viable to take the Action in binderbot.yaml and get it in Travis?

It should be fine having both Travis CI and Github Actions CI, a rewrite won't be needed. Travis will run the icepyx unit tests as usual and Github Actions will 'test' that the example gallery can be built correctly.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! I think you are right @weiji14 . It should only run those last three on master, so we might have everything we need if we just add development to the branches for the Action to listen to.

17 changes: 17 additions & 0 deletions .github/workflows/flake8_action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# use the flake8 linter to annotate improperly formatted code
# from: https://github.com/marketplace/actions/run-flake8-on-your-pr-with-annotations
name: Run flake8 linter on PRs

on:
pull_request:
branches:
- development
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Annotate PR after running flake8
uses: TrueBrain/actions-flake8@master
with:
max_line_length: 88
23 changes: 23 additions & 0 deletions .github/workflows/lint_yaml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint Yaml
on:
push:
branches:
- master
paths:
- binder-gallery.yaml
pull_request:
branches:
- master
paths:
- binder-gallery.yaml

jobs:
build:
name: Lint Yaml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: jacobtomlinson/gha-lint-yaml@master
with:
path: binder-gallery.yaml
strict: true
22 changes: 22 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Jessica Scheick <[email protected]>
Jessica Scheick <[email protected]> JessicaS11 <[email protected]>
Jessica Scheick <[email protected]> Jessica <[email protected]>

Zheng Liu <[email protected]>
Zheng Liu <[email protected]> liuzheng-arctic <[email protected]>

Raphael Hagen <[email protected]> raphael <[email protected]>
Fernando Perez <[email protected]>
Shashank Bhushan <[email protected]>
Anthony Arendt <[email protected]>
Scott Henderson <[email protected]>
Wei Ji <[email protected]>
Tom Johnson <[email protected]>
Bruce Wallin <[email protected]> <[email protected]>
Tyler Sutterley <[email protected]>
Amy Steiker <[email protected]> asteiker <[email protected]>
David Shean <[email protected]>
Anna Valentine <[email protected]>
Bidhyananda Yadav <[email protected]>
Friedrich Knuth <[email protected]>

5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/psf/black
rev: stable
hooks:
- id: black
39 changes: 31 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,44 @@
language: python

install:
- pip install -r requirements.txt -r requirements-dev.txt
- pip install -e .

stages:
- name: basic tests
if: type = push
if: type = push OR type = pull_request
- name: behind Earthdata
if: branch = master OR commit_message =~ nsidc_tests OR type = cron

#ultimately move basic tests list into a separate script with the list of files to run (then this can be put into a matrix and paralellized as well)
#ultimately move basic tests list into a separate script with the list of files to run (then this can be put into a matrix and parallellized as well)
jobs:
include:
- stage: basic tests
script: pytest icepyx/tests/test_APIformatting.py
icepyx/tests/test_geospatial.py
icepyx/tests/test_is2ref.py
icepyx/tests/test_validate_inputs.py

script: pytest icepyx/ --ignore icepyx/tests/behind_NSIDC_API_login.py
after_success: codecov

# - stage: behind Earthdata
# script:
# script:
# - export NSIDC_LOGIN=$NSIDC_LOGIN
# - pytest icepyx/tests/behind_NSIDC_API_login.py

deploy:
- provider: pypi
server: https://test.pypi.org/legacy/
username: "__token__"
password: $test_PyPI_API_Token
on:
branch: development
if: commit_message =~ test_pypi
skip_existing: true
distributions: "sdist bdist_wheel"

# NOTE: the API token on Travis must be set to ALL branches, because a tag build is not considered to be on the master branch: https://travis-ci.community/t/pypi-upload-with-api-token-not-working/5338/5
- provider: pypi
username: "__token__"
password: $PyPI_API_Token
on:
branch: master
tags: true
skip_existing: true
distributions: "sdist bdist_wheel"
25 changes: 14 additions & 11 deletions CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ Project Contributors

The following people have made contributions to the project (in alphabetical
order by last name) and are considered "The icepyx Developers":
* [Anthony Arendt](https://github.com/aaarendt/) - University of Washington
* [Shashank Bhushan](https://github.com/ShashankBice) - University of Washington
* [Raphael Hagen](https://github.com/norlandrhagen) - University of Washington
* [Scott Henderson](https://github.com/scottyhq) - University of Washington
* [Zheng Liu](https://github.com/liuzheng-arctic) - University of Washington
* [Joakim Meyer](https://github.com/jomey) - University of Utah
* [Fernando Perez](https://github.com/fperez) - University of California, Berkeley
* [Jessica Scheick](https://github.com/jessicas11) - Unaffiliated (ORCID: [0000-0002-3421-4459](https://www.orcid.org/0000-0002-3421-4459))
* [Ben Smith](https://github.com/smithb) - University of Washington
* [Amy Steiker](https://github.com/asteiker) - NSIDC, University of Colorado
* [Bidhyananda Yadav](https://github.com/bidhya) - Ohio State University

* `Anthony Arendt <https://github.com/aaarendt/>`_ - University of Washington
* `Shashank Bhushan <https://github.com/ShashankBice>`_ - University of Washington
* `Raphael Hagen <https://github.com/norlandrhagen>`_ - University of Washington
* `Scott Henderson <https://github.com/scottyhq>`_ - University of Washington
* `Thomas Johnson <https://github.com/loudTom>`_ - University College London
* `Zheng Liu <https://github.com/liuzheng-arctic>`_ - University of Washington
* `Joachim Meyer <https://github.com/jomey>`_ - University of Utah
* `Fernando Perez <https://github.com/fperez>`_ - University of California, Berkeley
* `Jessica Scheick <https://github.com/jessicas11>`_ - Unaffiliated (ORCID: `0000-0002-3421-4459 <https://www.orcid.org/0000-0002-3421-4459>`_)
* `David Shean <https://github.com/dshean>`_ - University of Washington
* `Ben Smith <https://github.com/smithb>`_ - University of Washington
* `Amy Steiker <https://github.com/asteiker>`_ - NSIDC, University of Colorado
* `Bidhyananda Yadav <https://github.com/bidhya>`_ - Ohio State University
* `Anna Valentine <https://github.com/annavalentine>`_ - Colorado School of Mines
50 changes: 37 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ icepyx

**Python tools for obtaining and working with ICESat-2 data**

|Documentation Status| |GitHub license| |Travis CI Status|
|Documentation Status| |GitHub license| |Travis CI Status| |Code Coverage|

.. |Documentation Status| image:: https://readthedocs.org/projects/icepyx/badge/?version=latest
:target: http://icepyx.readthedocs.io/?badge=latest
Expand All @@ -14,6 +14,9 @@ icepyx
.. |Travis CI Status| image:: https://travis-ci.org/icesat2py/icepyx.svg?branch=master
:target: https://travis-ci.org/icesat2py/icepyx

.. |Code Coverage| image:: https://codecov.io/gh/icesat2py/icepyx/branch/development/graph/badge.svg
:target: https://codecov.io/gh/icesat2py/icepyx

Origin and Purpose
------------------
icepyx is both a software library and a community composed of ICESat-2 data users, developers, and the scientific community. We are working together to develop a shared library of resources - including existing resources, new code, tutorials, and use-cases/examples - that simplify the process of querying, obtaining, analyzing, and manipulating ICESat-2 datasets to enable scientific discovery.
Expand All @@ -26,35 +29,56 @@ This project combines and generalizes these scripts into a unified framework, ma


.. _`zipped file`: https://github.com/icesat2py/icepyx/archive/master.zip
.. _`Fiona`: https://pypi.org/project/Fiona/

Installation
------------
Currently icepyx is only available for use as a github repository.
The contents of the repository can be download as a `zipped file`_ or cloned.
The simplest way to install icepyx is using pip.

.. code-block::

pip install icepyx


Windows users will need to first install `Fiona`_, please look at the instructions there. Windows users may consider installing Fiona using pipwin

.. code-block::

pip install pipwin
pipwin install Fiona

To use icepyx, fork this repo to your own account, then ``git clone`` the repo onto your system.
Provided the location of the repo is part of your $PYTHONPATH,
you should simply be able to add ``import icepyx`` to your Python document.

Currently, updated packages are not automatically generated with each build. This means it is possible that pip will not install the latest release of icepyx. In this case, icepyx is also available for use via the GitHub repository. The contents of the repository can be download as a `zipped file`_ or cloned.

To use icepyx this way, fork this repo to your own account, then git clone the repo onto your system.
To clone the repository:

.. code-block:: none
.. code-block::

git clone https://github.com/icesat2py/icepyx.git


Future developments of icepyx may include pip and conda as simplified installation options.
Provided the location of the repo is part of your $PYTHONPATH, you should simply be able to add import icepyx to your Python document.
Alternatively, in a command line or terminal, navigate to the folder in your cloned repository containing setup.py and run

.. code-block::

pip install -e


Future developments of icepyx may include conda as another simplified installation option.


Examples (Jupyter Notebooks)
----------------------------

.. _`ICESat-2_DAAC_DataAccess_Example`: ICESat-2_DAAC_DataAccess_Example.ipynb
Listed below are example jupyter-notebooks

`ICESat-2_DAAC_DataAccess_Example <https://github.com/icesat2py/icepyx/blob/master/examples/ICESat-2_DAAC_DataAccess_Example.ipynb>`_

Listed below are example jupyter-notebooks
`ICESat-2_DAAC_DataAccess2_Subsetting <https://github.com/icesat2py/icepyx/blob/master/examples/ICESat-2_DAAC_DataAccess2_Subsetting.ipynb>`_

ICESat-2_DAAC_DataAccess_Example_
`ICESat-2_DEM_comparison_Colombia_working <https://github.com/icesat2py/icepyx/blob/master/examples/ICESat-2_DEM_comparison_Colombia_working.ipynb>`_


Citing icepyx
Expand All @@ -72,7 +96,7 @@ Come join the conversation at: https://discourse.pangeo.io/.
Search for "icesat-2" under the "science" topic to find us.

.. _`icepyx`: https://github.com/icesat2py/icepyx
.. _`contribution guidelines`: ./doc/source/development/contribution_guidelines.rst
.. _`contribution guidelines`: ./doc/source/contributing/contribution_guidelines.rst

Contribute
----------
Expand All @@ -82,4 +106,4 @@ Check out our `contribution guidelines`_ to see how you can contribute.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. |Contributor Covenant|

.. |Contributor Covenant| image:: https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg
:target: code_of_conduct.md
:target: code_of_conduct.md
9 changes: 9 additions & 0 deletions binder-gallery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: icepyx examples gallery
description: >-
Examples using icepyx Python tools for obtaining and working with ICESat-2 data
gallery_repository: pangeo-gallery/pangeo-gallery
binder_url: "https://mybinder.org"
binder_repo: icesat2py/icepyx
binder_ref: master
binderbot_target_branch: binderbot-built
1 change: 1 addition & 0 deletions binder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM uwhackweeks/icesat2:2020.06.15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the most recent updates to icepyx, if we try to build against this Hackweek Docker image the examples will fail, since the icepyx example notebooks have been updated to use Query objects instead of Icesat2Data objects.

Loading