diff --git a/braidgenerator/braidword.py b/braidgenerator/braidword.py index c966aa1..fff6ada 100644 --- a/braidgenerator/braidword.py +++ b/braidgenerator/braidword.py @@ -1,6 +1,7 @@ import random -from copy import copy, deepcopy -from braidgenerator.decorators.braidword import checkparams_braidword +from copy import deepcopy +from .decorators.braidword import checkparams_braidword + class BraidWord: r"""Encapsulation of a mathematical braid. BraidWord contains a word diff --git a/braidgenerator/decorators/markovchain.py b/braidgenerator/decorators/markovchain.py index 58f60d2..365d6d7 100644 --- a/braidgenerator/decorators/markovchain.py +++ b/braidgenerator/decorators/markovchain.py @@ -1,4 +1,5 @@ -from braidgenerator import BraidWord +from ..braidword import BraidWord + def _check_braidword(braidword: BraidWord) -> BraidWord: # Checks if input is BraidWord object diff --git a/braidgenerator/markovchain.py b/braidgenerator/markovchain.py index b575d4b..9881c10 100644 --- a/braidgenerator/markovchain.py +++ b/braidgenerator/markovchain.py @@ -1,10 +1,8 @@ import random -import copy import pandas as pd -import functools -from copy import copy, deepcopy -from braidgenerator import BraidWord -from braidgenerator.decorators.markovchain import checkparams_markovchain +from copy import deepcopy +from .braidword import BraidWord +from .decorators.markovchain import checkparams_markovchain class MarkovChain: @@ -104,9 +102,9 @@ def model(self, num_braidreps: int = 1, msteps: int = 100): A random number is picked between (0, 6), inclusive, determining the Markov step to perform. Another random number is picked from range(len(BraidWord.word)) that represents the index of BraidWord.word - on which to perform the Markov step. The braidrep is generated by - picking a random index from the set of possible indices for - BraidWord.word and a random Markov step that acts on BraidWord.word at + on which to perform the Markov step. The braidrep is generated by + picking a random index from the set of possible indices for + BraidWord.word and a random Markov step that acts on BraidWord.word at the given index. Parameters diff --git a/braidgenerator/tests/__init__.py b/braidgenerator/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_braidword.py b/braidgenerator/tests/braidword_test.py similarity index 99% rename from tests/test_braidword.py rename to braidgenerator/tests/braidword_test.py index b28a66d..d16550c 100644 --- a/tests/test_braidword.py +++ b/braidgenerator/tests/braidword_test.py @@ -1,7 +1,9 @@ """Unit Tests for BraidWord""" -from braidgenerator import BraidWord import unittest +from ..braidword import BraidWord + + class TestBraidWordInit(unittest.TestCase): def test_init_pathfail_0(self): ''' diff --git a/tests/test_markovchain.py b/braidgenerator/tests/markovchain_test.py similarity index 98% rename from tests/test_markovchain.py rename to braidgenerator/tests/markovchain_test.py index c89969b..65e25cd 100644 --- a/tests/test_markovchain.py +++ b/braidgenerator/tests/markovchain_test.py @@ -1,8 +1,10 @@ """Unit Tests for MarkovChain""" -from braidgenerator import MarkovChain -from braidgenerator import BraidWord -import pandas as pd import unittest +#import pandas as pd + +from ..markovchain import MarkovChain +from ..braidword import BraidWord + class TestMarkovChainMethods(unittest.TestCase): def test_aggregate(self):