Skip to content

Commit

Permalink
🔀 Merge branch 'bundle_deepicedrain' (#37)
Browse files Browse the repository at this point in the history
Closes #37 Bundle deepicedrain components into a Python package.
  • Loading branch information
weiji14 committed May 28, 2020
2 parents d34455d + a825d06 commit c4988ed
Show file tree
Hide file tree
Showing 16 changed files with 500 additions and 747 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Test DeepIceDrain package

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
name: ${{ matrix.os }} - Python ${{ matrix.python_version }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 1
fail-fast: false
matrix:
python_version: [3.8]
os: [ubuntu-latest]

steps:
- name: Checkout current git repository
uses: actions/[email protected]

- name: Setup Miniconda
uses: goanpeca/[email protected]
with:
miniconda-version: py38_4.8.2
activate-environment: deepicedrain
python-version: ${{ matrix.python-version }}
channels: conda-forge
show-channel-urls: true
auto-activate-base: false
use-only-tar-bz2: true

- name: Cache virtual environment
uses: actions/cache@v2
id: cache
with:
path: |
/usr/share/miniconda3/envs/deepicedrain
key: cache-venv-${{ github.ref }}-${{ hashFiles('**/environment.yml') }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
cache-venv-refs/heads/master-
- name: Install conda dependencies
shell: bash -l {0}
run: conda env update -n deepicedrain -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'

- name: Install Poetry python dependencies
shell: bash -l {0}
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'

- name: Display virtualenv and installed package information
shell: bash -l {0}
run: |
conda info
conda list
poetry env info
poetry show
- name: Code Quality
shell: bash -l {0}
run: poetry run black . --check

- name: Test with pytest
shell: bash -l {0}
run: poetry run pytest --verbose tests/
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Jupyter Notebook
.ipynb_checkpoints
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ SHELL ["/bin/bash", "-ic"]
COPY environment.yml ${HOME}
RUN conda env create -n deepicedrain -f environment.yml && \
conda clean --all --yes && \
conda info && \
conda list -n deepicedrain

# Install dependencies in poetry.lock using poetry
Expand All @@ -53,6 +54,7 @@ COPY poetry.lock ${HOME}/
RUN conda activate deepicedrain && \
poetry install && \
rm --recursive ${HOME}/.cache/pip && \
poetry env info && \
poetry show

# Install jupyterlab extensions
Expand Down
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# DeepIceDrain

Mapping Antarctic subglacial water using a deep neural network.
Mapping and monitoring deep subglacial water activity
in Antarctica using remote sensing and machine learning.

![GitHub top language](https://img.shields.io/github/languages/top/weiji14/deepicedrain.svg)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Github Actions Status](https://github.com/weiji14/deepicedrain/workflows/Build%20DeepIceDrain/badge.svg)](https://github.com/weiji14/deepicedrain/actions)
![Test DeepIceDrain package](https://github.com/weiji14/deepicedrain/workflows/Test%20DeepIceDrain%20package/badge.svg)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=weiji14/deepicedrain)](https://dependabot.com)
![License](https://img.shields.io/github/license/weiji14/deepicedrain)

![ATL11 Cycle 6 minus Cycle 5 height change over Antarctica](https://user-images.githubusercontent.com/23487320/83100017-ffb0ba00-a102-11ea-9603-ac469f09e58b.png)

# Getting started

Expand All @@ -17,7 +21,17 @@ Launch in [Pangeo Binder](https://pangeo-binder.readthedocs.io) (Interactive jup

## Installation

Start by cloning this [repo-url](/../../)
### Basic

To just try out the scripts, download the `environment.yml` file from the repository and run the commands below:

cd deepicedrain
conda env create --name deepicedrain --file environment.yml
pip install git+https://github.com/weiji14/deepicedrain.git

### Advanced

To help out with development, start by cloning this [repo-url](/../../)

git clone <repo-url>

Expand Down
418 changes: 30 additions & 388 deletions atl11_play.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit c4988ed

Please sign in to comment.