# Path: src/naima/core.py
# def run_sampler(nrun=100, sampler=None, pos=None, **kwargs):
#     """Run an MCMC sampler.
# 
#     If no sampler or initial position vector is provided, extra ``kwargs`` are
#     passed to `get_sampler` to generate a new sampler.
# 
#     Parameters
#     ----------
#     nrun : int, optional
#         Number of steps to run
#     sampler : :class:`~emcee.EnsembleSampler` instance, optional
#         Sampler.
#     pos : :class:`~numpy.ndarray`, optional
#         A list of initial position vectors for the walkers. It should have
#         dimensions of ``(nwalkers,dim)``, where ``dim`` is the number of free
#         parameters. `emcee.utils.sample_ball` can be used to generate a
#         multidimensional gaussian distribution around a single initial
#         position.
# 
#     Returns
#     -------
#     sampler : :class:`~emcee.EnsembleSampler` instance
#         Sampler containing the paths of the walkers during the ``nrun`` steps.
#     pos : array
#         List of final position vectors after the run.
#     """
# 
#     if sampler is None or pos is None:
#         sampler, pos = get_sampler(**kwargs)
# 
#     sampler.run_info["n_run"] = nrun
# 
#     print("\nWalker burn in finished, running {0} steps...".format(nrun))
#     sampler.reset()
#     sampler, pos = _run_mcmc(sampler, pos, nrun)
# 
#     return sampler, pos
# 
# def uniform_prior(value, umin, umax):
#     """Uniform prior distribution."""
#     if umin <= value <= umax:
#         return 0.0
#     else:
#         return -np.inf


import astropy.units as u
import numpy as np
from astropy.io import ascii
from astropy.tests.helper import pytest
from astropy.utils.data import get_pkg_data_filename
from ..core import run_sampler, uniform_prior
        nwalkers=10,
        nburn=2,
        nrun=2,
        threads=1,
    )
    return sampler


@pytest.fixture(scope="module")
def simple_sampler():
    p0 = np.array((np.log(1.8e-12), 2.4, np.log10(15.0)))
    labels = ["log(norm)", "index", "log10(cutoff)"]
    sampler, pos = run_sampler(
        data_table=data_table,
        p0=p0,
        labels=labels,
        model=simple_cutoffexp,
        prior=lnprior,
        nwalkers=10,
        nburn=2,
        nrun=2,
        threads=1,
    )
    return sampler


@pytest.fixture(scope="module")
def noblob_sampler():
    p0 = np.array((np.log(1.8e-12), 2.4, np.log10(15.0)))
    labels = ["log(norm)", "index", "log10(cutoff)"]

# Path: src/naima/core.py
# def run_sampler(nrun=100, sampler=None, pos=None, **kwargs):
#     """Run an MCMC sampler.
# 
#     If no sampler or initial position vector is provided, extra ``kwargs`` are
#     passed to `get_sampler` to generate a new sampler.
# 
#     Parameters
#     ----------
#     nrun : int, optional
#         Number of steps to run
#     sampler : :class:`~emcee.EnsembleSampler` instance, optional
#         Sampler.
#     pos : :class:`~numpy.ndarray`, optional
#         A list of initial position vectors for the walkers. It should have
#         dimensions of ``(nwalkers,dim)``, where ``dim`` is the number of free
#         parameters. `emcee.utils.sample_ball` can be used to generate a
#         multidimensional gaussian distribution around a single initial
#         position.
# 
#     Returns
#     -------
#     sampler : :class:`~emcee.EnsembleSampler` instance
#         Sampler containing the paths of the walkers during the ``nrun`` steps.
#     pos : array
#         List of final position vectors after the run.
#     """
# 
#     if sampler is None or pos is None:
#         sampler, pos = get_sampler(**kwargs)
# 
#     sampler.run_info["n_run"] = nrun
# 
#     print("\nWalker burn in finished, running {0} steps...".format(nrun))
#     sampler.reset()
#     sampler, pos = _run_mcmc(sampler, pos, nrun)
# 
#     return sampler, pos
# 
# def uniform_prior(value, umin, umax):
#     """Uniform prior distribution."""
#     if umin <= value <= umax:
#         return 0.0
#     else:
#         return -np.inf


# Path: src/naima/tests/fixtures.py
import astropy.units as u
import numpy as np
from astropy.io import ascii
from astropy.tests.helper import pytest
from astropy.utils.data import get_pkg_data_filename
from ..core import run_sampler, uniform_prior

        nwalkers=10,
        nburn=2,
        nrun=2,
        threads=1,
    )
    return sampler


@pytest.fixture(scope="module")
def simple_sampler():
    p0 = np.array((np.log(1.8e-12), 2.4, np.log10(15.0)))
    labels = ["log(norm)", "index", "log10(cutoff)"]
    sampler, pos = run_sampler(
        data_table=data_table,
        p0=p0,
        labels=labels,
        model=simple_cutoffexp,
        prior=lnprior,
        nwalkers=10,
        nburn=2,
        nrun=2,
        threads=1,
    )
    return sampler


@pytest.fixture(scope="module")
def noblob_sampler():
    p0 = np.array((np.log(1.8e-12), 2.4, np.log10(15.0)))
    labels = ["log(norm)", "index", "log10(cutoff)"]

    sampler, pos = run_sampler(