Reputation: 329
I've tried to find the solution on how to break the line in a python function description, but there were none that worked for me. I have such a function:
But the description that shows when I am hovering that function shows continous chain of characters and there are no breaks, like below:
How do I do breaklines in the function desc?
EDIT: Due to the request I am posting the code(when pasting the code indentation has broken):
from pandas import PandasDataFrame
def calculate_input_types(price_df: PandasDataFrame, calculate_all: bool = True, *, input_type: dict) -> PandasDataFrame:
"""
:param price_df: price_df: Dataframe containing Open, Close, High, Low, Volume price data.
:param calculate_all: Boolean value True or False, if True function calculates all possible input types.
HL2, HLC3, OHLC4, HLCC4, if False function calculates only chosen input types, must pass a dictionary.
:param input_type: Optional argument, mandatory if calculate_all is set to False. A dictionary should posses input
types as keys and one-hot encoded value of 1 if the input type is to be calculated
or 0 if the input type shouldn't be calculated.
Example of input_type:
input_type = {
HL2 : 1,
HLC3 : 1,
OHLC4 : 0,
HLCC4 : 1
}
This type of input calculates only HL2, HLC3 and HLCC4 since those are set to 1 and OHLC4 is set to 0.
:return: Dataframe with calculated input types.
"""
return 'apple'
Upvotes: 1
Views: 149
Reputation: 1107
I managed to somewhat fix the problem:
from pandas import PandasDataFrame
def calculate_input_types(price_df: PandasDataFrame, calculate_all: bool = True, *, input_type: dict) -> PandasDataFrame:
"""
Example of input_type:\n
input_type = {
HL2 : 1,\n
HLC3 : 1,\n
OHLC4 : 0,\n
HLCC4 : 1\n
}\n
:param price_df: price_df: Dataframe containing Open, Close, High, Low, Volume price data.
:param calculate_all: Boolean value True or False, if True function calculates all possible input types.
HL2, HLC3, OHLC4, HLCC4, if False function calculates only chosen input types, must pass a dictionary.
:param input_type: Optional argument, mandatory if calculate_all is set to False. A dictionary should posses input
types as keys and one-hot encoded value of 1 if the input type is to be calculated
or 0 if the input type shouldn't be calculated.
:return: Dataframe with calculated input types.
This type of input calculates only HL2, HLC3 and HLCC4 since those are set to 1 and OHLC4 is set to 0.
"""
return 'apple'
Upvotes: 1