import unittest
import math

import numpy as np
import numpy.testing
import ROOT
ROOT.PyConfig.IgnoreCommandLineOptions = True

from parspec import SpecBuilder
from parspec import Source
from parspec import ParSpec


def logPoisson(k, v, s):
    vv = np.array(k, dtype=float)
    vv[vv<1] = 1
    vv += s
    return -0.5 * (k-v)**2 / vv


class TestParSpec(unittest.TestCase):