Skip to content
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
28 changes: 7 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,17 @@ will be added shortly.

To use geometric features, you can install it in a conda environment:
```bash
conda create -n geometric_features -c conda-forge python=3.7 geometric_features
conda create -n geometric_features -c conda-forge python=3.9 geometric_features
conda activate geometric_features
```
By default, `geometric_features` will download the data it needs on the fly.
Since some of the features are quite large, this can be convenient if disk
space is at a premium.

Some systems do not support downloading the data (e.g. because of firewalls or
compute nodes that don't have internet access. In such cases, it is convenient
to install `geometric_features` including all the data:
To develop `geometric_features` (e.g. to add new features), create and activate
an environment with all of the required dependencies:
```bash
conda create -n geometric_features -c conda-forge python=3.7 \
"geometric_features=*=*with_data*"
conda activate geometric_features
```
This syntax is admittedly a bit clunky but it selects for a special build of
the conda package with the data included.

To develop `geometric_features` (e.g. to add new features), it is highly
recommended that you use an `anaconda` python environment. Here is how to
create and activate an environment with all of the required dependencies:
```bash
conda create -n geometric_features -c conda-forge python=3.7 numpy matplotlib \
cartopy shapely requests progressbar2
conda activate geometric_features
conda create -n mpas_dev
conda activate mpas_dev
conda env update -n mpas_dev -f ./dev_environment.yaml
python -m pip install -e .
```

A typical workflow will look like:
Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ jobs:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'

steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
Expand Down Expand Up @@ -119,12 +119,12 @@ jobs:
vmImage: 'macOS-10.14'
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'

steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
Expand Down
2 changes: 1 addition & 1 deletion ci/python3.6.yaml → ci/python3.9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ pin_run_as_build:
min_pin: x.x
max_pin: x.x
python:
- 3.6.* *_cpython
- 3.9.* *_cpython
19 changes: 19 additions & 0 deletions dev_environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: geometric_features_dev
channels:
- conda-forge
- defaults
dependencies:
# Base
- python 3.8
- cartopy
- matplotlib-base
- numpy
- progressbar2
- requests
- shapely
# Development
- pip
# Documentation
- sphinx
- sphinx_rtd_theme
- m2r
16 changes: 3 additions & 13 deletions docs/build_docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,13 @@ If you add a new capability to ``geometric_features``, it should also be
documented under the ``docs`` directory. After making changes, it is useful to
do a local build of the docs.

First, make sure to install ``conda-build`` and update ``conda`` in you
``base`` conda environment. Then, from your ``base`` conda environment, run
the following:
First, set up the development environment as described in :ref:`quick_start`.
Then, run:

.. code-block:: bash

# remove any packages you've previously built
rm -rf ~/miniconda3/conda-bld

# test building the docs
conda remove -y --all -n geometric_features_docs
conda build -m ci/python3.8.yaml recipe
conda create -y -n geometric_features_docs --use-local python=3.8 \
geometric_features sphinx sphinx_rtd_theme m2r
conda activate geometric_features_docs
cd docs
make clean
make html

Finally, you can find the test build in ``_build/html/index.html``.
You can find the test build in ``_build/html/index.html``.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']


# -- Options for HTMLHelp output ------------------------------------------
Expand Down
5 changes: 2 additions & 3 deletions geometric_features/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import os
import requests
import progressbar
import six
from urllib.request import pathname2url


# From https://stackoverflow.com/a/1094933/7728169
Expand Down Expand Up @@ -47,8 +47,7 @@ def download_files(fileList, urlBase, outDir):
except OSError:
pass

url = '{}/{}'.format(urlBase,
six.moves.urllib.request.pathname2url(fileName))
url = '{}/{}'.format(urlBase, pathname2url(fileName))
try:
response = requests.get(url, stream=True)
encoding = response.headers.get('content-encoding')
Expand Down
9 changes: 4 additions & 5 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ requirements:
- pip
run:
- python
- numpy
- matplotlib-base
- cartopy
- shapely
- requests
- matplotlib-base
- numpy
- progressbar2
- six
- requests
- shapely

test:
requires:
Expand Down