Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions braidgenerator/braidword.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion braidgenerator/decorators/markovchain.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from braidgenerator import BraidWord
from ..braidword import BraidWord


def _check_braidword(braidword: BraidWord) -> BraidWord:
# Checks if input is BraidWord object
Expand Down
14 changes: 6 additions & 8 deletions braidgenerator/markovchain.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -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):
'''
Expand Down
Original file line number Diff line number Diff line change
@@ -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):
Expand Down