Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ARM-DOE/pyart into doc_rt…
Browse files Browse the repository at this point in the history
…d_enhancement
  • Loading branch information
zssherman committed Jan 14, 2020
2 parents 802d33f + b5f8fce commit 66fe121
Show file tree
Hide file tree
Showing 43 changed files with 58 additions and 113 deletions.
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ Install
=======

The easiest method for installing Py-ART is to use the conda packages from
the latest release. To do this you must download and install
the latest release and use Python 3, as Python 2 support ended January 1st,
2020 and many packages including Py-ART no longer support Python 2.
To do this you must download and install
`Anaconda <https://www.anaconda.com/download/#>`_ or
`Miniconda <https://conda.io/miniconda.html>`_.
With Anaconda or Miniconda install, it is recommended to create a new conda
Expand Down
1 change: 0 additions & 1 deletion continuous_integration/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ conda update -q conda
## Create a testenv with the correct Python version
conda env create -f continuous_integration/environment-$PYTHON_VERSION.yml
source activate testenv
# TODO install cylp and glpk in Python 2.7

# upgrade pip
pip install --upgrade pip
Expand Down
36 changes: 18 additions & 18 deletions guides/CI_SETUP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Services
Py-ART's CI setup is hosted on two services, `Travis CI`_ and `AppVeyor`_.
Both of these are hosted continuous integration services that are free for open
source projects. Travis CI runs the tests on a Linux platform and AppVeyor
runs on Windows. Currently no tests are run on macOS although Travis CI does
runs on Windows. Currently no tests are run on macOS although Travis CI does
support this platform.

.. _Travis CI : https://travis-ci.org/
Expand All @@ -24,35 +24,35 @@ Travis CI
---------

The CI setup on Travis CI is controlled by the ``.travis.yml`` file in the
repository root. This file contains multiple sections which define the steps
taken in a CI run. The `Travis CI documentation`_ provide details on these
repository root. This file contains multiple sections which define the steps
taken in a CI run. The `Travis CI documentation`_ provide details on these
sections and Travis CI in general.

Briefly the sections in the file include:

- An encrypted environment variable used to push the documentation built
upon each merge to the master branch to the `pyart-docs-travis`_ repo.
- A matrix section which defines the various combinations of Python versions
and other parameters which will be tested. Currently Python 2.7, 3.4, 3.5
and 3.6 are tested with a second Python 2.7 run also testing that the
and other parameters which will be tested. Currently Python 3.6, 3.7
and 3.8 are tested with a second Python 3.8 run also testing that the
package can be built from a conda recipe and that the docs build.
- An install section which executes the ``install.sh`` script in the
continuous_integration directory.
- A script section which runs the tests using ``nosetests``
- A script section which runs the tests using ``pytest``
- A after_success section which reports test coverage to `Coveralls`_.
Currently nothing is done with this information but it may be useful later
to view how test coverage has changed over time.
- The after_success section also runs the ``build_docs.sh`` script in the
continuous_integration directory for the appropriate matrix element. On
non-merge commits this tests that the documentation can be build. On merge
continuous_integration directory for the appropriate matrix element. On
non-merge commits this tests that the documentation can be build. On merge
commits this builds the docs and uploads them to the `pyart-docs-travis`_
repository which makes them available on the `Py-ART documentation page`_.

The bulk of the test environment setup is done by the ``install.sh`` script in
the continuous_integration directory. This script downloads, installs and
the continuous_integration directory. This script downloads, installs and
configures the latest version of Miniconda3, creates a conda environment for
the Python version being tested with the various requirements specified in the
environment-XXX.yml file, and builds Py-ART in that environment. For the
environment-XXX.yml file, and builds Py-ART in that environment. For the
matrix element where Py-ART is build from a conda recipe, the if/then block
installs conda-build, builds Py-ART from the recipe in the repository and
installs this conda package into the test conda environment.
Expand All @@ -73,12 +73,12 @@ enviroment-X.X.yml files in the continuous_integration directory. Over time
these may need to be updated.

