diff --git a/openstef/tasks/create_solar_forecast.py b/openstef/tasks/create_solar_forecast.py index 093a3c92e..9dc162744 100644 --- a/openstef/tasks/create_solar_forecast.py +++ b/openstef/tasks/create_solar_forecast.py @@ -186,7 +186,7 @@ def fides(data: pd.DataFrame, all_forecasts: bool = False): data = pd.DataFrame(index = index, data = dict(load=np.sin(index.hour/24*np.pi)*np.random.uniform(0.7,1.7, 300))) data['insolation'] = data.load * np.random.uniform(0.8, 1.2, len(index)) + 0.1 - data.loc[int(len(index)/3*2):,"load"] = np.NaN + data.loc[int(len(index)/3*2):,"load"] = np.nan """ insolation_forecast = apply_fit_insol(data, add_to_df=False) @@ -357,7 +357,7 @@ def apply_fit_insol(data, add_to_df=True, hours_delta=None, polynomial=False): data = pd.DataFrame(index = index, data = dict(load=np.sin(index.hour/24*np.pi)*np.random.uniform(0.7,1.7, len(index)))) data['insolation'] = data.load * np.random.uniform(0.8, 1.2, len(index)) + 0.1 - data.loc[int(len(index)/3*2):,"load"] = np.NaN + data.loc[int(len(index)/3*2):,"load"] = np.nan """ colname = list(data)[0] diff --git a/requirements.txt b/requirements.txt index 4c93017cc..7f400491a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,6 +7,7 @@ lightgbm~=3.3 matplotlib~=3.7 mlflow~=2.3 networkx~=3.1 +numpy<2.0.0 optuna~=3.1 optuna-integration~=3.6 pandas~=2.2.0 diff --git a/test/unit/tasks/test_calculate_kpi.py b/test/unit/tasks/test_calculate_kpi.py index 5a9dd6f3c..213bb78f3 100644 --- a/test/unit/tasks/test_calculate_kpi.py +++ b/test/unit/tasks/test_calculate_kpi.py @@ -18,11 +18,11 @@ # Prepare dataframe with nans to test low completeness realised_load_nan = realised_load.copy() -realised_load_nan.loc[realised_load_nan.sample(frac=0.5).index, :] = np.NaN +realised_load_nan.loc[realised_load_nan.sample(frac=0.5).index, :] = np.nan # Prepare dataframe with nans to test low completeness predicted_load_nan = predicted_load.copy() -predicted_load_nan.loc[predicted_load_nan.sample(frac=0.5).index, :] = np.NaN +predicted_load_nan.loc[predicted_load_nan.sample(frac=0.5).index, :] = np.nan prediction_job = TestData.get_prediction_job(pid=307) @@ -106,7 +106,7 @@ def test_calc_kpi_for_specific_pid_poor_completeness_realized(self): prediction_job["id"], realised_load_nan, predicted_load, realised_load_nan ) t_ahead_keys = kpis.keys() - self.assertIs(kpis[list(t_ahead_keys)[0]]["rMAE"], np.NaN) + self.assertIs(kpis[list(t_ahead_keys)[0]]["rMAE"], np.nan) # Test whether none is returned in case of poor completeness for predicted data def test_calc_kpi_for_specific_pid_poor_completeness_predicted(self):