https://github.com/GeoscienceAustralia/PyRate
Tip revision: d0a634bff0ab79420b9e28abd21f1f48146f642c authored by Matt Garthwaite on 22 May 2017, 05:42:23 UTC
update version to 0.2.0
update version to 0.2.0
Tip revision: d0a634b
compat.py
# This Python module is part of the PyRate software package.
#
# Copyright 2017 Geoscience Australia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
This Python module tests compatibilities
"""
# coding: utf-8
# pylint: disable= invalid-name, unused-import, import-error
from __future__ import absolute_import
import sys
PY3 = (sys.version_info[0] == 3)
try:
import pygrib
import PyAPS
PyAPS_INSTALLED = True
except ImportError:
PyAPS_INSTALLED = False
if PY3:
import pickle
else:
import cPickle as pickle
class PyAPSException(Exception):
"""
Convenience class for PyAPS status
"""
def validate_pyaps():
"""
Convenience function validating PyAPS status
"""
if not PyAPS_INSTALLED:
raise PyAPSException('PyAPS needs to be installed in order '
'to use this module')
