Skip to content

Commit 2eeb424

Browse files
committed
fixes for doc
1 parent 546ccd6 commit 2eeb424

15 files changed

+42
-42
lines changed

.readthedocs.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ build:
66
python: "3.10"
77
jobs:
88
pre_build:
9-
- sphinx-apidoc -o docs/source chainopy/ *.pyx
9+
- python setup.py build_ext --inplace
10+
- sphinx-apidoc --private -o docs/source ../chainopy/
1011

1112
python:
1213
install:
@@ -24,5 +25,4 @@ sphinx:
2425
fail_on_warning: false
2526

2627
submodules:
27-
include: ['chainopy']
2828
recursive: true

chainopy/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from .markov_chain import MarkovChain
2-
from .nn import MarkovChainNeuralNetwork, divergance_analysis
3-
from .markov_switching import MarkovSwitchingModel
1+
from ._markov_chain import MarkovChain
2+
from ._nn import MarkovChainNeuralNetwork, divergance_analysis
3+
from ._markov_switching import MarkovSwitchingModel
44

55
__all__ = [
66
"MarkovChain",
File renamed without changes.
File renamed without changes.
File renamed without changes.

chainopy/markov_chain.py chainopy/_markov_chain.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import numpy as np
55
import numba
66

7-
from .exceptions import handle_exceptions
8-
from .visualizations import _visualize_tpm, _visualize_chain
9-
from .fileio import _save_model_markovchain, _load_model_markovchain, load_text
10-
from .caching import cache
7+
from ._exceptions import handle_exceptions
8+
from ._visualizations import _visualize_tpm, _visualize_chain
9+
from ._fileio import _save_model_markovchain, _load_model_markovchain, load_text
10+
from ._caching import cache
1111
from ._backend import (
1212
_simulate,
1313
_absorbing,

chainopy/markov_switching.py chainopy/_markov_switching.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing import List, Tuple
33
from statsmodels.tsa.ar_model import AutoReg
44

5-
from .markov_chain import MarkovChain
5+
from ._markov_chain import MarkovChain
66

77

88
class MarkovSwitchingModel:
@@ -117,8 +117,8 @@ def predict(
117117
118118
Returns:
119119
--------
120-
Tuple[np.ndarray, np.ndarray]:
121-
Tuple containing the array of predicted target values and the predicted regime sequence.
120+
Tuple[np.ndarray, np.ndarray]: Tuple containing the array of predicted
121+
target values and the predicted regime sequence.
122122
"""
123123
predictions = np.zeros(steps, dtype=np.float32)
124124
regime_predictions = self._markov_chain.simulate(start_regime, steps)

chainopy/nn.py chainopy/_nn.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import warnings
77
import random
88

9-
from .markov_chain import MarkovChain
9+
from ._markov_chain import MarkovChain
1010
from ._backend import _learn_matrix
1111

1212

File renamed without changes.

chainopy/tests/test_markovchain.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
import os
55

6-
from ..markov_chain import MarkovChain
6+
from .._markov_chain import MarkovChain
77

88

99
def test_init():

chainopy/tests/test_nn.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import numpy as np
33
import torch
44

5-
from ..nn import MarkovChainNeuralNetwork, divergance_analysis
6-
from ..markov_chain import MarkovChain
5+
from .._nn import MarkovChainNeuralNetwork, divergance_analysis
6+
from .._markov_chain import MarkovChain
77

88

99
@pytest.fixture

chainopy/tests/test_switching.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
import random
33

4-
from ..markov_switching import MarkovSwitchingModel
4+
from .._markov_switching import MarkovSwitchingModel
55

66

77
def test_model_fit():

docs/source/conf.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
"sphinx_autodoc_typehints",
3939
]
4040

41-
bibtex_bibfiles = ["paper.bib"]
42-
4341
source_suffix = {
4442
".rst": "restructuredtext",
4543
".md": "markdown",
@@ -52,17 +50,21 @@
5250
"Thumbs.db",
5351
".DS_Store",
5452
"chainopy.tests.rst",
53+
"chainopy._backend.rst",
54+
"chainopy.rst",
55+
"modules.rst",
56+
"_templates"
5557
]
5658

5759
autodoc_default_options = {
5860
"members": True,
5961
"undoc-members": True,
6062
"private-members": True,
6163
"special-members": "__init__",
62-
"inherited-members": True,
63-
"show-inheritance": True,
6464
}
6565

66+
autosummary_generate=True
67+
6668
napoleon_google_docstring = True
6769
napoleon_numpy_docstring = True
6870
napoleon_include_init_with_doc = True

docs/source/index.md

-21
This file was deleted.

docs/source/index.rst

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Welcome to Chainopy's documentation!
2+
3+
CHAINOPY
4+
========
5+
6+
.. toctree::
7+
8+
.. autosummary::
9+
:toctree: _autosummary
10+
11+
chainopy._markov_chain
12+
chainopy._markov_switching
13+
chainopy._nn
14+
15+
16+
README File
17+
===========
18+
19+
.. mdinclude:: ../../README.md

0 commit comments

Comments
 (0)