Skip to content

Commit

Permalink
Applied pydocstyle
Browse files Browse the repository at this point in the history
Signed-off-by: Clara De Smet <clara.de.smet@alliander.com>
  • Loading branch information
clara-de-smet committed Nov 22, 2024
1 parent fce0b32 commit 9a0af0d
Showing 1 changed file with 32 additions and 33 deletions.
65 changes: 32 additions & 33 deletions openstef/feature_engineering/apply_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,41 +37,40 @@ def apply_features(
) -> pd.DataFrame:
"""Applies the feature functions defined in ``feature_functions.py`` and returns the complete dataframe.
Features requiring more recent label-data are omitted.
.. note::
For the time deriven features only the onces in the features list will be added. But for the weather features all will be added at present.
These unrequested additional features have to be filtered out later.
Args:
data (pandas.DataFrame): a pandas dataframe with input data in the form:
pd.DataFrame(
index=datetime,
columns=[label, predictor_1,..., predictor_n]
)
pj (PredictionJobDataClass): Prediction job.
feature_names (list[str]): list of reuqested features
horizon (float): Forecast horizon limit in hours.
Returns:
pd.DataFrame(index = datetime, columns = [label, predictor_1,..., predictor_n, feature_1, ..., feature_m])
Example output:
.. code-block:: py
import pandas as pd
import numpy as np
from geopy.geocoders import Nominatim
index = pd.date_range(start = "2017-01-01 09:00:00",
freq = '15T', periods = 200)
data = pd.DataFrame(index = index,
data = dict(load=
np.sin(index.hour/24*np.pi)*
np.random.uniform(0.7,1.7, 200)))
Features requiring more recent label-data are omitted.
.. note::
For the time deriven features only the onces in the features list will be added. But for the weather features all will be added at present.
These unrequested additional features have to be filtered out later.
Args:
data (pandas.DataFrame): a pandas dataframe with input data in the form:
pd.DataFrame(
index=datetime,
columns=[label, predictor_1,..., predictor_n]
)
pj (PredictionJobDataClass): Prediction job.
feature_names (list[str]): list of reuqested features
horizon (float): Forecast horizon limit in hours.
Returns:
pd.DataFrame(index = datetime, columns = [label, predictor_1,..., predictor_n, feature_1, ..., feature_m])
Example output:
.. code-block:: py
import pandas as pd
import numpy as np
from geopy.geocoders import Nominatim
index = pd.date_range(start = "2017-01-01 09:00:00",
freq = '15T', periods = 200)
data = pd.DataFrame(index = index,
data = dict(load=
np.sin(index.hour/24*np.pi)*
np.random.uniform(0.7,1.7, 200)))
"""

if pj is None:
pj = {"electricity_bidding_zone": BiddingZone.NL}

Expand Down

0 comments on commit 9a0af0d

Please sign in to comment.