tests package¶
Submodules¶
tests.enterprise_test_data module¶
This module provides the location of data files for tests as datadir. Currently they are in tests/data, and they are based on the 9-yr data release.
tests.test_deterministic_signals module¶
Deterministic Signals are those that provide a get_delay() method,
and are created by the class factories in enterprise.signals.deterministic_signals
.
All tests in this module are run on B1855+09_NANOGrav_9yv1.
- class tests.test_deterministic_signals.TestDeterministicSignals(methodName='runTest')[source]¶
Bases:
TestCase
Tests deterministic signals with a tempo2 Pulsar object.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- classmethod setUpClass()[source]¶
Set up the
enterprise.Pulsar()
object used in tests (tempo2 version).
- test_bwm()[source]¶
Tests
enterprise.signals.deterministic_signals.Deterministic()
using the burst-with-memory functionenterprise.signals.utils.bwm_delay()
. The test instantiates a deterministic Signal on our test pulsar, and compares the array returned by calling get_delay() on the Signal with a fixed dictionary of parameters, with the result of calling the function directly with those parameters.
- test_delay()[source]¶
Same as
TestDeterministicSignals.test_bwm()
, but for a simple sine wave signal.
- test_delay_backend()[source]¶
Same as
TestDeterministicSignals.test_delay()
, but instantiates the Signal withenterprise.signals.selections.by_backend()
, which creates separated named parameters for 430_ASP, 430_PUPPI, L-wide_ASP, L-wide_PUPPI. The parameters are automatically accounted for in get_delay(), but they need to be used explicitly when calling the function directly. The tests therefore reconstructs the delay vector by building selection masks fromenterprise.Pulsar.backend_flags()
.
- test_physical_ephem_model()[source]¶
Tests physical ephemeris model (which is implemented as a deterministic signal) four ways:
computed directly with
enterprise.signals.utils.physical_ephem_delay()
;computed with
enterprise.signals.deterministic_signals.PhysicalEphemerisSignal.get_delay()
with use_epoch_toas=True (the default), which reduces computation by evaluating ephemeris corrections once per measurement epoch, and then interpolating to the full toas vector;computed with
enterprise.signals.deterministic_signals.PhysicalEphemerisSignal.get_delay()
, setting use_epoch_toas=False;loaded from a golden copy.
- class tests.test_deterministic_signals.TestDeterministicSignalsPint(methodName='runTest')[source]¶
Bases:
TestDeterministicSignals
Tests deterministic signals with a PINT Pulsar object.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
tests.test_gp_coefficients module¶
test_gp_coefficients¶
Tests for GP signals used with deterministic coefficients.
- class tests.test_gp_coefficients.TestGPCoefficients(methodName='runTest')[source]¶
Bases:
TestCase
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- class tests.test_gp_coefficients.TestGPCoefficientsPint(methodName='runTest')[source]¶
Bases:
TestGPCoefficients
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
tests.test_gp_priors module¶
test_gp_priors¶
Tests for GP priors and bases.
tests.test_gp_signals module¶
test_gp_signals¶
Tests for GP signal modules.
- class tests.test_gp_signals.TestGPSignals(methodName='runTest')[source]¶
Bases:
TestCase
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- test_fourier_red_noise_backend()[source]¶
Test that red noise-backend signal returns correct values.
- class tests.test_gp_signals.TestGPSignalsPint(methodName='runTest')[source]¶
Bases:
TestGPSignals
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
tests.test_gp_wideband module¶
test_gp_wideband¶
Tests for WidebandTimingModel.
- class tests.test_gp_wideband.TestGPSignalsPint(methodName='runTest')[source]¶
Bases:
TestWidebandTimingModel
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
tests.test_hierarchical_parameter module¶
test_hierarchical_parameter¶
Tests for hierarchical parameter functionality
tests.test_likelihood module¶
test_likelihood¶
Tests of likelihood module
- class tests.test_likelihood.TestLikelihood(methodName='runTest')[source]¶
Bases:
TestCase
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- class tests.test_likelihood.TestLikelihoodPint(methodName='runTest')[source]¶
Bases:
TestLikelihood
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
tests.test_parameter module¶
test_parameter¶
Tests Uniform and Normal parameter priors and sampling functions
- class tests.test_parameter.TestParameter(methodName='runTest')[source]¶
Bases:
TestCase
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- test_normal()[source]¶
Test Normal parameter prior and sampler for various combinations of scalar and vector arguments.
tests.test_pta module¶
test_pta¶
Tests for common signal and PTA class modules.
- class tests.test_pta.TestPTASignals(methodName='runTest')[source]¶
Bases:
TestCase
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- class tests.test_pta.TestPTASignalsPint(methodName='runTest')[source]¶
Bases:
TestPTASignals
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
tests.test_pulsar module¶
tests.test_selections module¶
test_pulsar¶
Tests for signals/selections module.
- class tests.test_selections.TestSelections(methodName='runTest')[source]¶
Bases:
TestCase
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- class tests.test_selections.TestSelectionsPint(methodName='runTest')[source]¶
Bases:
TestSelections
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
tests.test_set_parameter module¶
test_set_parameter¶
Tests of setting constant parameters
- class tests.test_set_parameter.TestSetParameters(methodName='runTest')[source]¶
Bases:
TestCase
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- class tests.test_set_parameter.TestSetParametersPint(methodName='runTest')[source]¶
Bases:
TestSetParameters
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
tests.test_utils module¶
test_utils¶
Tests for utils module.
- class tests.test_utils.TestUtils(methodName='runTest')[source]¶
Bases:
TestCase
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
tests.test_vector_parameter module¶
test_vector_parameter¶
Tests for vector parameter functionality
- class tests.test_vector_parameter.TestVectorParameter(methodName='runTest')[source]¶
Bases:
TestCase
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- class tests.test_vector_parameter.TestVectorParameterPint(methodName='runTest')[source]¶
Bases:
TestVectorParameter
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
tests.test_white_signals module¶
test_white_signals¶
Tests for white signal modules.
- class tests.test_white_signals.TestWhiteSignals(methodName='runTest')[source]¶
Bases:
TestCase
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- test_add_efac_tnequad()[source]¶
Test that addition of efac and tnequad signal returns correct covariance.
- test_add_efac_tnequad_backend()[source]¶
Test that addition of efac-backend and tnequad-backend signal returns correct covariance.
- test_ecorr_sherman_morrison_ipta()[source]¶
Test of sherman-morrison ecorr signal and solve methods.
- class tests.test_white_signals.TestWhiteSignalsPint(methodName='runTest')[source]¶
Bases:
TestWhiteSignals
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.