Skip to content

Commit ff53cf2

Browse files
committed
DOC: Restructure the documentation
Restuture the docs to have a simpler structure
1 parent 3e932e1 commit ff53cf2

File tree

88 files changed

+1606
-1668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1606
-1668
lines changed

CONTRIBUTING.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ offers much more detailed information about the process.
6969
License
7070
~~~~~~~
7171

72-
Statsmodels is released under the
72+
statsmodels is released under the
7373
`Modified (3-clause) BSD license <https://www.opensource.org/licenses/BSD-3-Clause>`_.

LICENSE.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All rights reserved.
44
Copyright (c) 2006-2008 Scipy Developers.
55
All rights reserved.
66

7-
Copyright (c) 2009-2018 Statsmodels Developers.
7+
Copyright (c) 2009-2018 statsmodels Developers.
88
All rights reserved.
99

1010

@@ -16,7 +16,7 @@ modification, are permitted provided that the following conditions are met:
1616
b. Redistributions in binary form must reproduce the above copyright
1717
notice, this list of conditions and the following disclaimer in the
1818
documentation and/or other materials provided with the distribution.
19-
c. Neither the name of Statsmodels nor the names of its contributors
19+
c. Neither the name of statsmodels nor the names of its contributors
2020
may be used to endorse or promote products derived from this software
2121
without specific prior written permission.
2222

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
|Travis Build Status| |Azure CI Build Status| |Appveyor Build Status| |Coveralls Coverage|
22

3-
About Statsmodels
3+
About statsmodels
44
=================
55

6-
Statsmodels is a Python package that provides a complement to scipy for
6+
statsmodels is a Python package that provides a complement to scipy for
77
statistical computations including descriptive statistics and estimation
88
and inference for statistical models.
99

docs/Makefile

-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ html:
4343
@echo "Make static directory for images"
4444
mkdir -p $(BUILDDIR)/html/_static
4545
# generate the examples rst files
46-
@echo "Generating reST from examples folder"
47-
#$(TOOLSPATH)$(EXAMPLEBUILD)
4846
@echo "Generating datasets from installed statsmodels.datasets"
4947
$(TOOLSPATH)$(DATASETBUILD)
5048
@echo "Executing notebooks from examples/notebooks folder"
Loading
Loading
8.84 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<browserconfig>
3+
<msapplication>
4+
<tile>
5+
<square150x150logo src="/_static/icons/mstile-150x150.png"/>
6+
<TileColor>#2b5797</TileColor>
7+
</tile>
8+
</msapplication>
9+
</browserconfig>
1.35 KB
Loading
2.12 KB
Loading

docs/source/_static/icons/favicon.ico

14.7 KB
Binary file not shown.
4.59 KB
Loading
Loading
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "statsmodels",
3+
"short_name": "statsmodels",
4+
"icons": [
5+
{
6+
"src": "/_static/icons/android-chrome-192x192.png",
7+
"sizes": "192x192",
8+
"type": "image/png"
9+
},
10+
{
11+
"src": "/_static/icons/android-chrome-512x512.png",
12+
"sizes": "512x512",
13+
"type": "image/png"
14+
}
15+
],
16+
"theme_color": "#ffffff",
17+
"background_color": "#ffffff",
18+
"start_url": "https://statsmodels.org",
19+
"display": "standalone"
20+
}

