Open maxi-fort opened 2 months ago
One user could be interested in using multiple nearest weather forecasts (e.g 4 surrounding input_city weather forecast) for prediction.
Adding a new argument k representing the number of weather locations desired (default = 1) FROM : https://github.com/OpenSTEF/openstef-dbc/blob/2fb4fb58414cbe3f6d13e430ecdb6f946c19ba53/openstef_dbc/services/weather.py#L53-L58 TO :
def _get_nearest_weather_location( self, location: Union[Tuple[float, float], str], country: str = "NL", threshold: float = 150.0, k: int = 1, ) -> str:
Sorting distances instead of taking the min FROM : https://github.com/OpenSTEF/openstef-dbc/blob/2fb4fb58414cbe3f6d13e430ecdb6f946c19ba53/openstef_dbc/services/weather.py#L106 TO : nearest_location = distances["input_city"].sort_index()[0:k]
nearest_location = distances["input_city"].sort_index()[0:k]
Allowing multiple locations return by removing [0] FROM : https://github.com/OpenSTEF/openstef-dbc/blob/2fb4fb58414cbe3f6d13e430ecdb6f946c19ba53/openstef_dbc/services/weather.py#L111 TO : return nearest_location.reset_index(drop=True)
return nearest_location.reset_index(drop=True)
One user could be interested in using multiple nearest weather forecasts (e.g 4 surrounding input_city weather forecast) for prediction.
Adding a new argument k representing the number of weather locations desired (default = 1) FROM : https://github.com/OpenSTEF/openstef-dbc/blob/2fb4fb58414cbe3f6d13e430ecdb6f946c19ba53/openstef_dbc/services/weather.py#L53-L58 TO :
Sorting distances instead of taking the min FROM : https://github.com/OpenSTEF/openstef-dbc/blob/2fb4fb58414cbe3f6d13e430ecdb6f946c19ba53/openstef_dbc/services/weather.py#L106 TO :
nearest_location = distances["input_city"].sort_index()[0:k]
Allowing multiple locations return by removing [0] FROM : https://github.com/OpenSTEF/openstef-dbc/blob/2fb4fb58414cbe3f6d13e430ecdb6f946c19ba53/openstef_dbc/services/weather.py#L111 TO :
return nearest_location.reset_index(drop=True)