Skip to content

Commit

Permalink
wrote a test to make sure it gives NaN outside of interpolation range
Browse files Browse the repository at this point in the history
  • Loading branch information
eas342 committed Feb 6, 2021
1 parent 430e7f4 commit 31289f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_mie.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ def test_negative_r_for_dist(self):
with self.assertRaisesRegex(ValueError,'Negative or zero radius not allowed') as cm:
calc_mie.get_mie_coeff_distribution(1.0,-0.3)


def test_outside_interpolation_range(self):
wave = np.array([1e-5,2.5])
qext, qsca, qback, g = calc_mie.get_mie_coeff(wave,r=1.0,material='Fe2SiO4')
self.assertEqual(np.isfinite(qext)[0],False)

def test_large_r(self):
res = calc_mie.get_mie_coeff_distribution(0.8,r=1000.,material='Mg2SiO4')

Expand Down

0 comments on commit 31289f0

Please sign in to comment.