Spaces:
Runtime error
Runtime error
Hugo Massonnat
commited on
Commit
·
bf051a0
1
Parent(s):
d07468a
add default value for shading
Browse files- forecast.py +3 -2
forecast.py
CHANGED
@@ -71,7 +71,7 @@ def get_forecast_datasets(climate_sub_files: list) -> dict:
|
|
71 |
|
72 |
|
73 |
# Function to extract climate data from forecast datasets and convert to a DataFrame
|
74 |
-
def get_forecast_data(latitude: float, longitude: float, scenario: str, shading_coef: float) -> pd.DataFrame:
|
75 |
"""
|
76 |
Extract climate data from the forecast datasets for a given location and convert to a DataFrame.
|
77 |
|
@@ -79,6 +79,7 @@ def get_forecast_data(latitude: float, longitude: float, scenario: str, shading_
|
|
79 |
latitude(float): Latitude of the location to extract data for.
|
80 |
longitude (float): Longitude of the location to extract data for.
|
81 |
scenario (str): The scenario to extract data for.
|
|
|
82 |
|
83 |
Returns:
|
84 |
pd.DataFrame: A DataFrame containing time series data for each variable.
|
@@ -114,7 +115,7 @@ def get_forecast_data(latitude: float, longitude: float, scenario: str, shading_
|
|
114 |
return forecast_data
|
115 |
|
116 |
|
117 |
-
def preprocess_forectast_data(df: pd.DataFrame, latitude, longitude, shading_coef
|
118 |
assert 0 <= shading_coef <= 1
|
119 |
|
120 |
preprocessed_data = df.copy()
|
|
|
71 |
|
72 |
|
73 |
# Function to extract climate data from forecast datasets and convert to a DataFrame
|
74 |
+
def get_forecast_data(latitude: float, longitude: float, scenario: str, shading_coef: float = 0) -> pd.DataFrame:
|
75 |
"""
|
76 |
Extract climate data from the forecast datasets for a given location and convert to a DataFrame.
|
77 |
|
|
|
79 |
latitude(float): Latitude of the location to extract data for.
|
80 |
longitude (float): Longitude of the location to extract data for.
|
81 |
scenario (str): The scenario to extract data for.
|
82 |
+
shading_coef (float, optional): Shading coefficient to use. Defaults to 0 (for no shading)..
|
83 |
|
84 |
Returns:
|
85 |
pd.DataFrame: A DataFrame containing time series data for each variable.
|
|
|
115 |
return forecast_data
|
116 |
|
117 |
|
118 |
+
def preprocess_forectast_data(df: pd.DataFrame, latitude, longitude, shading_coef) -> pd.DataFrame:
|
119 |
assert 0 <= shading_coef <= 1
|
120 |
|
121 |
preprocessed_data = df.copy()
|