From 983e6dec54d444f347909b80172fa328ca98b4d3 Mon Sep 17 00:00:00 2001 From: aadya940 Date: Sat, 20 Jul 2024 13:54:47 +0530 Subject: [PATCH] expose _markov_chain, _nn, _markov_switching through the public API --- chainopy/__init__.py | 6 +++--- chainopy/{_markov_chain.py => markov_chain.py} | 0 chainopy/{_markov_switching.py => markov_switching.py} | 2 +- chainopy/{_nn.py => nn.py} | 2 +- chainopy/tests/test_markovchain.py | 2 +- chainopy/tests/test_nn.py | 4 ++-- chainopy/tests/test_switching.py | 2 +- docs/source/index.rst | 4 +++- 8 files changed, 12 insertions(+), 10 deletions(-) rename chainopy/{_markov_chain.py => markov_chain.py} (100%) rename chainopy/{_markov_switching.py => markov_switching.py} (99%) rename chainopy/{_nn.py => nn.py} (99%) diff --git a/chainopy/__init__.py b/chainopy/__init__.py index 666d073..59d1daa 100644 --- a/chainopy/__init__.py +++ b/chainopy/__init__.py @@ -1,6 +1,6 @@ -from ._markov_chain import MarkovChain -from ._nn import MarkovChainNeuralNetwork, divergance_analysis -from ._markov_switching import MarkovSwitchingModel +from .markov_chain import MarkovChain +from .nn import MarkovChainNeuralNetwork, divergance_analysis +from .markov_switching import MarkovSwitchingModel __all__ = [ "MarkovChain", diff --git a/chainopy/_markov_chain.py b/chainopy/markov_chain.py similarity index 100% rename from chainopy/_markov_chain.py rename to chainopy/markov_chain.py diff --git a/chainopy/_markov_switching.py b/chainopy/markov_switching.py similarity index 99% rename from chainopy/_markov_switching.py rename to chainopy/markov_switching.py index 4feda6c..ef726a6 100644 --- a/chainopy/_markov_switching.py +++ b/chainopy/markov_switching.py @@ -2,7 +2,7 @@ from typing import List, Tuple from statsmodels.tsa.ar_model import AutoReg -from ._markov_chain import MarkovChain +from .markov_chain import MarkovChain class MarkovSwitchingModel: diff --git a/chainopy/_nn.py b/chainopy/nn.py similarity index 99% rename from chainopy/_nn.py rename to chainopy/nn.py index 8f0b8a7..7e32948 100644 --- a/chainopy/_nn.py +++ b/chainopy/nn.py @@ -6,7 +6,7 @@ import warnings import random -from ._markov_chain import MarkovChain +from .markov_chain import MarkovChain from ._backend import _learn_matrix diff --git a/chainopy/tests/test_markovchain.py b/chainopy/tests/test_markovchain.py index 68868bb..3da8b09 100644 --- a/chainopy/tests/test_markovchain.py +++ b/chainopy/tests/test_markovchain.py @@ -3,7 +3,7 @@ import numpy as np import os -from .._markov_chain import MarkovChain +from ..markov_chain import MarkovChain def test_init(): diff --git a/chainopy/tests/test_nn.py b/chainopy/tests/test_nn.py index 60e63e5..319c954 100644 --- a/chainopy/tests/test_nn.py +++ b/chainopy/tests/test_nn.py @@ -2,8 +2,8 @@ import numpy as np import torch -from .._nn import MarkovChainNeuralNetwork, divergance_analysis -from .._markov_chain import MarkovChain +from ..nn import MarkovChainNeuralNetwork, divergance_analysis +from ..markov_chain import MarkovChain @pytest.fixture diff --git a/chainopy/tests/test_switching.py b/chainopy/tests/test_switching.py index 86cdfe6..eda4d26 100644 --- a/chainopy/tests/test_switching.py +++ b/chainopy/tests/test_switching.py @@ -1,7 +1,7 @@ import numpy as np import random -from .._markov_switching import MarkovSwitchingModel +from ..markov_switching import MarkovSwitchingModel def test_model_fit(): diff --git a/docs/source/index.rst b/docs/source/index.rst index 8792a2e..e802d84 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -12,7 +12,9 @@ Autosummary .. autosummary:: :toctree: _autosummary - chainopy + chainopy.markov_chain + chainopy.markov_switching + chainopy.nn Readme ------