except ImportError: pass import numpy as np from numpy.testing import assert_almost_equal import pandas as pd import unittest import pytest from pvlib.location import Location try: from numba import __version__ as numba_version numba_version_int = int(numba_version.split('.')[0] + numba_version.split('.')[1]) except ImportError: numba_version_int = 0 times = (pd.date_range('2003-10-17 12:30:30', periods=1, freq='D') .tz_localize('MST')) unixtimes = np.array(times.tz_convert('UTC').astype(np.int64)*1.0/10**9) lat = 39.742476 lon = -105.1786 elev = 1830.14 pressure = 820 temp = 11 delta_t = 67.0
# this block is a way to use an environment variable to switch between # compiling the functions with numba or just use numpy def nocompile(*args, **kwargs): return lambda func: func if os.getenv('PVLIB_USE_NUMBA', '0') != '0': try: from numba import jit, __version__ except ImportError: warnings.warn('Could not import numba, falling back to numpy ' + 'calculation') jcompile = nocompile USE_NUMBA = False else: major, minor = __version__.split('.')[:2] if int(major + minor) >= 17: # need at least numba >= 0.17.0 jcompile = jit USE_NUMBA = True else: warnings.warn('Numba version must be >= 0.17.0, falling back to ' + 'numpy') jcompile = nocompile USE_NUMBA = False else: jcompile = nocompile USE_NUMBA = False TABLE_1_DICT = {
pass import numpy as np import numpy.testing as npt import pandas as pd import unittest from nose.tools import raises, assert_almost_equals from nose.plugins.skip import SkipTest from pvlib.location import Location try: from numba import __version__ as numba_version numba_version_int = int( numba_version.split('.')[0] + numba_version.split('.')[1]) except ImportError: numba_version_int = 0 times = pd.date_range('2003-10-17 12:30:30', periods=1, freq='D').tz_localize('MST') unixtimes = times.tz_convert('UTC').astype(np.int64) * 1.0 / 10**9 lat = 39.742476 lon = -105.1786 elev = 1830.14 pressure = 820 temp = 11 delta_t = 67.0 atmos_refract = 0.5667 JD = 2452930.312847
except ImportError: pass import numpy as np from numpy.testing import assert_almost_equal import pandas as pd import unittest import pytest from pvlib.location import Location try: from numba import __version__ as numba_version numba_version_int = int(numba_version.split('.')[0] + numba_version.split('.')[1]) except ImportError: numba_version_int = 0 times = (pd.date_range('2003-10-17 12:30:30', periods=1, freq='D') .tz_localize('MST')) unixtimes = times.tz_convert('UTC').astype(np.int64)*1.0/10**9 lat = 39.742476 lon = -105.1786 elev = 1830.14 pressure = 820 temp = 11 delta_t = 67.0 atmos_refract= 0.5667