docs/source/_templates/layout.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{# Import the theme's layout. #}
2+
{% extends "!layout.html" %}
3+
4+
{%- block htmltitle %}
5+
{{ super() }}
6+
<link rel="icon" type="image/png" sizes="32x32" href="/_static/icons/favicon-32x32.png">
7+
<link rel="icon" type="image/png" sizes="16x16" href="/_static/icons/favicon-16x16.png">
8+
<link rel="manifest" href="/_static/icons/site.webmanifest">
9+
<link rel="mask-icon" href="/_static/icons/safari-pinned-tab.svg" color="#919191">
10+
<meta name="msapplication-TileColor" content="#2b5797">
11+
<meta name="msapplication-config" content="/_static/icons/browserconfig.xml">
12+
{%- endblock %}

docs/source/_templates/page.html

-49
This file was deleted.

docs/source/about.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
.. currentmodule:: statsmodels
66

77
*****************
8-
About Statsmodels
8+
About statsmodels
99
*****************
1010

1111
Background

docs/source/api.rst

+147-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
API
2-
---
3-
The main ~statsmodels API is split into models:
1+
API Reference
2+
=============
3+
The main statsmodels API is split into models:
44

5-
* ``~statsmodels.api``: Cross-sectional models and methods. Canonically imported
6-
using ``import ~statsmodels.api as sm``.
7-
* ``~statsmodels.tsa.api``: Time-series models and methods. Canonically imported
8-
using ``import ~statsmodels.tsa.api as tsa``.
5+
* ``statsmodels.api``: Cross-sectional models and methods. Canonically imported
6+
using ``import statsmodels.api as sm``.
7+
* ``statsmodels.tsa.api``: Time-series models and methods. Canonically imported
8+
using ``import statsmodels.tsa.api as tsa``.
99

1010
The API focuses on models and the most frequently used statistical test, and tools. See the
1111
detailed topic pages for a more complete list of available models, statistics, and tools.
1212

1313
``statsmodels.api``
14-
===================
14+
-------------------
1515

1616
Regression
1717
~~~~~~~~~~
@@ -107,7 +107,7 @@ Tools
107107

108108

109109
``statsmodels.tsa.api``
110-
=======================
110+
-----------------------
111111

112112
Statistics and Tests
113113
~~~~~~~~~~~~~~~~~~~~
@@ -175,9 +175,9 @@ Tools
175175
~statsmodels.tsa.tsatools.lagmat2ds
176176
~statsmodels.tsa.seasonal.seasonal_decompose
177177
~statsmodels.tsa.seasonal.STL
178-
~statsmodels.tsa.filters.bk_filter
179-
~statsmodels.tsa.filters.cf_filter
180-
~statsmodels.tsa.filters.hp_filter
178+
~statsmodels.tsa.filters.bk_filter.bkfilter
179+
~statsmodels.tsa.filters.cf_filter.cffilter
180+
~statsmodels.tsa.filters.hp_filter.hpfilter
181181

182182
Markov Switching
183183
~~~~~~~~~~~~~~~~
@@ -194,3 +194,138 @@ X12/X13 Interface
194194

195195
~statsmodels.tsa.x13.x13_arima_analysis
196196
~statsmodels.tsa.x13.x13_arima_select_order
197+
198+
.. _importpaths:
199+
200+
Import Paths and Structure
201+
--------------------------
202+
203+
We offer two ways of importing functions and classes from statsmodels:
204+
205+
1. `API import for interactive use`_
206+
207+
+ Allows tab completion
208+
209+
2. `Direct import for programs`_
210+
211+
+ Avoids importing unnecessary modules and commands
212+
213+
API Import for interactive use
214+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
215+
216+
For interactive use the recommended import is:
217+
218+
.. code-block:: python
219+
220+
import statsmodels.api as sm
221+
222+
Importing `statsmodels.api` will load most of the public parts of statsmodels.
223+
This makes most functions and classes conveniently available within one or two
224+
levels, without making the "sm" namespace too crowded.
225+
226+
To see what functions and classes available, you can type the following (or use
227+
the namespace exploration features of IPython, Spyder, IDLE, etc.):
228+
229+
.. code-block:: python
230+
231+
>>> dir(sm)
232+
['GLM', 'GLS', 'GLSAR', 'Logit', 'MNLogit', 'OLS', 'Poisson', 'Probit', 'RLM',
233+
'WLS', '__builtins__', '__doc__', '__file__', '__name__', '__package__',
234+
'add_constant', 'categorical', 'datasets', 'distributions', 'families',
235+
'graphics', 'iolib', 'nonparametric', 'qqplot', 'regression', 'robust',
236+
'stats', 'test', 'tools', 'tsa', 'version']
237+
238+
>>> dir(sm.graphics)
239+
['__builtins__', '__doc__', '__file__', '__name__', '__package__',
240+
'abline_plot', 'beanplot', 'fboxplot', 'interaction_plot', 'qqplot',
241+
'rainbow', 'rainbowplot', 'violinplot']
242+
243+
>>> dir(sm.tsa)
244+
['AR', 'ARMA', 'SVAR', 'VAR', '__builtins__', '__doc__',
245+
'__file__', '__name__', '__package__', 'acf', 'acovf', 'add_lag',
246+
'add_trend', 'adfuller', 'ccf', 'ccovf', 'datetools', 'detrend',
247+
'filters', 'grangercausalitytests', 'interp', 'lagmat', 'lagmat2ds',
248+
'pacf', 'pacf_ols', 'pacf_yw', 'periodogram', 'q_stat', 'stattools',
249+
'tsatools', 'var']
250+
251+
Notes
252+
^^^^^
253+
254+
The `api` modules may not include all the public functionality of statsmodels. If
255+
you find something that should be added to the api, please file an issue on
256+
github or report it to the mailing list.
257+
258+
The subpackages of statsmodels include `api.py` modules that are mainly
259+
intended to collect the imports needed for those subpackages. The `subpackage/api.py`
260+
files are imported into statsmodels api, for example ::
261+
262+
from .nonparametric import api as nonparametric
263+
264+
Users do not need to load the `subpackage/api.py` modules directly.
265+
266+
Direct import for programs
267+
~~~~~~~~~~~~~~~~~~~~~~~~~~
268+
269+
``statsmodels`` submodules are arranged by topic (e.g. `discrete` for discrete
270+
choice models, or `tsa` for time series analysis). Our directory tree (stripped
271+
down) looks something like this::
272+
273+
statsmodels/
274+
__init__.py
275+
api.py
276+
discrete/
277+
__init__.py
278+
discrete_model.py
279+
tests/
280+
results/
281+
tsa/
282+
__init__.py
283+
api.py
284+
tsatools.py
285+
stattools.py
286+
arima_model.py
287+
arima_process.py
288+
vector_ar/
289+
__init__.py
290+
var_model.py
291+
tests/
292+
results/
293+
tests/
294+
results/
295+
stats/
296+
__init__.py
297+
api.py
298+
stattools.py
299+
tests/
300+
tools/
301+
__init__.py
302+
tools.py
303+
decorators.py
304+
tests/
305+
306+
The submodules that can be import heavy contain an empty `__init__.py`, except
307+
for some testing code for running tests for the submodules. The intention is to
308+
change all directories to have an `api.py` and empty `__init__.py` in the next
309+
release.
310+
311+
Import examples
312+
^^^^^^^^^^^^^^^
313+
314+
Functions and classes::
315+
316+
from statsmodels.regression.linear_model import OLS, WLS
317+
from statsmodels.tools.tools import rank, add_constant
318+
319+
Modules ::
320+
321+
from statsmodels.datasets import macrodata
322+
import statsmodels.stats import diagnostic
323+
324+
Modules with aliases ::
325+
326+
import statsmodels.regression.linear_model as lm
327+
import statsmodels.stats.diagnostic as smsdia
328+
import statsmodels.stats.outliers_influence as oi
329+
330+
We do not have currently a convention for aliases of submodules.
331+

0 commit comments

Comments
 (0)