Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobachetti committed Jan 9, 2025
1 parent 5664322 commit 30bfa35
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion stingray/pulse/tests/test_accelsearch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import pytest
from stingray.pulse.accelsearch import accelsearch
from stingray.pulse.accelsearch import accelsearch, _create_responses
from stingray.utils import HAS_NUMBA

pytestmark = pytest.mark.slow
Expand Down Expand Up @@ -46,6 +46,16 @@ def setup_class(cls):
def test_prepare(self):
pass

@pytest.mark.parametrize("kind", [float, np.longdouble])
def test_create_response_types(self, kind):
z = np.array([-1, 0, 1], dtype=kind)
zint = np.array([-1, 0, 1], dtype=int)

rs = _create_responses(z)
rints = _create_responses(zint)
for r, rint in zip(rs, rints):
assert np.allclose(r, rint)

def test_signal(self):
candidate_table = accelsearch(
self.times,
Expand Down

0 comments on commit 30bfa35

Please sign in to comment.