<commit_before>'''
Created on 18.10.2013

@author: marscher
'''
import unittest

import emma2.msm.analysis.api as api
import numpy as np
from unittest.case import SkipTest

class Test(unittest.TestCase):

    def testTPT(self):
        try:
            import stallone
        except ImportError:
            self.skipTest('stallone not installed')
        A = np.asarray([0], dtype=int)
        B = np.asarray([5], dtype=int)
        C = np.ndarray(buffer=np.array(
            [[6000, 3, 0, 0, 0, 0],
             [3, 1000, 3, 0, 0, 0],
             [0, 3, 1000, 3, 0, 0],
             [0, 0, 3, 1000, 3, 0],
             [0, 0, 0, 3, 1000, 3],
             [0, 0, 0, 0, 3, 90000]]), shape=(6, 6))
        
        T = C / np.sum(C, axis=1)[:, np.newaxis]

        itpt = api.tpt(T, A, B)
        
        print "flux: ", itpt.getFlux()<commit_msg>use wrapper boolean, instead of import test<commit_after>'''
Created on 18.10.2013

@author: marscher
'''
import unittest

import emma2.msm.analysis.api as api
import numpy as np

class Test(unittest.TestCase):

    def testTPT(self):
        from emma2.util.pystallone import stallone_available
        if not stallone_available:
            self.skipTest('stallone not installed')

        A = np.asarray([0], dtype=int)
        B = np.asarray([5], dtype=int)
        C = np.ndarray(buffer=np.array(
            [[6000, 3, 0, 0, 0, 0],
             [3, 1000, 3, 0, 0, 0],
             [0, 3, 1000, 3, 0, 0],
             [0, 0, 3, 1000, 3, 0],
             [0, 0, 0, 3, 1000, 3],
             [0, 0, 0, 0, 3, 90000]]), shape=(6, 6))
        
        T = C / np.sum(C, axis=1)[:, np.newaxis]

        itpt = api.tpt(T, A, B)
        
        print "flux: ", itpt.getFlux()
{'fraction_non_alphanumeric': 0.15612304120719675, 'fraction_numerical': 0.08067324434126523, 'mean_word_length': 1.8401976935749589, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2205143', 'n_tokens_mistral': 739, 'n_tokens_neox': 624, 'n_words': 183}