<commit_before>import COPASI
import unittest
from types import *

class Test_CTimeSeries(unittest.TestCase):
  def setUp(self):
    COPASI.CCopasiDataModel.GLOBAL.loadModel("calcium_juergen.cps")
    self.ctimeseries=COPASI.CTimeSeries()
    self.ctimeseries.init(100,COPASI.CCopasiDataModel.GLOBAL.getModel())
    self.ctimeseries.add()
    self.ctimeseries.finish()

  def test_getNumSteps(self):
    steps=self.ctimeseries.getNumSteps()
    self.assert_(type(steps)==IntType)
    self.assert_(steps==1)

  def test_getNumVariables(self):
    variables=self.ctimeseries.getNumVariables()
    self.assert_(type(variables)==IntType)
    self.assert_(variables==4)

  def test_getData(self):
    data=self.ctimeseries.getData(0,1)
    self.assert_(type(data)==FloatType)
    self.assert_(data==float("nan"))

  def test_getConcentrationData(self):
    data=self.ctimeseries.getConcentrationData(0,1)
    self.assert_(type(data)==FloatType)
    self.assert_(data==float("nan"))

  def test_getTitle(self):
    title=self.ctimeseries.getTitle(1)
    self.assert_(type(title)==StringType)
    self.assert_(title=="a")


def suite():
  tests=[
          'test_getNumSteps'
         ,'test_getNumVariables'
         ,'test_getData'
         ,'test_getConcentrationData'
         ,'test_getTitle'
        ]<commit_msg>Fixed two of the tests since they failed on python 2.4 Somehow the handling of NaN must either have changed from 2.3 to 2.4 or the Mac behaves differently from linux.<commit_after>import COPASI
import unittest
from types import *

class Test_CTimeSeries(unittest.TestCase):
  def setUp(self):
    COPASI.CCopasiDataModel.GLOBAL.loadModel("calcium_juergen.cps")
    self.ctimeseries=COPASI.CTimeSeries()
    self.ctimeseries.init(100,COPASI.CCopasiDataModel.GLOBAL.getModel())
    self.ctimeseries.add()
    self.ctimeseries.finish()

  def test_getNumSteps(self):
    steps=self.ctimeseries.getNumSteps()
    self.assert_(type(steps)==IntType)
    self.assert_(steps==1)

  def test_getNumVariables(self):
    variables=self.ctimeseries.getNumVariables()
    self.assert_(type(variables)==IntType)
    self.assert_(variables==4)

  def test_getData(self):
    data=self.ctimeseries.getData(0,1)
    self.assert_(type(data)==FloatType)
    # check if it is NaN since NaN != NaN
    self.assert_(data!=data)

  def test_getConcentrationData(self):
    data=self.ctimeseries.getConcentrationData(0,1)
    self.assert_(type(data)==FloatType)
    # check if it is NaN since NaN != NaN
    self.assert_(data!=data)

  def test_getTitle(self):
    title=self.ctimeseries.getTitle(1)
    self.assert_(type(title)==StringType)
    self.assert_(title=="a")


def suite():
  tests=[
          'test_getNumSteps'
         ,'test_getNumVariables'
         ,'test_getData'
         ,'test_getConcentrationData'
         ,'test_getTitle'
        ]
{'fraction_non_alphanumeric': 0.12310939148786493, 'fraction_numerical': 0.009145269081955681, 'mean_word_length': 4.19926873857404, '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': '5039298', 'n_tokens_mistral': 1006, 'n_tokens_neox': 959, 'n_words': 144}