<commit_before>
import numpy as np
from ..stingray import lightcurve
## TODO: Fix relative imports

class TestLightcurve(object):

    def setUp(self):
        tstart = 0.0
        tend = 1.0
        dt = 1.e-8

        small_time = np.linspace(tstart, tend, int((tend-tstart)/dt))

        mean_count_rate = 10000.0
        mean_counts = mean_count_rate*dt

        self.toa = np.random.poisson(mean_counts, size=small_time.shape[0])


    def test_correct_timeresolution(self):
        timestep = 0.1
        lc = lightcurve.Lightcurve(self.toa, timestep=timestep)
        assert np.isclose(lc.res, timestep)






<commit_msg>Written first test<commit_after>
import numpy as np
from stingray import lightcurve
## TODO: Fix relative imports

np.random.seed(20150907)


class TestLightcurvefromTOA(object):

    def setUp(self):
        tstart = 0.0
        tend = 1.0
        small_dt = 1.e-8

        small_time = np.linspace(tstart, tend, int((tend-tstart)/small_dt))

        mean_count_rate = 10000.0
        mean_counts = mean_count_rate*small_dt

        poisson_counts = np.random.poisson(mean_counts, size=small_time.shape[0])

        self.toa = small_time[poisson_counts == 1]

        self.dt = 0.1
        self.lc = lightcurve.Lightcurve(self.toa, dt=self.dt)


    def test_correct_timeresolution(self):
        assert np.isclose(self.lc.res, self.dt)







{'fraction_non_alphanumeric': 0.10342316096139839, 'fraction_numerical': 0.028404952658412235, 'mean_word_length': 2.6737967914438503, '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': '4367706', 'n_tokens_mistral': 530, 'n_tokens_neox': 471, 'n_words': 94}