From d294ef10d75cbd5d39cc6c883cf314a010d48b7d Mon Sep 17 00:00:00 2001 From: aayush-jain18 Date: Fri, 25 Jun 2021 22:43:31 +0530 Subject: [PATCH] unexpected docstring params --- freqtrade/commands/optimize_commands.py | 1 + freqtrade/configuration/config_setup.py | 1 + freqtrade/data/history/hdf5datahandler.py | 4 ++-- freqtrade/data/history/history_utils.py | 1 + freqtrade/data/history/idatahandler.py | 8 ++++---- freqtrade/data/history/jsondatahandler.py | 4 ++-- freqtrade/exchange/exchange.py | 10 ++++++---- freqtrade/freqtradebot.py | 3 ++- freqtrade/misc.py | 1 + freqtrade/optimize/optimize_reports.py | 3 +-- freqtrade/plugins/pairlist/VolatilityFilter.py | 4 ++-- freqtrade/resolvers/exchange_resolver.py | 1 + freqtrade/resolvers/iresolver.py | 2 +- freqtrade/strategy/interface.py | 8 +++++--- 14 files changed, 30 insertions(+), 21 deletions(-) diff --git a/freqtrade/commands/optimize_commands.py b/freqtrade/commands/optimize_commands.py index a84b3b3bd..08174bde6 100644 --- a/freqtrade/commands/optimize_commands.py +++ b/freqtrade/commands/optimize_commands.py @@ -15,6 +15,7 @@ def setup_optimize_configuration(args: Dict[str, Any], method: RunMode) -> Dict[ """ Prepare the configuration for the Hyperopt module :param args: Cli args from Arguments() + :param method: Bot running mode :return: Configuration """ config = setup_utils_configuration(args, method) diff --git a/freqtrade/configuration/config_setup.py b/freqtrade/configuration/config_setup.py index cd8464ead..22836ab19 100644 --- a/freqtrade/configuration/config_setup.py +++ b/freqtrade/configuration/config_setup.py @@ -15,6 +15,7 @@ def setup_utils_configuration(args: Dict[str, Any], method: RunMode) -> Dict[str """ Prepare the configuration for utils subcommands :param args: Cli args from Arguments() + :param method: Bot running mode :return: Configuration """ configuration = Configuration(args, method) diff --git a/freqtrade/data/history/hdf5datahandler.py b/freqtrade/data/history/hdf5datahandler.py index e80cfeba2..dd60530aa 100644 --- a/freqtrade/data/history/hdf5datahandler.py +++ b/freqtrade/data/history/hdf5datahandler.py @@ -52,8 +52,8 @@ class HDF5DataHandler(IDataHandler): """ Store data in hdf5 file. :param pair: Pair - used to generate filename - :timeframe: Timeframe - used to generate filename - :data: Dataframe containing OHLCV data + :param timeframe: Timeframe - used to generate filename + :param data: Dataframe containing OHLCV data :return: None """ key = self._pair_ohlcv_key(pair, timeframe) diff --git a/freqtrade/data/history/history_utils.py b/freqtrade/data/history/history_utils.py index 86e9f75e6..eecb63d07 100644 --- a/freqtrade/data/history/history_utils.py +++ b/freqtrade/data/history/history_utils.py @@ -113,6 +113,7 @@ def refresh_data(datadir: Path, :param timeframe: Timeframe (e.g. "5m") :param pairs: List of pairs to load :param exchange: Exchange object + :param data_format: dataformat to use :param timerange: Limit data to be loaded to this timerange """ data_handler = get_datahandler(datadir, data_format) diff --git a/freqtrade/data/history/idatahandler.py b/freqtrade/data/history/idatahandler.py index 070d9039d..05052b2d7 100644 --- a/freqtrade/data/history/idatahandler.py +++ b/freqtrade/data/history/idatahandler.py @@ -49,8 +49,8 @@ class IDataHandler(ABC): """ Store ohlcv data. :param pair: Pair - used to generate filename - :timeframe: Timeframe - used to generate filename - :data: Dataframe containing OHLCV data + :param timeframe: Timeframe - used to generate filename + :param data: Dataframe containing OHLCV data :return: None """ @@ -245,8 +245,8 @@ def get_datahandler(datadir: Path, data_format: str = None, data_handler: IDataHandler = None) -> IDataHandler: """ :param datadir: Folder to save data - :data_format: dataformat to use - :data_handler: returns this datahandler if it exists or initializes a new one + :param data_format: dataformat to use + :param data_handler: returns this datahandler if it exists or initializes a new one """ if not data_handler: diff --git a/freqtrade/data/history/jsondatahandler.py b/freqtrade/data/history/jsondatahandler.py index 301d228a8..990e75bd9 100644 --- a/freqtrade/data/history/jsondatahandler.py +++ b/freqtrade/data/history/jsondatahandler.py @@ -55,8 +55,8 @@ class JsonDataHandler(IDataHandler): format looks as follows: [[,,,,]] :param pair: Pair - used to generate filename - :timeframe: Timeframe - used to generate filename - :data: Dataframe containing OHLCV data + :param timeframe: Timeframe - used to generate filename + :param data: Dataframe containing OHLCV data :return: None """ filename = self._pair_data_filename(self._datadir, pair, timeframe) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 2db89d707..99430ea25 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -475,11 +475,11 @@ class Exchange: return endpoint in self._api.has and self._api.has[endpoint] def amount_to_precision(self, pair: str, amount: float) -> float: - ''' + """ Returns the amount to buy or sell to a precision the Exchange accepts Re-implementation of ccxt internal methods - ensuring we can test the result is correct based on our definitions. - ''' + """ if self.markets[pair]['precision']['amount']: amount = float(decimal_to_precision(amount, rounding_mode=TRUNCATE, precision=self.markets[pair]['precision']['amount'], @@ -489,14 +489,14 @@ class Exchange: return amount def price_to_precision(self, pair: str, price: float) -> float: - ''' + """ Returns the price rounded up to the precision the Exchange accepts. Partial Re-implementation of ccxt internal method decimal_to_precision(), which does not support rounding up TODO: If ccxt supports ROUND_UP for decimal_to_precision(), we could remove this and align with amount_to_precision(). Rounds up - ''' + """ if self.markets[pair]['precision']['price']: # price = float(decimal_to_precision(price, rounding_mode=ROUND, # precision=self.markets[pair]['precision']['price'], @@ -796,6 +796,8 @@ class Exchange: """ Simple wrapper calling either fetch_order or fetch_stoploss_order depending on the stoploss_order parameter + :param order_id: OrderId to fetch order + :param pair: Pair corresponding to order_id :param stoploss_order: If true, uses fetch_stoploss_order, otherwise fetch_order. """ if stoploss_order: diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index ec07d4d63..e533e15e0 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -472,6 +472,7 @@ class FreqtradeBot(LoggingMixin): """ Executes a limit buy for the given pair :param pair: pair for which we want to create a LIMIT_BUY + :param stake_amount: amount of stake-currency for the pair :return: True if a buy order is created, false if it fails. """ time_in_force = self.strategy.order_time_in_force['buy'] @@ -834,7 +835,7 @@ class FreqtradeBot(LoggingMixin): """ Check to see if stoploss on exchange should be updated in case of trailing stoploss on exchange - :param Trade: Corresponding Trade + :param trade: Corresponding Trade :param order: Current on exchange stoploss order :return: None """ diff --git a/freqtrade/misc.py b/freqtrade/misc.py index 2e255901e..967f08299 100644 --- a/freqtrade/misc.py +++ b/freqtrade/misc.py @@ -56,6 +56,7 @@ def file_dump_json(filename: Path, data: Any, is_zip: bool = False, log: bool = """ Dump JSON data into a file :param filename: file to create + :param is_zip: if file should be zip :param data: JSON Data to save :return: """ diff --git a/freqtrade/optimize/optimize_reports.py b/freqtrade/optimize/optimize_reports.py index 20f099697..24dbb4961 100644 --- a/freqtrade/optimize/optimize_reports.py +++ b/freqtrade/optimize/optimize_reports.py @@ -507,9 +507,8 @@ def text_table_sell_reason(sell_reason_stats: List[Dict[str, Any]], stake_curren def text_table_strategy(strategy_results, stake_currency: str) -> str: """ Generate summary table per strategy + :param strategy_results: Dict of containing results for all strategies :param stake_currency: stake-currency - used to correctly name headers - :param max_open_trades: Maximum allowed open trades used for backtest - :param all_results: Dict of containing results for all strategies :return: pretty printed table with tabulate as string """ floatfmt = _get_line_floatfmt(stake_currency) diff --git a/freqtrade/plugins/pairlist/VolatilityFilter.py b/freqtrade/plugins/pairlist/VolatilityFilter.py index bc617a1db..5ae8e3e9f 100644 --- a/freqtrade/plugins/pairlist/VolatilityFilter.py +++ b/freqtrade/plugins/pairlist/VolatilityFilter.py @@ -20,9 +20,9 @@ logger = logging.getLogger(__name__) class VolatilityFilter(IPairList): - ''' + """ Filters pairs by volatility - ''' + """ def __init__(self, exchange, pairlistmanager, config: Dict[str, Any], pairlistconfig: Dict[str, Any], diff --git a/freqtrade/resolvers/exchange_resolver.py b/freqtrade/resolvers/exchange_resolver.py index ed6715d15..4dfbf445b 100644 --- a/freqtrade/resolvers/exchange_resolver.py +++ b/freqtrade/resolvers/exchange_resolver.py @@ -21,6 +21,7 @@ class ExchangeResolver(IResolver): def load_exchange(exchange_name: str, config: dict, validate: bool = True) -> Exchange: """ Load the custom class from config parameter + :param exchange_name: name of the Exchange to load :param config: configuration dictionary """ # Map exchange name to avoid duplicate classes for identical exchanges diff --git a/freqtrade/resolvers/iresolver.py b/freqtrade/resolvers/iresolver.py index eaba7d201..2cccec70a 100644 --- a/freqtrade/resolvers/iresolver.py +++ b/freqtrade/resolvers/iresolver.py @@ -135,7 +135,7 @@ class IResolver: extra_dir: Optional[str] = None) -> Any: """ Search and loads the specified object as configured in hte child class. - :param objectname: name of the module to import + :param object_name: name of the module to import :param config: configuration dictionary :param extra_dir: additional directory to search for the given pairlist :raises: OperationalException if the class is invalid or does not exist. diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index c29111de9..ea7d5079d 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -349,7 +349,7 @@ class IStrategy(ABC, HyperStrategyMixin): The 2nd, optional parameter ensures that locks are applied until the new candle arrives, and not stop at 14:00:00 - while the next candle arrives at 14:00:02 leaving a gap of 2 seconds for a buy to happen on an old signal. - :param: pair: "Pair to check" + :param pair: "Pair to check" :param candle_date: Date of the last candle. Optional, defaults to current date :returns: locking state of the pair in question. """ @@ -733,7 +733,8 @@ class IStrategy(ABC, HyperStrategyMixin): Based on TA indicators, populates the buy signal for the given dataframe This method should not be overridden. :param dataframe: DataFrame - :param pair: Additional information, like the currently traded pair + :param metadata: Additional information dictionary, with details like the + currently traded pair :return: DataFrame with buy column """ logger.debug(f"Populating buy signals for pair {metadata.get('pair')}.") @@ -750,7 +751,8 @@ class IStrategy(ABC, HyperStrategyMixin): Based on TA indicators, populates the sell signal for the given dataframe This method should not be overridden. :param dataframe: DataFrame - :param pair: Additional information, like the currently traded pair + :param metadata: Additional information dictionary, with details like the + currently traded pair :return: DataFrame with sell column """ logger.debug(f"Populating sell signals for pair {metadata.get('pair')}.")