<s> import logging <EOL> pvl_logger = logging . getLogger ( '<STR_LIT>' ) <EOL> import datetime <EOL> import numpy as np <EOL> import pandas as pd <EOL> from nose . tools import raises <EOL> from nose . tools import assert_almost_equals <EOL> from pvlib . location import Location <EOL> from pvlib import solarposition <EOL> from pvlib import atmosphere <EOL> times = pd . date_range ( start = datetime . datetime ( <NUM_LIT> , <NUM_LIT:6> , <NUM_LIT> ) , <EOL> end = datetime . datetime ( <NUM_LIT> , <NUM_LIT:6> , <NUM_LIT> ) , freq = '<STR_LIT>' ) <EOL> tus = Location ( <NUM_LIT> , - <NUM_LIT> , '<STR_LIT>' , <NUM_LIT> ) <EOL> times_localized = times . tz_localize ( tus . tz ) <EOL> ephem_data = solarposition . get_solarposition ( times_localized , tus . latitude , <EOL> tus . longitude ) <EOL> def test_pres2alt ( ) : <EOL> atmosphere . pres2alt ( <NUM_LIT> ) <EOL> def test_alt2press ( ) : <EOL> atmosphere . pres2alt ( <NUM_LIT:1000> ) <EOL> def test_airmasses ( ) : <EOL> models = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> for model in models : <EOL> yield run_airmass , model , ephem_data [ '<STR_LIT>' ] <EOL> def run_airmass ( model , zenith ) : <EOL> atmosphere . relativeairmass ( zenith , model ) <EOL> @ raises ( ValueError ) <EOL> def test_airmass_invalid ( ) : <EOL> atmosphere . relativeairmass ( ephem_data [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_absoluteairmass ( ) : <EOL> relative_am = atmosphere . relativeairmass ( ephem_data [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> atmosphere . absoluteairmass ( relative_am ) <EOL> atmosphere . absoluteairmass ( relative_am , pressure = <NUM_LIT> ) <EOL> def test_absoluteairmass_numeric ( ) : <EOL> atmosphere . absoluteairmass ( <NUM_LIT:2> ) <EOL> def test_absoluteairmass_nan ( ) : <EOL> np . testing . assert_equal ( np . nan , atmosphere . absoluteairmass ( np . nan ) ) </s>
