nessai.utils.testing
====================

.. py:module:: nessai.utils.testing

.. autoapi-nested-parse::

   Utilities for the test suite.

   ..
       !! processed by numpydoc !!


Classes
-------

.. autoapisummary::

   nessai.utils.testing.IntegrationTestModel


Functions
---------

.. autoapisummary::

   nessai.utils.testing.assert_structured_arrays_equal


Module Contents
---------------

.. py:class:: IntegrationTestModel(dims=2)

   Bases: :py:obj:`nessai.model.Model`


   
   Complete nessai model for use with integration tests
















   ..
       !! processed by numpydoc !!

   .. py:attribute:: bounds

      
      Dictionary with the lower and upper bounds for each parameter.
















      ..
          !! processed by numpydoc !!


   .. py:attribute:: names

      
      List of the names of each parameter in the model.
















      ..
          !! processed by numpydoc !!


   .. py:method:: log_prior(x)

      
      Returns log-prior, must be defined by the user.
















      ..
          !! processed by numpydoc !!


   .. py:method:: log_likelihood(x)

      
      Returns the log-likelihood, must be defined by the user.
















      ..
          !! processed by numpydoc !!


   .. py:method:: to_unit_hypercube(x)

      
      Map from the prior space to the unit hypercube.

      Not implemented by default.















      ..
          !! processed by numpydoc !!


   .. py:method:: from_unit_hypercube(x)

      
      Map from the unit hypercube to the priors.

      Not implemented by default.















      ..
          !! processed by numpydoc !!


.. py:function:: assert_structured_arrays_equal(x, y, atol=0.0, rtol=0.0)

   
   Assert structured arrays are equal.

   Supports NaNs by checking each field individually.

   :Parameters:

       **x** : np.ndarray
           Array to check.

       **y** : np.ndarray
           Array to compare to.

       **atol** : float
           The absolute tolerance parameter. See the numpy documentation for all
           :code:`numpy.allclose`.

       **rtol** : float
           The relative tolerance parameter. See the numpy documentation for all
           :code:`numpy.allclose`.







   :Raises:

       AssertionError
           If dtype or values in each field are not equal.







   ..
       !! processed by numpydoc !!

