From 31e59ce30fb70090cfb1427a208482f75217bcce Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 12 Sep 2025 17:28:11 +0200 Subject: [PATCH] docs(reforcexy): refine docstring MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- ReforceXY/user_data/freqaimodels/ReforceXY.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ReforceXY/user_data/freqaimodels/ReforceXY.py b/ReforceXY/user_data/freqaimodels/ReforceXY.py index 3b1729a..410d1e8 100644 --- a/ReforceXY/user_data/freqaimodels/ReforceXY.py +++ b/ReforceXY/user_data/freqaimodels/ReforceXY.py @@ -386,8 +386,7 @@ class ReforceXY(BaseReinforcementLearningModel): ) -> Any: """ User customizable fit method - :param data_dictionary: dict = common data dictionary containing all train/test - features/labels/weights. + :param data_dictionary: dict = common data dictionary containing all train/test features/labels/weights. :param dk: FreqaiDatakitchen = data kitchen for current pair. :return: model Any = trained model to be used for inference in dry/live/backtesting @@ -481,11 +480,9 @@ class ReforceXY(BaseReinforcementLearningModel): into the model. :param pair: str = COIN/STAKE to get the environment information for :return: - :market_side: float = representing short, long, or neutral for - pair + :market_side: float = representing short, long, or neutral for pair :current_profit: float = unrealized profit of the current trade - :trade_duration: int = the number of candles that the trade has - been open for + :trade_duration: int = the number of candles that the trade has been open for """ # STATE_INFO position, pnl, trade_duration = super().get_state_info(pair) @@ -590,8 +587,7 @@ class ReforceXY(BaseReinforcementLearningModel): self, train_df: DataFrame, total_timesteps: int, dk: FreqaiDataKitchen ) -> Optional[Dict[str, Any]]: """ - Runs hyperparameter optimization using Optuna and - returns the best hyperparameters found merged with the user defined parameters + Runs hyperparameter optimization using Optuna and returns the best hyperparameters found merged with the user defined parameters """ identifier = self.freqai_info.get("identifier", "no_id_provided") study_name = ( @@ -924,7 +920,7 @@ class ReforceXY(BaseReinforcementLearningModel): :param action: int = The action made by the agent for the current candle. :return: float = the reward to give to the agent for current step (used for optimization - of weights in NN) + of weights in NN) """ # first, penalize if the action is not valid if not self._force_action and not self._is_valid(action): @@ -1635,7 +1631,8 @@ def make_env( :param train_df: (DataFrame) feature dataframe for the environment :param price: (DataFrame) aligned price dataframe :param env_info: (dict) all required arguments to instantiate the environment - :return: (Callable[[], BaseEnvironment]) closure that when called instantiates and returns the environment + :return: + (Callable[[], BaseEnvironment]) closure that when called instantiates and returns the environment """ def _init() -> BaseEnvironment: -- 2.43.0