To debug Travis CI issue use the logs provided for the builds themselves to see
where the issues are occurring. Un-commenting the ``set -x`` line in the
``install.sh`` script may be helpful when debugging Travis CI issue. With this
where the issues are occurring. Un-commenting the ``set -x`` line in the
``install.sh`` script may be helpful when debugging Travis CI issue. With this
line uncommented the commands being executed are echoed in the log.

Additionally, it can be helpful to run the CI builds locally to quickly test
out changes to the setup and try out specific commands. Travis CI provides
out changes to the setup and try out specific commands. Travis CI provides
the docker `images`_ used by their service and instructions on how to
`run these locally`_.

Expand All @@ -89,14 +89,14 @@ the docker `images`_ used by their service and instructions on how to
AppVeyor
--------

The second CI service used by Py-ART is `AppVeyor_`. This setup is controlled
The second CI service used by Py-ART is `AppVeyor_`. This setup is controlled
by the ``appveyor.yml`` file in the repository and builds and runs the unit
tests on a Windows platform. This services is slower than Travis CI so only
two Python versions are tested (2.7 and 3.5). All setup and configuration is
tests on a Windows platform. This services is slower than Travis CI so only
two Python versions are tested (3.7 and 3.8). All setup and configuration is
done in the ``appveyor.yml`` file besides a setup function used by many
projects which can be found in the ``run_with_env.cmd`` file in the
continuous_integration/appveyor directory. This file contains comments which
explain the steps being performed and some debugging details. Refer to the
continuous_integration/appveyor directory. This file contains comments which
explain the steps being performed and some debugging details. Refer to the
`AppVeyor documentation`_ for details.

.. _AppVeyor : https://www.appveyor.com/
Expand Down
36 changes: 18 additions & 18 deletions guides/HOWTO_RELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Make the tagged git release
---------------------------

Change the ``ISRELEASE`` line in the **setup.py** file in the root directory to
True. Check this change into git and create a tagged commit with the version
string. The commit message should be "REL: Release X.X.X" with the proper
version filled in. This commit and the tag should be pushed directly to the
True. Check this change into git and create a tagged commit with the version
string. The commit message should be "REL: Release X.X.X" with the proper
version filled in. This commit and the tag should be pushed directly to the
ARM-DOE repository on GitHub. This can be done using the following, assuming
upstream points to https://github.com/ARM-DOE/pyart.git.

Expand Down Expand Up @@ -42,7 +42,7 @@ that this file can be used to install a working version of Py-ART.

