Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Gilman committed May 28, 2023
1 parent c0ba65e commit ff6c3ef
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion example_notebooks/halo_truncation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "f6279354",
"id": "be7ebd78",
"metadata": {},
"outputs": [],
"source": []
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pyhalo"
version = "0.2.1"
version = "0.2.2"
authors = [
{ name="Daniel Gilman", email="[email protected]" },
]
Expand Down
7 changes: 4 additions & 3 deletions tests/test_utilities.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from lenstronomy.LensModel.lens_model import LensModel
import numpy.testing as npt
import numpy as np
from pyHalo.utilities import interpolate_ray_paths, de_broglie_wavelength, delta_sigma, ITSampling, inverse_transform_sampling
from pyHalo.utilities import interpolate_ray_paths, de_broglie_wavelength, delta_sigma, ITSampling, \
inverse_transform_sampling, inverse_transform_sampling_from_cdf
from pyHalo.Cosmology.cosmology import Cosmology
import pytest

Expand Down Expand Up @@ -61,13 +62,13 @@ def test_inverse_transform_sampling(self):
x_samples = inverse_transform_sampling(x, func, (), 100000)
npt.assert_almost_equal(np.mean(x_samples)/mu, 1.0, 2)
npt.assert_almost_equal(np.std(x_samples)/sigma, 1.0, 2)

def test_ITSampling(self):

mu = 2.14
sigma = 0.35
x = np.random.normal(mu, sigma, 250000)
sampler = ITSampling(x)
sampler = ITSampling.from_samples(x)
x_samples = sampler(100000)
npt.assert_almost_equal(np.mean(x_samples)/mu, 1.0, 2)
npt.assert_almost_equal(np.std(x_samples)/sigma, 1.0, 2)
Expand Down

0 comments on commit ff6c3ef

Please sign in to comment.