diff --git a/README.md b/README.md index bc952400..9746b218 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f1a0c7af..4cfd25f0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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" @@ -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" diff --git a/ci/python3.6.yaml b/ci/python3.9.yaml similarity index 85% rename from ci/python3.6.yaml rename to ci/python3.9.yaml index 77f7a884..7929b192 100644 --- a/ci/python3.6.yaml +++ b/ci/python3.9.yaml @@ -5,4 +5,4 @@ pin_run_as_build: min_pin: x.x max_pin: x.x python: -- 3.6.* *_cpython +- 3.9.* *_cpython diff --git a/dev_environment.yaml b/dev_environment.yaml new file mode 100644 index 00000000..fcab8066 --- /dev/null +++ b/dev_environment.yaml @@ -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 diff --git a/docs/build_docs.rst b/docs/build_docs.rst index e03aad66..919aa867 100644 --- a/docs/build_docs.rst +++ b/docs/build_docs.rst @@ -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``. \ No newline at end of file +You can find the test build in ``_build/html/index.html``. \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 98c3a2bd..bc0285de 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 ------------------------------------------ diff --git a/geometric_features/download.py b/geometric_features/download.py index 372040a0..07e602fd 100644 --- a/geometric_features/download.py +++ b/geometric_features/download.py @@ -13,7 +13,7 @@ import os import requests import progressbar -import six +from urllib.request import pathname2url # From https://stackoverflow.com/a/1094933/7728169 @@ -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') diff --git a/recipe/meta.yaml b/recipe/meta.yaml index ad6def49..44f73709 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -29,13 +29,12 @@ requirements: - pip run: - python - - numpy - - matplotlib-base - cartopy - - shapely - - requests + - matplotlib-base + - numpy - progressbar2 - - six + - requests + - shapely test: requires: