Absolute (pressure corrected) airmass References ---------- [1] C. Gueymard, "Critical analysis and performance assessment of clear sky solar irradiance models using theoretical and measured data," Solar Energy, vol. 51, pp. 121-138, 1993. ''' airmass_absolute = airmass_relative * pressure / 101325. return airmass_absolute absoluteairmass = deprecated('0.6', alternative='get_absolute_airmass', name='absoluteairmass', removal='0.7')(get_absolute_airmass) def get_relative_airmass(zenith, model='kastenyoung1989'): ''' Gives the relative (not pressure-corrected) airmass. Gives the airmass at sea-level when given a sun zenith angle (in degrees). The ``model`` variable allows selection of different airmass models (described below). If ``model`` is not included or is not valid, the default model is 'kastenyoung1989'. Parameters ---------- zenith : numeric
utc=True).tz_convert(tzinfo).tolist() sunrise = pd.to_datetime(sunrise * 1e9, unit='ns', utc=True).tz_convert(tzinfo).tolist() sunset = pd.to_datetime(sunset * 1e9, unit='ns', utc=True).tz_convert(tzinfo).tolist() return pd.DataFrame(index=times, data={ 'sunrise': sunrise, 'sunset': sunset, 'transit': transit }) get_sun_rise_set_transit = deprecated('0.6.1', alternative='sun_rise_set_transit_spa', name='get_sun_rise_set_transit', removal='0.7')(sun_rise_set_transit_spa) def _ephem_convert_to_seconds_and_microseconds(date): # utility from unreleased PyEphem 3.6.7.1 """Converts a PyEphem date into seconds""" microseconds = int(round(24 * 60 * 60 * 1000000 * date)) seconds, microseconds = divmod(microseconds, 1000000) seconds -= 2209032000 # difference between epoch 1900 and epoch 1970 return seconds, microseconds def _ephem_to_timezone(date, tzinfo): # utility from unreleased PyEphem 3.6.7.1 """"Convert a PyEphem Date into a timezone aware python datetime"""
""" The ``bifacial`` module contains functions to model irradiance for bifacial modules. """ from pvlib._deprecation import deprecated from pvlib.bifacial import pvfactors, infinite_sheds, utils # noqa: F401 pvfactors_timeseries = deprecated( since='0.9.1', name='pvlib.bifacial.pvfactors_timeseries', alternative='pvlib.bifacial.pvfactors.pvfactors_timeseries')( pvfactors.pvfactors_timeseries)
@pytest.mark.xfail(strict=True, reason='ensure that the test is called') @fail_on_pvlib_version('100000.0') def test_fail_on_pvlib_version_fail_in_test(): raise Exception # set up to test using fixtures with function decorated with # conftest.fail_on_pvlib_version @pytest.fixture() def some_data(): return "some data" def alt_func(*args): return args deprec_func = deprecated('350.8', alternative='alt_func', name='deprec_func', removal='350.9')(alt_func) @fail_on_pvlib_version('350.9') def test_use_fixture_with_decorator(some_data): # test that the correct data is returned by the some_data fixture assert some_data == "some data" with pytest.warns(pvlibDeprecationWarning): # test for deprecation warning deprec_func(some_data)
Absolute (pressure corrected) airmass References ---------- [1] C. Gueymard, "Critical analysis and performance assessment of clear sky solar irradiance models using theoretical and measured data," Solar Energy, vol. 51, pp. 121-138, 1993. ''' airmass_absolute = airmass_relative * pressure / 101325. return airmass_absolute absoluteairmass = deprecated('0.6', alternative='get_absolute_airmass', name='absoluteairmass', removal='0.7')( get_absolute_airmass) def get_relative_airmass(zenith, model='kastenyoung1989'): ''' Gives the relative (not pressure-corrected) airmass. Gives the airmass at sea-level when given a sun zenith angle (in degrees). The ``model`` variable allows selection of different airmass models (described below). If ``model`` is not included or is not valid, the default model is 'kastenyoung1989'. Parameters ---------- zenith : numeric
""" Deprecated version of pvlib.iotools.tmy """ from pvlib.iotools import read_tmy2, read_tmy3 from pvlib._deprecation import deprecated readtmy2 = deprecated('0.6.1', alternative='iotools.read_tmy2', name='readtmy2', removal='0.7')(read_tmy2) readtmy3 = deprecated('0.6.1', alternative='iotools.read_tmy2', name='readtmy3', removal='0.7')(read_tmy3)
# arrays are in seconds since epoch format, need to conver to timestamps transit = pd.to_datetime(transit*1e9, unit='ns', utc=True).tz_convert( tzinfo).tolist() sunrise = pd.to_datetime(sunrise*1e9, unit='ns', utc=True).tz_convert( tzinfo).tolist() sunset = pd.to_datetime(sunset*1e9, unit='ns', utc=True).tz_convert( tzinfo).tolist() return pd.DataFrame(index=times, data={'sunrise': sunrise, 'sunset': sunset, 'transit': transit}) get_sun_rise_set_transit = deprecated('0.6.1', alternative='sun_rise_set_transit_spa', name='get_sun_rise_set_transit', removal='0.7')(sun_rise_set_transit_spa) def _ephem_convert_to_seconds_and_microseconds(date): # utility from unreleased PyEphem 3.6.7.1 """Converts a PyEphem date into seconds""" microseconds = int(round(24 * 60 * 60 * 1000000 * date)) seconds, microseconds = divmod(microseconds, 1000000) seconds -= 2209032000 # difference between epoch 1900 and epoch 1970 return seconds, microseconds def _ephem_to_timezone(date, tzinfo): # utility from unreleased PyEphem 3.6.7.1 """"Convert a PyEphem Date into a timezone aware python datetime"""
""" Deprecated version of pvlib.iotools.tmy """ from pvlib.iotools import read_tmy2, read_tmy3 from pvlib._deprecation import deprecated readtmy2 = deprecated('0.6.1', alternative='iotools.read_tmy2', name='readtmy2', removal='0.7')(read_tmy2) readtmy3 = deprecated('0.6.1', alternative='iotools.read_tmy3', name='readtmy3', removal='0.7')(read_tmy3)