Python front end for the Radar Altimeter Database System.
Project description
Python access to the Radar Altimeter Database System
Python library for access to the Radar Altimeter Database System (RADS).
Current Features
Loading of the RADS XML files.
Planned Features
Loading of RADS data.
Documentation
Documentation for PyRADS can be found at https://pyrads.readthedocs.io/en/latest/ or in PDF and Epub formats.
Installation
Only POSIX complaint systems are officially supported. PyRADS should work on Microsoft Windows but it has not been tested.
UDUINITS2
In addition to CPython 3.6+ PyRADS requires the UDUNITS2 library and header files to be installed. Below are instructions for accomplishing this on some common systems:
Ubuntu and Debian
# apt-get install libudunits2-dev
Red Hat and Fedora
# yum install udunits2-devel
Mac OS X (using _homebrew)
$ brew install udunits
Microsoft Windows
No binary is provided for Windows so UDUNITS2 must be built from source.
libxml2
PyRADS also optionally requires libxml2 which it uses for better error messages and slightly faster RADS XML file loading.
Ubuntu and Debian
# apt-get install libxml2
Red Hat and Fedora
# yum install libxml2
Mac OS X (using _homebrew)
$ brew install libxml2
PyRADS
Now that the system dependencies have been installed PyRADS can be installed from PyPI:
$ pip install rads
or if libxml2 is installed
$ pip install rads[lxml]
Usage
PyRADS is currently in development, and will remain so until its first v1.0.0 release. Until then the public API may change from one minor release to another. However, patch releases will not change the public API.
Loading RADS configuration files
Currently, PyRADS is only capable of loading the RADS XML files. Loading data is planned for a future release.
The easiest way to load the RADS v4 XML files is to ensure that the
RADSDATAROOT
environment variable is set with the path to the RADS
data root as documented in the official RADS User Manual. Once this is
done, PyRADS can load all the same XML files that the official RADS
implementation does by default (it will also load PyRADS specific XML files
as well).
>>> import rads
>>> rads_config = rads.load_config()
The files that will be loaded are (on Unix):
<dataroot>/conf/rads.xml
/etc/pyrads/settings.xml
~/.rads/rads.xml
~/.config/pyrads/settings.xml
rads.xml
pyrads.xml
where each file can override or append to the settings of the previous files.
If not using Unix, use the rads.config_files() function to retrieve your platform specific list.
To add XML files to this:
>>> import rads
>>> xml_files = rads.config_files() + ['path/to/custom/file.xml']
>>> rads_config = rads.load_config(xml_files=xml_files)
The RADS data root can also be overridden:
>>> import rads
>>> rads_config = rads.load_config(dataroot='/path/to/custom/dataroot')
The entire RADS config can be displayed in human readable form with:
>>> import rads
>>> print(rads.load_config().full_string())
For more information on loading of RADS v4 XML configuration files consult the documentation.
Development
invoke
PyRADS uses invoke to make common development tasks easier. For example the simplest way to get started working on PyRADS is to fork and clone the repository and then from within the main project directory:
pip install invoke && invoke develop
This will install all development requirements with pip
and thus it is recommended to do this from a virtualenv
.
If you are working on a system where libxml2 is installed you may wish to also install lxml to provide faster XML parsing, but more importantly better error messages. With lxml, configuration parsing errors will be identified by line number.
To get the full list tasks that can be run by invoke:
invoke -l
For example, to run the formatters (isort and black), static checkers, and all tests (with coverage report):
invoke format check test --coverage
NOTE: This should be ran before making any commits.
The classic python setup.py test
is supported as well but only runs the unit tests.
If on a non UNIX environment some of the tasks may fail. If this happens you can use the --dry
flag to print out the commands that would be ran and then adjust accordingly.
tox
While the above invoke tasks are relatively quick and are good for development they are insufficient to ensure PyRADS is working properly across all options (lxml or not) and all supported Python versions. For this a tox configuration is provided. To run the full test suite simply run:
tox
Or if you have a recent version of tox
you can speed up the process with:
tox --parallel auto
The doc-pdf
environment will fail if XeTeX, xindy, and latexmk. This is usually fine.
If all tests run by tox succeed (except for doc-pdf
) the TravisCI build should succeed as well.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rads-0.1.0.post0.tar.gz
.
File metadata
- Download URL: rads-0.1.0.post0.tar.gz
- Upload date:
- Size: 183.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3fc58ca3c092e869d8e7953b1b0e83f633604b4e081ae48c2b28659f2d29336 |
|
MD5 | a90d2eb45e223357f71abafeac2b4246 |
|
BLAKE2b-256 | 87ce7d84c6a4e17aac9ef73197d0eb5b7e0b0d322bc1cea51f58b84cd648b8bf |
File details
Details for the file rads-0.1.0.post0-py3-none-any.whl
.
File metadata
- Download URL: rads-0.1.0.post0-py3-none-any.whl
- Upload date:
- Size: 88.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc038b386a25c00d769d68ebc877d873d6ca6d3aa7ad3e42de08b803fa897f83 |
|
MD5 | bcf04bf6dc8d7afe0cfd1facd89cf808 |
|
BLAKE2b-256 | 7a7b0f3e022522e2981a5c4d7d0e0593760a260a3a0cc9438670c173666853d5 |