Reputation:
I am relatively new to sphinx and wanted to generate documentation for a project of mine. An example of one of my functions is found within predict.py:
def arima_rolling_forecast(training_set, testing_set, order, solver='lbfgs'):
"""
Runs an ARIMA rolling forecast with a given training and testing set.
:param pandas.Series training_set: training set.
:param pandas.Series testing_set: testing set.
:param collections.namedtuple order: ARIMA order (p, d, q).
:param string solver: the solver used for the rolling average. Defaults to lbfgs.
:return: the forecast of predicted values.
:rtype: list
"""
previous_results = list(training_set)
predictions = []
for result in testing_set:
tmp_model = ARIMA(previous_results, order=order)
tmp_model_fit = tmp_model.fit(disp=False, solver=solver)
forecast, _, _ = tmp_model_fit.forecast()
predictions.append(forecast[0])
previous_results.append(result)
return predictions
When I use the make html
command, the documentation is almost correct, however the return type and params are appended to function description as seen below:
How do I change this so that the param
return
and rtype
are put onto separate lines? Or is this how the documentation is meant to look?
Upvotes: 2
Views: 3242
Reputation: 15045
You need to add a blank line between the description and the first :param blah blah:
. See syntax for Info field lists.
I'm unsure whether pandas data types are supported. You'll need to do your own research to make that determination.
Upvotes: 6