diff --git a/appveyor.yml b/.appveyor.yml similarity index 59% rename from appveyor.yml rename to .appveyor.yml index ce2cc11..84b744b 100644 --- a/appveyor.yml +++ b/.appveyor.yml @@ -1,28 +1,22 @@ environment: PYTHON_ARCH: "64" - PYTHON: "C:\\Miniconda36-x64" + PYTHON: "C:\\Miniconda38-x64" matrix: - PYTHON_VERSION: "3.8" - QT_VERSION: "5" - BUILD_STR_END: cf - - PYTHON_VERSION: "3.7" - QT_VERSION: "5" - - PYTHON_VERSION: "3.7" - QT_VERSION: "5" - BUILD_STR_END: cf install: # windows config (for installation) - cmd: "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - cmd: setlocal - - cmd: set CONDA_REPO_TOKEN= + - cmd: set ANACONDA_API_TOKEN= # conda config - conda config --set always_yes yes --set changeps1 no - conda update -q conda - conda install conda-build anaconda-client - - IF NOT DEFINED BUILD_STR_END (conda config --add channels chilipp/label/conda-forge) ELSE (conda config --add channels conda-forge) + - pip install -i https://pypi.anaconda.org/psyplot/simple --no-deps psyplot-ci-orb + - conda config --add channels conda-forge - conda config --add channels psyplot - conda info -a - conda list @@ -30,17 +24,20 @@ install: - cmd: endlocal - cmd: 'SET PYTHONWARNINGS=ignore:mode:DeprecationWarning:docutils.io:245' - cmd: "IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (SET GIT_BRANCH=%APPVEYOR_REPO_BRANCH%)" - - cmd: "IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (conda config --add channels psyplot/label/master)" - cmd: "IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (conda config --add channels psyplot/label/%APPVEYOR_REPO_BRANCH%)" - - cmd: python ci\\setup_append.py ci\\conda-recipe pyqt=%QT_VERSION% build: off test_script: - cmd: setlocal - - cmd: set CONDA_REPO_TOKEN= + - cmd: set ANACONDA_API_TOKEN= - cmd: conda build ci/conda-recipe --python %PYTHON_VERSION% - cmd: endlocal deploy_script: - - cmd: "python ci\\deploy_anaconda.py" + - cmd: " + IF NOT DEFINED APPVEYOR_REPO_TAG_NAME ( + deploy-conda-recipe -l %APPVEYOR_REPO_BRANCH% -py %PYTHON_VERSION% ci/conda-recipe + ) ELSE ( + deploy-conda-recipe -py %PYTHON_VERSION% ci/conda-recipe + )" diff --git a/.circleci/config.yml b/.circleci/config.yml index 360b7ee..3e6d506 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,169 +1,114 @@ version: 2.1 orbs: - win: circleci/windows@2.2.0 + psyplot: psyplot/psyplot-ci-orb@1.5.24 + mattermost-plugin-notify: nathanaelhoun/mattermost-plugin-notify@1.2.0 -commands: - install_linux: - description: "Setup linux environment" - steps: - - checkout - - run: - name: install apt requirements - command: | - sudo apt-get update - sudo apt-get install libgl1-mesa-glx libegl1-mesa-dev - - run: - name: Install conda - command: | - echo "" - echo "Installing a fresh version of Miniconda." - MINICONDA_URL="https://repo.continuum.io/miniconda" - MINICONDA_FILE="Miniconda3-latest-Linux-x86_64.sh" - curl -L -O "${MINICONDA_URL}/${MINICONDA_FILE}" - bash $MINICONDA_FILE -bp $HOME/miniconda3 - configure_conda: - description: "Install conda on the sytem" - parameters: - channels: - type: string - default: conda-forge psyplot - steps: - - run: - name: Configure - command: | - which conda || source $HOME/miniconda3/bin/activate base - conda config --set always_yes yes --set changeps1 no - conda update -q conda - for CHANNEL in << parameters.channels >>; do - conda config --add channels ${CHANNEL} - done - if [[ $CIRCLE_TAG == "" ]]; then - conda config --add channels psyplot/label/master; - conda config --add channels psyplot/label/${CIRCLE_BRANCH}; - fi - configure_recipe: - description: "Configure conda build" - steps: - - run: - name: Install anaconda client and conda-build - command: | - which conda || source $HOME/miniconda3/bin/activate base - conda install -c defaults --override-channels conda-build anaconda-client conda-verify - - run: - name: Environment info - command: | - which conda || source $HOME/miniconda3/bin/activate base - conda info -a - conda list - - run: - name: Setup append - command: | - which conda || source $HOME/miniconda3/bin/activate base - python ci/setup_append.py ci/conda-recipe pyqt=5 - build_recipe: - description: "Build the conda recipe" - parameters: - python_version: - type: string - default: "3.8" - steps: - - run: - name: Build conda recipe - command: | - which conda || source $HOME/miniconda3/bin/activate base - conda build ci/conda-recipe --python << parameters.python_version >> - clean_and_save: - description: "Clean packages and save cache" - parameters: - key: - type: string - steps: - - run: - name: Clean conda packages - command: | - which conda || source $HOME/miniconda3/bin/activate base - conda clean -q -p -y - - save_cache: - key: << parameters.key >> - paths: - - ~/miniconda3/pkgs +executors: + default: psyplot/default + macos: psyplot/macos - -jobs: - build_windows: - executor: - name: win/default - shell: bash.exe - parameters: - python_version: - type: string - default: "3.8" - working_directory: ~/test - steps: - - checkout - - configure_conda - - configure_recipe - - run: - name: Build recipe - shell: cmd.exe - command: conda activate & conda build ci/conda-recipe --python << parameters.python_version >> - build_linux: - parameters: - python_version: - type: string - default: "3.8" - working_directory: ~/test - machine: true - steps: - - install_linux - - configure_conda - - configure_recipe - - restore_cache: - keys: - - v4-<< parameters.python_version >>-{{ checksum "ci/conda-recipe/meta.yaml" }}-{{ checksum "ci/conda-recipe/recipe_append.yaml" }} - - build_recipe: - python_version: << parameters.python_version >> - - clean_and_save: - key: v4-<< parameters.python_version >>-{{ checksum "ci/conda-recipe/meta.yaml" }}-{{ checksum "ci/conda-recipe/recipe_append.yaml" }} +parameters: + unit-test-executor: + description: Executor for the unit tests. Can be default or macos + type: string + default: default + deploy-release: + description: Deploy the comment as a new release to github and pypi + type: boolean + default: false + run-tests: + description: Run the test suite + type: boolean + default: true build_docs: - working_directory: ~/repo - machine: true - steps: - - install_linux - - configure_conda: - channels: defaults - - restore_cache: - keys: - - v4-{{ checksum "docs/environment.yml" }} - - run: - name: Create environment - command: | - which conda || source $HOME/miniconda3/bin/activate base - conda env create -f docs/environment.yml - conda activate psy-view-docs - pip install . - - clean_and_save: - key: v4-{{ checksum "docs/environment.yml" }} - - run: - name: Build the docs - command: | - which conda || source $HOME/miniconda3/bin/activate base - cd docs - conda activate psy-view-docs - make html - - store_artifacts: - path: ~/repo/docs/_build/html - destination: docs + description: Build the documentation + type: boolean + default: true workflows: - version: 2.1 - build_and_test: + build-and-test: + unless: << pipeline.parameters.deploy-release >> + jobs: + - psyplot/install-and-build: + name: install + exec_environment: << pipeline.parameters.unit-test-executor >> + setup_env: true + build_args: "--no-test" + build_docs: << pipeline.parameters.build_docs >> + env_packages: pytest-cov dask pytest-qt + - psyplot/test-parallel: + name: run-tests + parallelism: 1 + pytest_args: --cov=psy_view + run-job: << pipeline.parameters.run-tests >> + requires: + - install + - psyplot/build-docs: + name: test-docs + run-job: << pipeline.parameters.build_docs >> + builders: linkcheck + requires: + - install + - mattermost-plugin-notify/approval-notification: + name: notify-deploy + context: mattermost + message: >- + Hello @all! A workflow on https://app.circleci.com/pipelines/github/psyplot/psy-view is awaiting your approval. + Please check the uploaded docs and builds prior to approval. + requires: + - run-tests + - test-docs + - hold-for-deploy: + type: approval + requires: + - notify-deploy + - psyplot/deploy-pkg: + exec_environment: << pipeline.parameters.unit-test-executor >> + context: anaconda + requires: + - hold-for-deploy + - psyplot/deploy-docs: + fingerprint: "55:98:12:84:96:12:af:75:0c:fc:17:a5:0e:a2:a9:d4" + run-job: << pipeline.parameters.build_docs >> + requires: + - hold-for-deploy + filters: + branches: + only: master + - psyplot/trigger-release-workflow: + context: trigger-release + filters: + branches: + only: master + requires: + - psyplot/deploy-pkg + - psyplot/deploy-docs + publish-release: + when: << pipeline.parameters.deploy-release >> jobs: - - build_linux - - build_linux: - python_version: "3.7" - - build_docs -# - build_windows -# - build_windows: -# python_version: "3.7" + - psyplot/create-tag: + ssh-fingerprints: "55:98:12:84:96:12:af:75:0c:fc:17:a5:0e:a2:a9:d4" + context: psyplot-admin + user-name: psyplot-admin + publish-release: true + publish-version-tag: true + - mattermost-plugin-notify/approval-notification: + name: notify-release + context: mattermost + message: >- + Hello @all! A new release has been created at https://github.com/psyplot/psy-view/releases. + Please review it carefully, publish it and approve the upload to pypi. + requires: + - psyplot/create-tag + - hold-for-pypi: + type: approval + requires: + - notify-release + - psyplot/deploy-pypi: + context: pypi + requires: + - hold-for-pypi + filters: + branches: + only: master diff --git a/.gitignore b/.gitignore index 0f383dd..b629877 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,8 @@ coverage.xml docs/api/ docs/_build/ docs/index.doctree +docs/docs-*.png +docs/_static/docs-*.png # PyBuilder target/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 39ff457..0000000 --- a/.travis.yml +++ /dev/null @@ -1,113 +0,0 @@ -language: generic -sudo: false # use container based build - -# set clone depth to false to make sure that conda build can write the -# correct GIT_BUILD_STR -git: - depth: false - -env: - matrix: - # python 3.8 - - PYTHON_VERSION=3.8 QT_VERSION=5 DEPLOY_CONDA=true - - PYTHON_VERSION=3.8 USE_PIP=true - # python 3.7 - - PYTHON_VERSION=3.7 QT_VERSION=5 DEPLOY_CONDA=true - - PYTHON_VERSION=3.7 QT_VERSION=5 DEPLOY_CONDA=true BUILD_STR_END= - global: - - BUILD_STR_END=cf - - secure: "is+JG7mMh9CYYZ55EE9SpOtAttcwg+zskiyKRuPW6FnQOjWKQQCE+H1CQy0r+ioRXnTeXWggPgJkrpw4gPicCSi5bjks56F91HZ4m7gY536sn2mWaer/JsM2QJg6fzjxCGL30lqtF1tfUcdIDGKhGCHJ2jlp+T9rA6rBkzg30u53uA/H6nypWVc7cAj/VzyfcIZcrHXUGm8UI92NNJJTDwyN0S5kvQhvKURV1eP+wFYTafSjumyFmXdyNdFvZ7N912o+SjrFGhBxUFxUshiP1qbeoc7Ku++zvtzQtEt8ZEjKsGrBnIZ3c7tKirKyIz+L8Ptg1mIA3SwegyMTJghBKY+0vwuB3fHp6t1pF2K55PR6g5EBJMkfip7zs92v9jnhgHRdkFDq7kMANapVAmT+qZJeoklvlkLu3VO9/K7Y6QKmsduc1/zZknSbXCPVstqJEfAJ+ftd7LEeSsWzm+gUmEqNh7J3j2i/OjnLqw/doK/Lhrf9umydqOAyBDj8/WE+rr7sd5kToBd/HNWYhSb/rgS64gXL+vcNKvFZGozaH9OyyVTEfVA7ZIk2ppjzLkpVBsB9piun9bybQtcDfaDQJM5k7DtaPYDoTz2r0MXAfb+ylHbfE3iq3SL1TJynXcCGXjCoNA5DvLmxePg5r8TjWQrOS3LFMs6BqmPShKQJrrk=" - -os: - - linux - - osx - -services: - - xvfb - -matrix: - allow_failures: - - env: PYTHON_VERSION=3.8 USE_PIP=true - -before_install: - - if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then export DEPLOY_CONDA=false; fi - # define functions to unset and reset encrypted variables - - function unset_secure { - CONDA_TOKEN_SAVE=$CONDA_REPO_TOKEN; - unset CONDA_REPO_TOKEN; - } - - function reset_secure { - export CONDA_REPO_TOKEN=$CONDA_TOKEN_SAVE; - } - - unset_secure - # increase open files limit - - ulimit -a - - ulimit -Sn 10000 - - ulimit -a - # select the os name for the conda installer - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - OS_NAME=MacOSX; - else - OS_NAME=Linux; - fi - # Install Miniconda. - - | - echo "" - echo "Installing a fresh version of Miniconda." - MINICONDA_URL="https://repo.continuum.io/miniconda" - MINICONDA_FILE="Miniconda3-latest-${OS_NAME}-x86_64.sh" - curl -L -O "${MINICONDA_URL}/${MINICONDA_FILE}" - bash $MINICONDA_FILE -bp $HOME/miniconda3 - - source $HOME/miniconda3/bin/activate root - - hash -r - - reset_secure - -before_script: - - if [[ $TRAVIS_OS_NAME == "linux" ]]; then - export "DISPLAY=:99.0"; - sh -e /etc/init.d/xvfb start; - sleep 3; - fi - -install: - # unset the global CONDA_REPO_TOKEN variable because it is not needed - # during the tests. This decreases the vulnerability - - unset_secure - - | - echo "" - echo "Configuring conda." - conda config --set always_yes yes --set changeps1 no - if [[ ${BUILD_STR_END} == "cf" ]]; then - conda config --add channels conda-forge - else - conda config --add channels chilipp/label/conda-forge - fi - conda config --add channels psyplot - conda update -q conda - conda install conda-build anaconda-client conda-verify - - if [[ $TRAVIS_TAG == "" ]]; then - export GIT_BRANCH=$TRAVIS_BRANCH; - conda config --add channels psyplot/label/master; - conda config --add channels psyplot/label/${TRAVIS_BRANCH}; - fi - - python ci/setup_append.py ci/conda-recipe pyqt=${QT_VERSION} 'cartopy>=0.18' - - if [[ $USE_PIP == true ]]; then - python -m pip install . -r ci/requirements.txt; - fi - - conda info -a - - conda list - - reset_secure -script: - - unset_secure - # install conda - - if [[ $USE_PIP == true ]]; then - pytest -v --cov=psy_view && codecov; - else - conda build ci/conda-recipe --python $PYTHON_VERSION; - fi - # export the pw to make it available for the deploy - - reset_secure - # deploy here (don't use travis deploy because it requires homebrew) - - if [[ $DEPLOY_CONDA == "true" && $TRAVIS_PULL_REQUEST == "false" && $TRAVIS_REPO_SLUG == "psyplot/psy-view" ]]; then - ci/deploy_anaconda.py; - fi diff --git a/README.rst b/README.rst index b46d9d8..4c30a1a 100644 --- a/README.rst +++ b/README.rst @@ -8,22 +8,28 @@ psy-view: An ncview-like GUI with psyplot :stub-columns: 1 :widths: 10 90 - * - examples - - |mybinder| + * - docs + - |docs| |mybinder| * - tests - - |travis| |appveyor| |codecov| + - |circleci| |appveyor| |codecov| * - package - - |version| |conda| |supported-versions| |supported-implementations| |github| + - |version| |conda| |github| |zenodo| + * - implementations + - |supported-versions| |supported-implementations| * - get in touch - |gitter| |mailing-list| |issues| +.. |docs| image:: https://img.shields.io/github/deployments/psyplot/psy-view/github-pages + :alt: Documentation + :target: http://psyplot.github.io/psy-view/ + .. |mybinder| image:: https://mybinder.org/badge_logo.svg - :target: https://mybinder.org/v2/gh/psyplot/psy-view/master?urlpath=%2Fdesktop - :alt: mybinder.org + :target: https://mybinder.org/v2/gh/psyplot/psy-view/master?urlpath=%2Fdesktop + :alt: mybinder.org -.. |travis| image:: https://travis-ci.org/psyplot/psy-view.svg?branch=master - :alt: Travis - :target: https://travis-ci.org/psyplot/psy-view +.. |circleci| image:: https://circleci.com/gh/psyplot/psy-view/tree/master.svg?style=svg + :alt: CircleCI + :target: https://circleci.com/gh/psyplot/psy-view/tree/master .. |appveyor| image:: https://ci.appveyor.com/api/projects/status/a7qxvvwt0e41j32h/branch/master?svg=true :alt: AppVeyor @@ -65,6 +71,10 @@ psy-view: An ncview-like GUI with psyplot :target: https://github.com/psyplot/psy-view/issues :alt: GitHub issues +.. |zenodo| image:: https://zenodo.org/badge/249615633.svg + :alt: Zenodo + :target: https://zenodo.org/badge/latestdoi/249615633 + .. end-badges This package defines a viewer application for netCDF files, that is highly @@ -96,9 +106,9 @@ Some of the most important features offered by psy-view are: - different projections - implemented in psyplot-gui_ for full flexibility (if desired) -.. _ICON: https://mpimet.mpg.de/en/communication/news/focus-on-overview/icon-development +.. _ICON: https://mpimet.mpg.de/en/science/modeling-with-icon/icon-configurations .. _UGRID: http://ugrid-conventions.github.io/ugrid-conventions/ -.. _psyplot-gui: https://psyplot.readthedocs.io/projects/psyplot-gui +.. _psyplot-gui: https://psyplot.github.io/psyplot-gui Test it without installation @@ -149,7 +159,7 @@ headless in you browser by clicking |mybinder| For alternative installation instructions, update information or deinstallation instructions, please have a look into the `installation docs`_. -.. _installation docs: https://psyplot.readthedocs.io/projects/psy-view/en/latest/installing.html +.. _installation docs: https://psyplot.github.io/psy-view/installing.html Get in touch diff --git a/binder/environment.yml b/binder/environment.yml index a28ba28..154fd83 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -1,5 +1,6 @@ channels: - psyplot/label/master +- psyplot - manics # Used by jupyter-desktop-server - conda-forge dependencies: @@ -8,6 +9,8 @@ dependencies: - netcdf4 - pip - ncview +- matplotlib>=3.3 +- cartopy>=0.18 # Required for jupyter-desktop-server - websockify diff --git a/ci/conda-recipe/meta.yaml b/ci/conda-recipe/meta.yaml index 606f7bd..0dcdf05 100644 --- a/ci/conda-recipe/meta.yaml +++ b/ci/conda-recipe/meta.yaml @@ -46,6 +46,7 @@ test: commands: - psy-view --help - pytest -sv --cov=psy_view + - codecov app: entry: psy-view @@ -63,5 +64,5 @@ about: description: | This package provides a graphical user interface to quickly visualize the contents of a netCDF file - doc_url: http://psyplot.readthedocs.io/projects/psy-view + doc_url: http://psyplot.github.io/psy-view dev_url: https://github.com/psyplot/psy-view diff --git a/ci/deploy_anaconda.py b/ci/deploy_anaconda.py deleted file mode 100755 index bfb0588..0000000 --- a/ci/deploy_anaconda.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python -import os -import re -import conda_build.api -import subprocess as spr - -recipe_path = 'ci/conda-recipe' - -if os.getenv("TRAVIS") == "true": - branch = os.getenv("TRAVIS_BRANCH") - on_release = os.getenv("TRAVIS_TAG") != "" -else: - branch = os.getenv("APPVEYOR_REPO_BRANCH") - on_release = bool(os.getenv("APPVEYOR_REPO_TAG_NAME")) - -label = ['--label', branch] if not on_release else [] -token = ['--token', os.getenv('CONDA_REPO_TOKEN')] -python = ['--python', os.getenv('PYTHON_VERSION')] - -command = ["conda", "build", "--no-test", "--no-copy-test-source-files"] - -spr.check_call(["conda", "config", "--set", "anaconda_upload", "yes"]) - -print("Building recipe via " + - " ".join(command + ["--token *******"] + label + python + [recipe_path])) - -spr.check_call(command + token + label + python + [recipe_path]) diff --git a/ci/requirements.txt b/ci/requirements.txt deleted file mode 100644 index 599c049..0000000 --- a/ci/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -# requirements for testing psyplot -dask[complete] -psyplot >=1.2.0 -psyplot-gui -netCDF4 -pyqt>5.7 -pytest -pytest-cov diff --git a/ci/setup_append.py b/ci/setup_append.py deleted file mode 100644 index 2a2406f..0000000 --- a/ci/setup_append.py +++ /dev/null @@ -1,31 +0,0 @@ -# Script to generate conda build config to be appended -import argparse -import os.path as osp -import yaml -import re - -parser = argparse.ArgumentParser() - -parser.add_argument('recipe_dir', help="Path to the conda recipe directory") -parser.add_argument( - "packages", nargs="+", metavar="PACKAGE=VERSION", - help="Package specifications to include in the test.requires section") - -args = parser.parse_args() - -output = osp.join(args.recipe_dir, 'recipe_append.yaml') -packages = [] - -for pkg in args.packages: - if pkg.strip().endswith("="): # no version specified - packages.append(pkg.strip()[:-1]) - else: - packages.append(pkg) - -config = {"test": { - "requires": packages, - "commands": ["codecov"] - }} - -with open(output, 'w') as f: - yaml.dump(config, f) diff --git a/docs/_static/docs-array_frame.png b/docs/_static/docs-array_frame.png deleted file mode 100644 index feb3310..0000000 Binary files a/docs/_static/docs-array_frame.png and /dev/null differ diff --git a/docs/_static/docs-btn_add.png b/docs/_static/docs-btn_add.png deleted file mode 100644 index fc253f1..0000000 Binary files a/docs/_static/docs-btn_add.png and /dev/null differ diff --git a/docs/_static/docs-btn_animate_backward.png b/docs/_static/docs-btn_animate_backward.png deleted file mode 100644 index 843a721..0000000 Binary files a/docs/_static/docs-btn_animate_backward.png and /dev/null differ diff --git a/docs/_static/docs-btn_animate_forward.png b/docs/_static/docs-btn_animate_forward.png deleted file mode 100644 index aa632db..0000000 Binary files a/docs/_static/docs-btn_animate_forward.png and /dev/null differ diff --git a/docs/_static/docs-btn_del.png b/docs/_static/docs-btn_del.png deleted file mode 100644 index a9cb440..0000000 Binary files a/docs/_static/docs-btn_del.png and /dev/null differ diff --git a/docs/_static/docs-btn_export.png b/docs/_static/docs-btn_export.png deleted file mode 100644 index 3fa5c2a..0000000 Binary files a/docs/_static/docs-btn_export.png and /dev/null differ diff --git a/docs/_static/docs-btn_mpl_pan.png b/docs/_static/docs-btn_mpl_pan.png deleted file mode 100644 index e6ee0f0..0000000 Binary files a/docs/_static/docs-btn_mpl_pan.png and /dev/null differ diff --git a/docs/_static/docs-btn_mpl_settings.png b/docs/_static/docs-btn_mpl_settings.png deleted file mode 100644 index 29cc6d6..0000000 Binary files a/docs/_static/docs-btn_mpl_settings.png and /dev/null differ diff --git a/docs/_static/docs-btn_mpl_zoom.png b/docs/_static/docs-btn_mpl_zoom.png deleted file mode 100644 index 3d061e5..0000000 Binary files a/docs/_static/docs-btn_mpl_zoom.png and /dev/null differ diff --git a/docs/_static/docs-btn_next.png b/docs/_static/docs-btn_next.png deleted file mode 100644 index e2ee030..0000000 Binary files a/docs/_static/docs-btn_next.png and /dev/null differ diff --git a/docs/_static/docs-btn_open.png b/docs/_static/docs-btn_open.png deleted file mode 100644 index 0b62795..0000000 Binary files a/docs/_static/docs-btn_open.png and /dev/null differ diff --git a/docs/_static/docs-btn_preset.png b/docs/_static/docs-btn_preset.png deleted file mode 100644 index 1a3152d..0000000 Binary files a/docs/_static/docs-btn_preset.png and /dev/null differ diff --git a/docs/_static/docs-btn_prev.png b/docs/_static/docs-btn_prev.png deleted file mode 100644 index fa1d60d..0000000 Binary files a/docs/_static/docs-btn_prev.png and /dev/null differ diff --git a/docs/_static/docs-btn_reload.png b/docs/_static/docs-btn_reload.png deleted file mode 100644 index 4d73e18..0000000 Binary files a/docs/_static/docs-btn_reload.png and /dev/null differ diff --git a/docs/_static/docs-combo_array.png b/docs/_static/docs-combo_array.png deleted file mode 100644 index d10923b..0000000 Binary files a/docs/_static/docs-combo_array.png and /dev/null differ diff --git a/docs/_static/docs-dimension_table.png b/docs/_static/docs-dimension_table.png deleted file mode 100644 index 14f6af8..0000000 Binary files a/docs/_static/docs-dimension_table.png and /dev/null differ diff --git a/docs/_static/docs-ds_tree.png b/docs/_static/docs-ds_tree.png deleted file mode 100644 index 9e5200b..0000000 Binary files a/docs/_static/docs-ds_tree.png and /dev/null differ diff --git a/docs/_static/docs-ds_widget.png b/docs/_static/docs-ds_widget.png deleted file mode 100644 index 8264cff..0000000 Binary files a/docs/_static/docs-ds_widget.png and /dev/null differ diff --git a/docs/_static/docs-getting-started-btn_cmap.png b/docs/_static/docs-getting-started-btn_cmap.png deleted file mode 100644 index e78983d..0000000 Binary files a/docs/_static/docs-getting-started-btn_cmap.png and /dev/null differ diff --git a/docs/_static/docs-getting-started-btn_proj.png b/docs/_static/docs-getting-started-btn_proj.png deleted file mode 100644 index 8810380..0000000 Binary files a/docs/_static/docs-getting-started-btn_proj.png and /dev/null differ diff --git a/docs/_static/docs-getting-started-ds_widget.png b/docs/_static/docs-getting-started-ds_widget.png deleted file mode 100644 index bfda12e..0000000 Binary files a/docs/_static/docs-getting-started-ds_widget.png and /dev/null differ diff --git a/docs/_static/docs-getting-started-t2m.png b/docs/_static/docs-getting-started-t2m.png deleted file mode 100644 index 05692bb..0000000 Binary files a/docs/_static/docs-getting-started-t2m.png and /dev/null differ diff --git a/docs/_static/docs-lbl_interval.png b/docs/_static/docs-lbl_interval.png deleted file mode 100644 index 1a5d7e3..0000000 Binary files a/docs/_static/docs-lbl_interval.png and /dev/null differ diff --git a/docs/_static/docs-lev-button.png b/docs/_static/docs-lev-button.png deleted file mode 100644 index fa9ff20..0000000 Binary files a/docs/_static/docs-lev-button.png and /dev/null differ diff --git a/docs/_static/docs-lineplot-btn_add.png b/docs/_static/docs-lineplot-btn_add.png deleted file mode 100644 index fc253f1..0000000 Binary files a/docs/_static/docs-lineplot-btn_add.png and /dev/null differ diff --git a/docs/_static/docs-lineplot-btn_del.png b/docs/_static/docs-lineplot-btn_del.png deleted file mode 100644 index a9cb440..0000000 Binary files a/docs/_static/docs-lineplot-btn_del.png and /dev/null differ diff --git a/docs/_static/docs-lineplot-combo_dims.png b/docs/_static/docs-lineplot-combo_dims.png deleted file mode 100644 index 64a7462..0000000 Binary files a/docs/_static/docs-lineplot-combo_dims.png and /dev/null differ diff --git a/docs/_static/docs-lineplot-combo_lines.png b/docs/_static/docs-lineplot-combo_lines.png deleted file mode 100644 index 5163b9d..0000000 Binary files a/docs/_static/docs-lineplot-combo_lines.png and /dev/null differ diff --git a/docs/_static/docs-lineplot.png b/docs/_static/docs-lineplot.png deleted file mode 100644 index 408f445..0000000 Binary files a/docs/_static/docs-lineplot.png and /dev/null differ diff --git a/docs/_static/docs-mapplot-btn_cmap.png b/docs/_static/docs-mapplot-btn_cmap.png deleted file mode 100644 index e78983d..0000000 Binary files a/docs/_static/docs-mapplot-btn_cmap.png and /dev/null differ diff --git a/docs/_static/docs-mapplot-btn_cmap_settings.png b/docs/_static/docs-mapplot-btn_cmap_settings.png deleted file mode 100644 index 2b6e545..0000000 Binary files a/docs/_static/docs-mapplot-btn_cmap_settings.png and /dev/null differ diff --git a/docs/_static/docs-mapplot-btn_datagrid.png b/docs/_static/docs-mapplot-btn_datagrid.png deleted file mode 100644 index c7f4e25..0000000 Binary files a/docs/_static/docs-mapplot-btn_datagrid.png and /dev/null differ diff --git a/docs/_static/docs-mapplot-btn_labels.png b/docs/_static/docs-mapplot-btn_labels.png deleted file mode 100644 index d279c47..0000000 Binary files a/docs/_static/docs-mapplot-btn_labels.png and /dev/null differ diff --git a/docs/_static/docs-mapplot-btn_proj.png b/docs/_static/docs-mapplot-btn_proj.png deleted file mode 100644 index 8810380..0000000 Binary files a/docs/_static/docs-mapplot-btn_proj.png and /dev/null differ diff --git a/docs/_static/docs-mapplot-btn_proj_settings.png b/docs/_static/docs-mapplot-btn_proj_settings.png deleted file mode 100644 index ad7fa34..0000000 Binary files a/docs/_static/docs-mapplot-btn_proj_settings.png and /dev/null differ diff --git a/docs/_static/docs-mapplot-combo_plot.png b/docs/_static/docs-mapplot-combo_plot.png deleted file mode 100644 index e4703e3..0000000 Binary files a/docs/_static/docs-mapplot-combo_plot.png and /dev/null differ diff --git a/docs/_static/docs-mapplot.png b/docs/_static/docs-mapplot.png deleted file mode 100644 index c3d9631..0000000 Binary files a/docs/_static/docs-mapplot.png and /dev/null differ diff --git a/docs/_static/docs-mpl-toolbar.png b/docs/_static/docs-mpl-toolbar.png deleted file mode 100644 index b24f208..0000000 Binary files a/docs/_static/docs-mpl-toolbar.png and /dev/null differ diff --git a/docs/_static/docs-navigation.png b/docs/_static/docs-navigation.png deleted file mode 100644 index 3f5a639..0000000 Binary files a/docs/_static/docs-navigation.png and /dev/null differ diff --git a/docs/_static/docs-open_widget.png b/docs/_static/docs-open_widget.png deleted file mode 100644 index 2e1c12a..0000000 Binary files a/docs/_static/docs-open_widget.png and /dev/null differ diff --git a/docs/_static/docs-plot2d.png b/docs/_static/docs-plot2d.png deleted file mode 100644 index 721688f..0000000 Binary files a/docs/_static/docs-plot2d.png and /dev/null differ diff --git a/docs/_static/docs-plot_tabs.png b/docs/_static/docs-plot_tabs.png deleted file mode 100644 index e0ef192..0000000 Binary files a/docs/_static/docs-plot_tabs.png and /dev/null differ diff --git a/docs/_static/docs-sl_interval.png b/docs/_static/docs-sl_interval.png deleted file mode 100644 index 790d3d0..0000000 Binary files a/docs/_static/docs-sl_interval.png and /dev/null differ diff --git a/docs/_static/docs-time-button.png b/docs/_static/docs-time-button.png deleted file mode 100644 index 8527368..0000000 Binary files a/docs/_static/docs-time-button.png and /dev/null differ diff --git a/docs/_static/docs-variable_frame.png b/docs/_static/docs-variable_frame.png deleted file mode 100644 index 190b891..0000000 Binary files a/docs/_static/docs-variable_frame.png and /dev/null differ diff --git a/docs/conf.py b/docs/conf.py index f8419f6..613eecd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,6 +25,7 @@ from docutils import nodes from docutils.statemachine import StringList from docutils.parsers.rst import directives +from docutils.parsers.rst.directives import images from sphinx.util.docutils import SphinxDirective @@ -37,8 +38,10 @@ confdir = osp.dirname(__file__) project = 'psy-view' -copyright = '2020, Philipp S. Sommer' -author = 'Philipp S. Sommer' +copyright = ", ".join( + psy_view.__copyright__.strip().replace("Copyright (C) ", "").splitlines() +) +author = psy_view.__author__ version = re.match(r'\d+\.\d+\.\d+', psy_view.__version__).group() # type: ignore @@ -71,10 +74,6 @@ # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] -# on_rtd is whether we are on readthedocs.org, this line of code grabbed from -# docs.readthedocs.org -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' - # create the api documentation if not osp.exists(osp.join(osp.dirname(__file__), 'api')): spr.check_call(['bash', 'apigen.bash']) @@ -90,24 +89,13 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -if not on_rtd: # only import and set the theme if we're building docs locally - import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +html_theme = 'sphinx_rtd_theme' # 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_context = { - 'css_files': [ - # overrides for wide tables in RTD theme, particularly for - # psy-view vs. ncview comparison - '_static/theme_overrides.css', - ], - } - autodoc_default_options = { 'show_inheritance': True, 'autosummary': True, @@ -148,17 +136,14 @@ intersphinx_mapping = { 'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None), 'numpy': ('https://numpy.org/doc/stable/', None), - 'matplotlib': ('https://matplotlib.org/', None), + 'matplotlib': ('https://matplotlib.org/stable/', None), 'sphinx': ('https://www.sphinx-doc.org/en/master/', None), 'xarray': ('https://xarray.pydata.org/en/stable/', None), 'cartopy': ('https://scitools.org.uk/cartopy/docs/latest/', None), - 'psyplot': ('https://psyplot.readthedocs.io/en/latest/', None), - 'psy_simple': ('https://psyplot.readthedocs.io/projects/' - 'psy-simple/en/latest/', None), - 'psy_maps': ('https://psyplot.readthedocs.io/projects/' - 'psy-maps/en/latest/', None), - 'psyplot_gui': ('https://psyplot.readthedocs.io/projects/' - 'psyplot-gui/en/latest/', None), + 'psyplot': ('https://psyplot.github.io/psyplot/', None), + 'psy_simple': ('https://psyplot.github.io/psy-simple/', None), + 'psy_maps': ('https://psyplot.github.io/psy-maps/', None), + 'psyplot_gui': ('https://psyplot.github.io/psyplot-gui/', None), } @@ -173,8 +158,6 @@ def create_screenshot( from psyplot.data import open_dataset output = osp.join("_static", output) - if on_rtd: - return output app = QApplication.instance() if app is None: @@ -225,7 +208,7 @@ class ScreenshotDirective(SphinxDirective): has_content = False - option_spec = directives.images.Image.option_spec.copy() + option_spec = images.Image.option_spec.copy() option_spec["plot"] = directives.flag option_spec["enable"] = directives.flag @@ -307,8 +290,8 @@ def generate(self): self.add_line(indent + line) - def setup(app): app.add_directive('screenshot', ScreenshotDirective) app.add_directive("screenshot-figure", ScreenshotFigureDirective) app.add_config_value('rebuild_screenshots', rebuild_screenshots, 'env') + app.add_css_file("theme_overrides.css") diff --git a/docs/docs-getting-started-example.png b/docs/docs-getting-started-example.png deleted file mode 100644 index 2d9f51d..0000000 Binary files a/docs/docs-getting-started-example.png and /dev/null differ diff --git a/docs/docs-lineplot-example.png b/docs/docs-lineplot-example.png deleted file mode 100644 index f09671e..0000000 Binary files a/docs/docs-lineplot-example.png and /dev/null differ diff --git a/docs/docs-mapplot-example.png b/docs/docs-mapplot-example.png deleted file mode 100644 index 03dd811..0000000 Binary files a/docs/docs-mapplot-example.png and /dev/null differ diff --git a/docs/docs-plot2d-example.png b/docs/docs-plot2d-example.png deleted file mode 100644 index f152b4b..0000000 Binary files a/docs/docs-plot2d-example.png and /dev/null differ diff --git a/docs/environment.yml b/docs/environment.yml index 0532b71..4142528 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -1,16 +1,12 @@ name: psy-view-docs channels: + - local - psyplot/label/master - - psyplot - - chilipp/label/conda-forge + - conda-forge dependencies: - - python>3.5 + - python=3.8 - sphinx - sphinx_rtd_theme - - psy-maps - - psyplot-gui - - netcdf4 - - pip - - pip: - - autodocsumm - - sphinx-argparse + - psy-view + - autodocsumm + - sphinx-argparse diff --git a/docs/getting-started.rst b/docs/getting-started.rst index 2c284d6..0f1dd3a 100644 --- a/docs/getting-started.rst +++ b/docs/getting-started.rst @@ -27,7 +27,7 @@ you see the remote desktop, your URL will be something like 5. The file you uploaded will now appear on the desktop in the previous tab -.. |mybinder| image:: https://mybinder.org/badge_logo.svg +.. |mybinder| image:: https://static.mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/psyplot/psy-view/master?urlpath=%2Fdesktop :alt: mybinder-demo diff --git a/docs/index.rst b/docs/index.rst index a596c3b..75be6b7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -36,22 +36,28 @@ graphical user interface to quickly dive into the data inside a netCDF file. :stub-columns: 1 :widths: 10 90 - * - examples - - |mybinder| + * - docs + - |docs| |mybinder| * - tests - - |travis| |appveyor| |codecov| + - |circleci| |appveyor| |codecov| * - package - - |version| |conda| |supported-versions| |supported-implementations| |github| + - |version| |conda| |github| |zenodo| + * - implementations + - |supported-versions| |supported-implementations| * - get in touch - |gitter| |mailing-list| |issues| + .. |docs| image:: https://img.shields.io/github/deployments/psyplot/psy-view/github-pages + :alt: Documentation + :target: http://psyplot.github.io/psy-view/ + .. |mybinder| image:: https://mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/psyplot/psy-view/master?urlpath=%2Fdesktop :alt: mybinder.org - .. |travis| image:: https://travis-ci.org/psyplot/psy-view.svg?branch=master - :alt: Travis - :target: https://travis-ci.org/psyplot/psy-view + .. |circleci| image:: https://circleci.com/gh/psyplot/psy-view/tree/master.svg?style=svg + :alt: CircleCI + :target: https://circleci.com/gh/psyplot/psy-view/tree/master .. |appveyor| image:: https://ci.appveyor.com/api/projects/status/a7qxvvwt0e41j32h/branch/master?svg=true :alt: AppVeyor @@ -93,6 +99,10 @@ graphical user interface to quickly dive into the data inside a netCDF file. :target: https://github.com/psyplot/psy-view/issues :alt: GitHub issues + .. |zenodo| image:: https://zenodo.org/badge/249615633.svg + :alt: Zenodo + :target: https://zenodo.org/badge/latestdoi/249615633 + .. end-badges Features @@ -109,9 +119,9 @@ Some of the most important features offered by psy-view are: Interested? Read more in the section :ref:`psy-view-vs-ncview`. -.. _ICON: https://mpimet.mpg.de/en/communication/news/focus-on-overview/icon-development +.. _ICON: https://mpimet.mpg.de/en/science/modeling-with-icon/icon-configurations .. _UGRID: http://ugrid-conventions.github.io/ugrid-conventions/ -.. _psyplot-gui: https://psyplot.readthedocs.io/projects/psyplot-gui +.. _psyplot-gui: https://psyplot.github.io/psyplot-gui .. toctree:: :maxdepth: 2 diff --git a/docs/installing.rst b/docs/installing.rst index 814c04a..ef70008 100644 --- a/docs/installing.rst +++ b/docs/installing.rst @@ -94,12 +94,12 @@ Psy-view supports all python versions greater than 3.7. Other dependencies are .. _conda: https://conda.io/docs/ -.. _anaconda: https://www.anaconda.com/download/ -.. _miniconda: https://conda.io/miniconda.html -.. _psyplot: https://psyplot.readthedocs.io/en/latest/installing.html -.. _the corresponding dependencies: https://psyplot.readthedocs.io/en/latest/installing.html#dependencies -.. _psy-maps: https://psyplot.readthedocs.io/projects/psy-maps/en/latest/installing.html -.. _psyplot-gui: https://psyplot.readthedocs.io/projects/psyplot-gui/en/latest/installing.html +.. _anaconda: https://www.anaconda.com/products/individual +.. _miniconda: https://docs.conda.io/en/latest/miniconda.html +.. _psyplot: https://psyplot.github.io/psyplot/installing.html +.. _the corresponding dependencies: https://psyplot.github.io/psyplot/installing.html#dependencies +.. _psy-maps: https://psyplot.github.io/psy-maps/installing.html +.. _psyplot-gui: https://psyplot.github.io/psyplot-gui/installing.html .. _netCDF4: https://github.com/Unidata/netcdf4-python @@ -149,7 +149,7 @@ Then build the docs via:: .. _github: https://github.com/psyplot/psy-view -.. _pytest: https://pytest.org/latest/contents.html +.. _pytest: https://pytest.org/en/latest/contents.html .. _uninstall: diff --git a/docs/ncview.rst b/docs/ncview.rst index ff49c86..9591eed 100644 --- a/docs/ncview.rst +++ b/docs/ncview.rst @@ -2,7 +2,7 @@ psy-view vs. ncview =================== -When developping *psy-view*, we had the intuitiveness of ncview_ in mind, a +When developping *psy-view*, we had the intuitiveness of ncview_ in mind, a light-weight graphical user interface to visualize the contents of netCDF files. In general, `psy-view` can do everything that `ncview` does, and more. @@ -14,7 +14,7 @@ In general, `psy-view` can do everything that `ncview` does, and more. .. _ncview: http://meteora.ucsd.edu/~pierce/ncview_home_page.html The following table tries to summarize the differences of the features for both -softwares. If you feel like anything is missing or wrong, please tell us by +softwares. If you feel like anything is missing or wrong, please tell us by creating a new issue at https://github.com/psyplot/psy-view/issues/ .. list-table:: psy-view vs. ncview @@ -26,39 +26,39 @@ creating a new issue at https://github.com/psyplot/psy-view/issues/ - psy-view - ncview * - supported grids - - + - * rectilinear (i.e. standard :math:`nx\times ny` grid) * ICON_ (triangular, hexagonal, etc.) * UGRID_ (triangular, hexagonal, etc.) - rectilinear * - supported plots - - + - * georeferenced plots * standard 2D-plots * line plots - - + - * georeferenced plots * standard 2D-plots * line plots * - mouse features - - - * plot a time series when clicking on a plot + - + * plot a time series when clicking on a plot * show coordinates and data when hovering the plot - - - * plot a time series when clicking on a plot + - + * plot a time series when clicking on a plot * show coordinates and data when hovering the plot * - View the data - not yet implemented - comes with a simple and basic editor * - image export - all common formats (e.g. - :abbr:`PDF (Portable Document Format)`, - :abbr:`PNG (Portable Network Graphics)`, + :abbr:`PDF (Portable Document Format)`, + :abbr:`PNG (Portable Network Graphics)`, :abbr:`GIF (Graphics Interchange Format)`, etc.) with high resolution - :abbr:`PS (PostScript)` * - animation export - GIF, MP4 (using ffmpeg or imagemagick) - + .. note:: This is a beta feature @@ -68,10 +68,10 @@ creating a new issue at https://github.com/psyplot/psy-view/issues/ - fast locally, slow via X11 - fast * - projection support - - + - * decodes CF-conformal grid_mapping_ attributes * flexibly choose the `projection of the plot via cartopy`_ - - + - * decodes CF-conformal grid_mapping_ attributes * plots on standard lat-lon projection only * - supported files @@ -99,11 +99,11 @@ creating a new issue at https://github.com/psyplot/psy-view/issues/ .. _grid_mapping: http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#appendix-grid-mappings -.. _projection of the plot via cartopy: https://scitools.org.uk/cartopy/docs/latest/crs/projections.html +.. _projection of the plot via cartopy: https://scitools.org.uk/cartopy/docs/latest/reference/crs.html#list-of-projections .. _xarray: http://xarray.pydata.org/en/stable/ .. _matplotlib: https://matplotlib.org/ .. _PyQt5: https://riverbankcomputing.com/software/pyqt .. _cartopy: https://scitools.org.uk/cartopy/docs/latest -.. _psyplot GUI: https://psyplot.readthedocs.io/projects/psyplot-gui/en/latest/ -.. _ICON: https://mpimet.mpg.de/en/communication/news/focus-on-overview/icon-development +.. _psyplot GUI: https://psyplot.github.io/psyplot-gui/ +.. _ICON: https://mpimet.mpg.de/en/science/modeling-with-icon/icon-configurations .. _UGRID: http://ugrid-conventions.github.io/ugrid-conventions/ diff --git a/docs/user-guide.rst b/docs/user-guide.rst index 62805d9..4dd7de0 100644 --- a/docs/user-guide.rst +++ b/docs/user-guide.rst @@ -41,7 +41,7 @@ in the terminal. in the terminal to start it from there. See also :ref:`psyplot-gui-embed`. -.. _psyplot GUI: https://psyplot.readthedocs.io/projects/psyplot-gui +.. _psyplot GUI: https://psyplot.github.io/psyplot-gui .. _user-guide-gui: diff --git a/psy_view/ds_widget.py b/psy_view/ds_widget.py index 3ce2b2e..0ac5aa4 100644 --- a/psy_view/ds_widget.py +++ b/psy_view/ds_widget.py @@ -99,7 +99,7 @@ def get_dims_to_iterate(arr: DataArray) -> List[str]:
%i for a continuous counter of the images%(name)s for variable names