Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Comments placed in the wrong location. #24

Open
raphant opened this issue Feb 19, 2022 · 2 comments
Open

Comments placed in the wrong location. #24

raphant opened this issue Feb 19, 2022 · 2 comments

Comments

@raphant
Copy link

raphant commented Feb 19, 2022

Environment

AI Doc Writer Version: 1.0.10
PyCharm Version: 2021.3.2
OS: Manjaro 5.16.7

Issue

When generating docs for a property function formatted like the code below, the docstring is added to the wrong location.

Before generation

    @property
    def indicators(
        self,
    ) -> dict[str, Union[ind.Indicator, ind.OverlayIndicator, ind.IndexIndicator]]:
        return self._active_indicators

After generation

    @property
    def indicators(
	    """
	    Returns a dictionary of all the active indicators
	    :return: A dictionary of indicator objects.
	    """
        self,
    ) -> dict[str, Union[ind.Indicator, ind.OverlayIndicator, ind.IndexIndicator]]:
        return self._active_indicators

Expected

    @property
    def indicators(
        self,
    ) -> dict[str, Union[ind.Indicator, ind.OverlayIndicator, ind.IndexIndicator]]:
        """
        Returns a dictionary of all the active indicators
        :return: A dictionary of indicator objects.
        """
        return self._active_indicators
@raphant
Copy link
Author

raphant commented Feb 19, 2022

This also happens in regular functions with similar formatting.

Before

def download_missing_historical_data(
    strategy: str,
    config: Config,
    parameters: Union[BacktestParameters, HyperoptParameters],
):
    timerange: str = parameters.timerange
    start_date, end_date = timerange.split('-')
    start_date = dateutil.parser.parse(start_date).replace(tzinfo=utc)
	...

After

def download_missing_historical_data(
    """
    It checks if the data is already downloaded for the given
    pairs and intervals. If not, it downloads the data
    
    :param strategy: The name of the strategy to use
    :type strategy: str
    :param config: Config
    :type config: Config
    :param parameters: Union[BacktestParameters, HyperoptParameters]
    :type parameters: Union[BacktestParameters, HyperoptParameters]
    """
    strategy: str,
    config: Config,
    parameters: Union[BacktestParameters, HyperoptParameters],
):
	timerange: str = parameters.timerange
    start_date, end_date = timerange.split('-')
    start_date = dateutil.parser.parse(start_date).replace(tzinfo=utc)
	...

@SteinRobert
Copy link

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants