Skip to content

Commit

Permalink
uncomment some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronDJohnson committed Oct 17, 2024
1 parent d83a97b commit dba9c0e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 50 deletions.
4 changes: 2 additions & 2 deletions tests/enterprise_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

# Is libstempo installed?
try:
import libstempo
import libstempo # noqa

LIBSTEMPO_INSTALLED = True
except ImportError:
LIBSTEMPO_INSTALLED = False

# Is PINT installed?
try:
import pint
import pint # noqa

PINT_INSTALLED = True
except ImportError:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_uniform(self):
msg2 = "Enterprise samples have wrong value, type, or size"
x1 = UniformSampler(p_min, p_max)
assert p_min < x1 < p_max, msg2
assert type(x1) == float, msg2
assert type(x1) is float, msg2

msg3 = "Enterprise and scipy PPF do not match"
assert np.allclose(UniformPPF(x, p_min, p_max), scipy.stats.uniform.ppf(x, p_min, p_max - p_min)), msg3
Expand Down
94 changes: 47 additions & 47 deletions tests/test_white_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,50 +506,50 @@ def test_ecorr_block_ipta(self):
self._ecorr_test_ipta(method="block", shuffled=True)


# @pytest.mark.skipif(not PINT_INSTALLED, reason="Skipping tests that require PINT because it isn't installed")
# class TestWhiteSignalsPint(TestWhiteSignals):
# @classmethod
# def setUpClass(cls):
# """Setup the Pulsar object."""

# # initialize Pulsar class
# cls.psr = Pulsar(
# datadir + "/B1855+09_NANOGrav_9yv1.gls.par",
# datadir + "/B1855+09_NANOGrav_9yv1.tim",
# ephem="DE430",
# timing_package="pint",
# )

# # IPTA-like pulsar
# cls.ipsr = Pulsar(
# datadir + "/1713.Sep.T2.par", datadir + "/1713.Sep.T2.tim", ephem="DE421", timint_package="pint", sort=True
# )

# # Same pulsar, but with TOAs shuffled
# cls.ipsr_shuffled = Pulsar(
# datadir + "/1713.Sep.T2.par", datadir + "/1713.Sep.T2.tim", ephem="DE421", timint_package="pint", sort=True
# )
# rng = np.random.default_rng(seed=123)
# rng.shuffle(cls.ipsr_shuffled._isort)
# for ii, p in enumerate(cls.ipsr_shuffled._isort):
# cls.ipsr_shuffled._iisort[p] = ii


# @pytest.mark.skipif(not LIBSTEMPO_INSTALLED, reason="Skipping tests that require libstempo because it isn't installed")
# class TestWhiteSignalsTempo2(TestWhiteSignals):
# @classmethod
# def setUpClass(cls):
# """Setup the Pulsar object."""

# # initialize Pulsar class
# cls.psr = Pulsar(datadir + "/B1855+09_NANOGrav_9yv1.gls.par", datadir + "/B1855+09_NANOGrav_9yv1.tim")

# # IPTA-like pulsar
# cls.ipsr = Pulsar(datadir + "/1713.Sep.T2.par", datadir + "/1713.Sep.T2.tim", sort=True)

# # Same pulsar, but with TOAs shuffled
# cls.ipsr_shuffled = Pulsar(datadir + "/1713.Sep.T2.par", datadir + "/1713.Sep.T2.tim", sort=True)
# rng = np.random.default_rng(seed=123)
# rng.shuffle(cls.ipsr_shuffled._isort)
# for ii, p in enumerate(cls.ipsr_shuffled._isort):
# cls.ipsr_shuffled._iisort[p] = ii
@pytest.mark.skipif(not PINT_INSTALLED, reason="Skipping tests that require PINT because it isn't installed")
class TestWhiteSignalsPint(TestWhiteSignals):
@classmethod
def setUpClass(cls):
"""Setup the Pulsar object."""

# initialize Pulsar class
cls.psr = Pulsar(
datadir + "/B1855+09_NANOGrav_9yv1.gls.par",
datadir + "/B1855+09_NANOGrav_9yv1.tim",
ephem="DE430",
timing_package="pint",
)

# IPTA-like pulsar
cls.ipsr = Pulsar(
datadir + "/1713.Sep.T2.par", datadir + "/1713.Sep.T2.tim", ephem="DE421", timint_package="pint", sort=True
)

# Same pulsar, but with TOAs shuffled
cls.ipsr_shuffled = Pulsar(
datadir + "/1713.Sep.T2.par", datadir + "/1713.Sep.T2.tim", ephem="DE421", timint_package="pint", sort=True
)
rng = np.random.default_rng(seed=123)
rng.shuffle(cls.ipsr_shuffled._isort)
for ii, p in enumerate(cls.ipsr_shuffled._isort):
cls.ipsr_shuffled._iisort[p] = ii


@pytest.mark.skipif(not LIBSTEMPO_INSTALLED, reason="Skipping tests that require libstempo because it isn't installed")
class TestWhiteSignalsTempo2(TestWhiteSignals):
@classmethod
def setUpClass(cls):
"""Setup the Pulsar object."""

# initialize Pulsar class
cls.psr = Pulsar(datadir + "/B1855+09_NANOGrav_9yv1.gls.par", datadir + "/B1855+09_NANOGrav_9yv1.tim")

# IPTA-like pulsar
cls.ipsr = Pulsar(datadir + "/1713.Sep.T2.par", datadir + "/1713.Sep.T2.tim", sort=True)

# Same pulsar, but with TOAs shuffled
cls.ipsr_shuffled = Pulsar(datadir + "/1713.Sep.T2.par", datadir + "/1713.Sep.T2.tim", sort=True)
rng = np.random.default_rng(seed=123)
rng.shuffle(cls.ipsr_shuffled._isort)
for ii, p in enumerate(cls.ipsr_shuffled._isort):
cls.ipsr_shuffled._iisort[p] = ii

0 comments on commit dba9c0e

Please sign in to comment.