code: def from_file(cls, weafile, timestep=1, is_leap_year=False):
          
          assert os.path.isfile(weafile), 'Failed to find {}'.format(weafile)
          location = Location()
          with open(weafile, readmode) as weaf:
              first_line = weaf.readline()
              assert first_line.startswith('place'), \
                  'Failed to find place in header. ' \
                  '{} is not a valid wea file.'.format(weafile)
              location.city = ' '.join(first_line.split()[1:])
              # parse header
              location.latitude = float(weaf.readline().split()[-1])
              location.longitude = -float(weaf.readline().split()[-1])
              location.time_zone = -int(weaf.readline().split()[-1]) / 15
              location.elevation = float(weaf.readline().split()[-1])
              weaf.readline()  # pass line for weather data units
  
              # parse irradiance values
              direct_normal_irradiance = []
              diffuse_horizontal_irradiance = []
              for line in weaf:
                  dirn, difh = [int(v) for v in line.split()[-2:]]
                  direct_normal_irradiance.append(dirn)
                  diffuse_horizontal_irradiance.append(difh)
  
          return cls.from_values(location, direct_normal_irradiance,
                                 diffuse_horizontal_irradiance, timestep, is_leap_year)
docs: 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.