@classmethod<EOL><INDENT>def from_file(cls, weafile, timestep=<NUM_LIT:1>, is_leap_year=False):<DEDENT>
assert os.path.isfile(weafile), '<STR_LIT>'.format(weafile)<EOL>location = Location()<EOL>with open(weafile, readmode) as weaf:<EOL><INDENT>first_line = weaf.readline()<EOL>assert first_line.startswith('<STR_LIT>'),'<STR_LIT>''<STR_LIT>'.format(weafile)<EOL>location.city = '<STR_LIT:U+0020>'.join(first_line.split()[<NUM_LIT:1>:])<EOL>location.latitude = float(weaf.readline().split()[-<NUM_LIT:1>])<EOL>location.longitude = -float(weaf.readline().split()[-<NUM_LIT:1>])<EOL>location.time_zone = -int(weaf.readline().split()[-<NUM_LIT:1>]) / <NUM_LIT:15><EOL>location.elevation = float(weaf.readline().split()[-<NUM_LIT:1>])<EOL>weaf.readline()  <EOL>direct_normal_irradiance = []<EOL>diffuse_horizontal_irradiance = []<EOL>for line in weaf:<EOL><INDENT>dirn, difh = [int(v) for v in line.split()[-<NUM_LIT:2>:]]<EOL>direct_normal_irradiance.append(dirn)<EOL>diffuse_horizontal_irradiance.append(difh)<EOL><DEDENT><DEDENT>return cls.from_values(location, direct_normal_irradiance,<EOL>diffuse_horizontal_irradiance, timestep, is_leap_year)<EOL>
Create wea object from a wea file.

        Args:
            weafile:Full path to wea file.
            timestep: An optional integer to set the number of time steps per hour.
                Default is 1 for one value per hour. If the wea file has a time step
                smaller than an hour adjust this input accordingly.
            is_leap_year: A boolean to indicate if values are representing a leap year.
                Default is False.