Skip to content

Commit

Permalink
Fiux
Browse files Browse the repository at this point in the history
  • Loading branch information
Sosnowsky committed Feb 23, 2024
1 parent 4936346 commit b3d668e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/test_pulse_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,25 @@ def test__get_double_exponential_shape():
def test__get_secant_shape():
theta = np.array([1, 2, 3])
expected_result = np.array([0.20628208, 0.08460748, 0.03161706])
assert np.allclose(BlobShapeImpl._get_secant_shape(theta), expected_result)

ps = BlobShapeImpl("secant", "secant")
values = ps.get_blob_shape_perp(theta)
assert np.max(np.abs(values - expected_result)) < 1e-5, "Wrong shape"


def test__get_lorentz_shape():
theta = np.array([1, 2, 3])
expected_result = np.array([0.15915494, 0.06366198, 0.03183099])
assert np.allclose(BlobShapeImpl._get_lorentz_shape(theta), expected_result)

ps = BlobShapeImpl("lorentz", "lorentz")
values = ps.get_blob_shape_perp(theta)
assert np.max(np.abs(values - expected_result)) < 1e-5, "Wrong shape"


def test__get_dipole_shape():
theta = np.array([1, 2, 3])
expected_result = np.array([-0.48394145, -0.21596387, -0.02659109])
assert np.allclose(BlobShapeImpl._get_dipole_shape(theta), expected_result)

ps = BlobShapeImpl("dipole", "dipole")
values = ps.get_blob_shape_perp(theta)
assert np.max(np.abs(values - expected_result)) < 1e-5, "Wrong shape"

0 comments on commit b3d668e

Please sign in to comment.