weather.locations.weights

weather.locations.weights(locations)

Extract the raw (un-normalised) weights in order.

Parameters

Name Type Description Default
locations Sequence[WeatherLocation] The locations to read. required

Returns

Name Type Description
List[float] List[float]: One weight per location, in the same order. Consumers
List[float] normalise these (e.g.
List[float] func:spotforecast2_safe.weather.derived.population_weighted_average).

Examples

from spotforecast2_safe.weather.locations import (
    default_german_locations,
    weights,
)

w = weights(default_german_locations())
print(len(w), w[0])
13 3677.0