Once tested the tar.gz source distribution file can be uploaded to PyPI using
`twine <https://pypi.python.org/pypi/twine>`_, installing if needed, with the
command ``twine upload dist/*``. This command will prompt the user for their
command ``twine upload dist/*``. This command will prompt the user for their
PyPI credentials. After uploading check that this file is available for
download from
`pypi.python.org/pypi/arm_pyart <https://pypi.python.org/pypi/arm_pyart>`_.
Expand All @@ -66,7 +66,7 @@ Prepare the release notes
-------------------------

Prepare a short description of the changes, improvements and deprecations in
the new release. The format used in previous releases makes a good template
the new release. The format used in previous releases makes a good template
for this text. The following git commands can be used to list all merge commits
and the contributors to a particular version which may be helpful when drafting
these notes.
Expand All @@ -91,11 +91,11 @@ Create and upload version specific documentation
------------------------------------------------

The Py-ART documentation page contains links to documentation and examples from
the latest release. These pages must be updated when a new release is made.
the latest release. These pages must be updated when a new release is made.
To build the documentation for a release, go to the doc directory and run the
``rebuild_full_docs.sh`` shell script. Note that this should be done while the
``rebuild_full_docs.sh`` shell script. Note that this should be done while the
release commit is checked out and on a system with all optional requirements
for the examples and sphinx install. Additionally, the files needed for the
for the examples and sphinx install. Additionally, the files needed for the
examples must be copied into the correct locations in the examples directory.

Once the documentation has been built, the contents of the doc/build/html
Expand All @@ -104,9 +104,9 @@ in the dev directory. Typically this process is best done in a directory where
the ARM-DOE repository has been cloned and the gh-pages branch checked out.

First, the current dev directory should be moved to a versioned directory using
``git mv dev v1_7`` and a commit made. Then create an empty ``dev`` directory
and copy all the files from the doc/build/html directory. Check these new
files into git and create a commit. Finally, push these changes to the ARM-DOE
``git mv dev v1_7`` and a commit made. Then create an empty ``dev`` directory
and copy all the files from the doc/build/html directory. Check these new
files into git and create a commit. Finally, push these changes to the ARM-DOE
repository. After a few minutes check that the new documentation is available
at `http://arm-doe.github.io/pyart/dev/ <http://arm-doe.github.io/pyart/dev/>`_.

Expand All @@ -117,8 +117,8 @@ Prepare the repository for the next version
To begin the development of the next version of Py-ART the ``MINOR`` variable
should be incremented and ``ISRELEASED`` should be changed back to False.
Make this change to the ``setup.py`` file in the root directory and create a
commit with the message ``MAINT: start v1.9+dev``. See the commit for the
`start of the 1.8+dev`_ as an example. Push this commit directly to the
commit with the message ``MAINT: start v1.9+dev``. See the commit for the
`start of the 1.8+dev`_ as an example. Push this commit directly to the
ARM-DOE repository.

.. _start of the 1.8+dev : https://github.com/ARM-DOE/pyart/commit/e3d01232ac3787da38456152da6b9db3ab46d4d7
Expand All @@ -130,17 +130,17 @@ to remove them.
Create conda packages on conda-forge
------------------------------------

Conda package for Py-ART are created using the conda-forge feedstock. To
Conda package for Py-ART are created using the conda-forge feedstock. To
create a new release first fork the `arm_pyart-feedstock`_ repository or update
your fork. Then clone the fork and checkout a new branch. Update the first
your fork. Then clone the fork and checkout a new branch. Update the first
few lines of the ``recipe/meta.yaml`` with the new version number and a sha256
hash of the file on PyPI. Check this change in as a new commit. Next rerender
hash of the file on PyPI. Check this change in as a new commit. Next rerender
the feedstock using ``conda smithy rerender``, installing ``conda-smithy``
if needed.

Finally, push the branch up to your fork and create a pull request against the
conda-forge feedstock. The CI services will test the recipe by building conda
packages on all three platforms and Python+NumPy combinations. Once these
packages on all three platforms and Python+NumPy combinations. Once these
pass the pull request can be merged and the CI services will again build the
packages and uploaded them to the conda-forge Anaconda cloud channel.

Expand All @@ -153,7 +153,7 @@ process works.
Announce the release on the pyart-user mailing list
---------------------------------------------------

Announce the new release on the `Py-ART mailing list`_. Use a previous
Announce the new release on the `Py-ART mailing list`_. Use a previous
announcement as a template and include the release notes written above.

.. _Py-ART mailing list : http://groups.google.com/group/pyart-users/
6 changes: 4 additions & 2 deletions guides/contributors_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ please cite:
DOI: http://doi.org/10.5334/jors.119

Py-ART implements many published scientific methods which should *also* be
cited if you make use of them. Refer to the **References** section in the
cited if you make use of them. Refer to the **References** section in the
documentation of the functions used for information on these citations.


Install
-------

The easiest method for installing Py-ART is to use the conda packages from
the latest release. To do this you must download and install
the latest release and use Python 3, as Python 2 support ended January 1st,
2020 and many packages including Py-ART no longer support Python 2.
To do this you must download and install
`Anaconda <https://www.anaconda.com/download/#>`_ or
`Miniconda <https://conda.io/miniconda.html>`_.
Then use the following command in a terminal or command prompt to install
Expand Down
2 changes: 1 addition & 1 deletion guides/setting_up_an_environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if you want Jupyter Notebook to run in that enviroment with those packages::
while that environment is activated. Another way to create a conda environment
is by doing it from scratch using the conda create command. An example of this::

conda create -n pyart_env -c conda-forge python=3.6 arm_pyart netCDF4
conda create -n pyart_env -c conda-forge python=3.8 arm_pyart netCDF4
cartopy scipy numpy matplotlib

This will also create an environment called pyart_env that can be activate the
Expand Down
2 changes: 0 additions & 2 deletions pyart/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
"""

from __future__ import print_function

# Detect if we're being called as part of Py-ART's setup procedure
try:
__PYART_SETUP__
Expand Down
1 change: 0 additions & 1 deletion pyart/_debug_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"""

from __future__ import print_function
import os
import sys

Expand Down
2 changes: 0 additions & 2 deletions pyart/aux_io/sinarame_h5.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
"""

from __future__ import print_function

from datetime import datetime
import glob
import os
Expand Down
13 changes: 12 additions & 1 deletion pyart/core/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@

import numpy as np
from netCDF4 import num2date
import xarray

try:
import xarray
_XARRAY_AVAILABLE = True
except ImportError:
_XARRAY_AVAILABLE = False

try:
import pyproj
Expand Down Expand Up @@ -300,6 +305,12 @@ def to_xarray(self):
in a one dimensional array.
"""

if not _XARRAY_AVAILABLE:
raise MissingOptionalDependency(
'Xarray is required to use Grid.to_xarray but is not '
+ 'installed!')

lon, lat = self.get_point_longitude_latitude()
z = self.z['data']
y = self.y['data']
Expand Down
1 change: 0 additions & 1 deletion pyart/core/radar.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"""
from __future__ import print_function

import copy
import sys
Expand Down
2 changes: 0 additions & 2 deletions pyart/core/tests/test_grid.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
""" Unit Tests for Py-ART's core/grid.py module. """

from __future__ import print_function

import functools
import pickle

Expand Down
2 changes: 0 additions & 2 deletions pyart/core/tests/test_wind_profile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
""" Unit Tests for Py-ART's core/wind_profile.py module. """

from __future__ import print_function

import numpy as np
from numpy.testing import assert_almost_equal
import pytest
Expand Down
1 change: 0 additions & 1 deletion pyart/correct/despeckle.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"""

from __future__ import division
import numpy as np
from scipy.ndimage import label
from scipy.signal import convolve2d
Expand Down
2 changes: 0 additions & 2 deletions pyart/correct/phase_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
"""

from __future__ import print_function, division

import copy
from time import time

Expand Down
2 changes: 0 additions & 2 deletions pyart/correct/tests/test_region_dealias.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# to recreate a dealias_plot.png file showing the before and after doppler
# velocities

from __future__ import print_function

import warnings

import pyart
Expand Down
2 changes: 0 additions & 2 deletions pyart/correct/tests/test_unwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# to recreate a dealias_plot.png file showing the before and after doppler
# velocities

from __future__ import print_function

import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
import pytest
Expand Down
2 changes: 0 additions & 2 deletions pyart/correct/unwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
"""

from __future__ import print_function

import numpy as np

from ..config import get_metadata, get_fillvalue
Expand Down
1 change: 0 additions & 1 deletion pyart/graph/cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
# http://matplotlib.org/.
# Copyright (c) 2012-2013 Matplotlib Development Team; All Rights Reserved

from __future__ import print_function, division
import warnings

import matplotlib as mpl
Expand Down
2 changes: 0 additions & 2 deletions pyart/graph/gridmapdisplay_basemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
"""

from __future__ import print_function

import warnings

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions pyart/graph/tests/test_radardisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# in baseline_images directory. Current this test only determines if files can
# be created, not that they are correct.

from __future__ import print_function

import warnings
import datetime

Expand Down
2 changes: 0 additions & 2 deletions pyart/io/_sigmetfile.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ A class and supporting functions for reading Sigmet (raw format) files.
_unpack_ingest_header
"""
from __future__ import print_function

import struct
import datetime
import warnings
Expand Down
Loading

0 comments on commit 66fe121

Please sign in to comment.