Skip to content

Commit

Permalink
DOC: Update outdated installation instructions (#1462)
Browse files Browse the repository at this point in the history
* FIX: Add isinstance checks to improve linting

* FIX: Update the installation instructions

* FIX: Update python versions

* FIX: Update master to main in contributors guide
  • Loading branch information
mgrover1 committed Sep 20, 2023
1 parent cd38bce commit e5fe221
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 599 deletions.
13 changes: 6 additions & 7 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ documentation style.

For more on the NumPy documentation style:

- https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
- https://github.com/numpy/numpy/blob/main/doc/HOWTO_DOCUMENT.rst.txt

An example:

Expand Down Expand Up @@ -340,9 +340,9 @@ GitHub

When contributing to pyart, the changes created should be in a new branch
under your forked repository. Let's say the user is adding a new map display.
Instead of creating that new function in your master branch. Create a new
Instead of creating that new function in your main branch. Create a new
branch called ‘cartopy_map’. If everything checks out and the admin
accepts the pull request, you can then merge the master branch and
accepts the pull request, you can then merge the main branch and
cartopy_map branch.

To delete a branch both locally and remotely, if done with it::
Expand All @@ -362,16 +362,15 @@ To create a new branch::

If you have a branch with changes that have not been added to a pull request
but you would like to start a new branch with a different task in mind. It
is recommended that your new branch is based on your master. First::

git checkout master
is recommended that your new branch is based on your main. First::

git checkout main
Then::

git checkout -b <branch_name>

This way, your new branch is not a combination of your other task branch and
the new task branch, but is based on the original master branch.
the new task branch, but is based on the original main branch.

Typing `git status` will not only inform the user of what files have been
modified and untracked, it will also inform the user of which branch they
Expand Down
6 changes: 3 additions & 3 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ without these packages.
* `Basemap <https://matplotlib.org/basemap/>`_ But Cartopy is recommended as
basemap will no longer have support.

* `xarray <https://xarray.pydata.org/en/stable/`_
* `pyproj <https://code.google.com/p/pyproj/`_
* `xarray <https://docs.xarray.dev/en/stable/>`_
* `pyproj <https://github.com/pyproj4/pyproj>`_

* `pytest <https://docs.pytest.org/en/latest/`_
* `pytest <https://docs.pytest.org/en/latest/>`_

Obtaining the latest source
===========================
Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
"numpy": ("https://numpy.org/doc/stable", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
"matplotlib": ("https://matplotlib.org", None),
"matplotlib": ("https://matplotlib.org/stable", None),
}

# Add myst extensions
Expand Down
6 changes: 4 additions & 2 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ Short Courses
Various short courses on Py-ART and open source radar software have been given
which contain tutorial like materials and additional examples.

* `2023 AMS, Open Source Radar Short Course <https://github.com/openradar/ams-open-radar-2023>`_
* `2022 ERAD, Open Source Radar Short Course <https://github.com/openradar/erad2022>`_
* `2015 AMS, Open Source Radar Short Course <https://github.com/openradar/AMS-Short-Course-on-Open-Source-Radar-Software>`_
* `2015 ARM/ASR Meeting, PyART, the Python ARM Radar Toolkit <https://github.com/ARM-DOE/notebooks/tree/master/ASR_PI_2015>`_
* `2014 ARM/ASM Meeting, Py-ART tutorial <https://github.com/ARM-DOE/notebooks/tree/master/ASR_PI_2014>`_
Expand All @@ -183,7 +185,7 @@ environment based on the `environment.yml <https://github.com/ARM-DOE/pyart/blob

Or for a basic environment and downloading optional dependencies as needed::

conda create -n pyart_env -c conda-forge python=3.8 arm_pyart
conda create -n pyart_env -c conda-forge arm_pyart

Basic command in a terminal or command prompt to install the latest version of
Py-ART::
Expand All @@ -205,7 +207,7 @@ Additional detail on installing Py-ART can be found in the installation section.
Dependencies
============

Py-ART is tested to work under Python 3.6, 3.7 and 3.8
Py-ART is tested to work under Python 3.9, 3.10, and 3.11

The required dependencies to install Py-ART in addition to Python are:

Expand Down
157 changes: 1 addition & 156 deletions doc/source/userguide/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -1,156 +1 @@
============
Installation
============

Required Dependencies
=====================

Py-ART requires the following software.

* Python__ 3.6.x, 3.7.x or 3.8x

__ http://www.python.org

* NumPy__

__ http://www.scipy.org

* SciPy__

__ http://www.scipy.org

* matplotlib__

__ http://matplotlib.org/

* netCDF4__

__ https://github.com/Unidata/netcdf4-python


Optional Dependencies
=====================

The following packages are recommended for a fully-functional Py-ART
installation, but the package will install and work with reduced functionality
without these packages.

* `TRMM RSL <https://trmm-fc.gsfc.nasa.gov/trmm_gv/software/rsl/>`_

* `CyLP <https://github.com/mpy/CyLP>`_ or
`PyGLPK <https://tfinley.net/software/pyglpk/>`_ or
`CVXOPT <https://cvxopt.org/>`_ and their dependencies.

* `Cartopy <https://scitools.org.uk/cartopy/docs/latest/>`_ or
* `Basemap <https://matplotlib.org/basemap/>`_ But Cartopy is recommended as
basemap will no longer have support.

* `xarray <https://xarray.pydata.org/en/stable/>`_
* `pyproj <https://code.google.com/p/pyproj/>`_

* `pytest <https://docs.pytest.org/en/latest/>`_

Obtaining the latest source
===========================

The latest source code for Py-ART can be obtained from the GitHub repository,
https://github.com/ARM-DOE/pyart.

The latest source can be checked out using

::

$ git clone https://github.com/ARM-DOE/pyart.git


Installing from Source
======================

The path to the TRMM RSL library must be provided during install. This can
either be done by setting the ``RSL_PATH`` environmentation variable. In bash
this can be done using ``export RSL_PATH=/path/to/rsl/``. If this location is
not specified, some common locations will be searched. Note that the location
provided should be the root TRMM RSL path, under which both a `lib` and
`include` directory are contained, the default location is ``/lib/local/trmm``.
If using CyLP, a path for the coincbc directory is needed. This can be done
using ``export COIN_INSTALL_DIR=/path/to/coincbc/``. When using CyLP, on some
systems, installing the Anaconda compilers is needed. These can be found here:
https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html

After specifying the TRMM RSL path Py-ART can be installed globally using

::

$ python setup.py install

of locally using

::

$ python setup.py install --user

If you prefer to use Py-ART without installing, simply add the this path to
your ``PYTHONPATH`` (directory or with a .pth file) and compile the extension
in-place.

::

$ python setup.py build_ext -i

You can also install Py-ART in development mode by using

::

$ pip install -e .

Frequently asked questions
==========================

* I'm getting a no 'io' module after installing pyart with pip.

There is a pyart on pip that is a different package. Make sure to do::

pip install arm_pyart

and not::

pip install pyart

* I'm getting a segfault or compile error with CyLP in newer Python versions
when installing in an environment.

Anaconda has its own compilers now on conda-forge. Theres can be found here:
https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html
Once the proper compilers are installed, reinstall CyLP.

* I'm getting a segfault or another error in python when using
``pyart.io.read_rsl()`` with IRIS/other files.

This is due to a bug in RSL, and can be remedied by adding
``-fno-stack-protector -D_FORTIFY_SOURCE=0`` to the CFLAGS parameter of the
makefile of RSL. This issue has been fixed with the release of rsl-v1.44.

* I'm having trouble getting PyGLPK to compile on my 64-bit operating system.

Change the line in the setup.py file from

::

define_macros = macros, extra_compile_args=['-m32'], extra_link_args=['-m32'],

to

::

define_macros = macros, extra_compile_args=['-m64'], extra_link_args=['-m64'],

Then build and install PyGLPK as recommended in the PYGLPK README.txt file.

* When running basemap, I get an error 'KeyError: PROJ_LIB'.

Basemap is not being supported beyond 2020, some of these errors relate
to it not playing nicely with newer versions of packages. We recommend using
Cartopy instead, but some users have been able to use:
import os
os.environ['PROJ_LIB'] = 'C:/Users/xx Username xxx/Anaconda3/Lib/site-packages/mpl_toolkits/basemap'
To get basemap working, but again Cartopy should be used instead of Basemap.
.. include:: ../../../INSTALL.rst
Loading

0 comments on commit e5fe221

Please sign in to comment.