def test_ind_top_4(self): mx = ma.masked_array(self.x, mask=[1, 0, 1, 0, 1, 0, 1, 0]) dx = ma.diff(mx).filled(0) with pytest.raises(IndexError): droplet.ind_top(dx, self.peak_position, self.n_prof, self.search_range, self.threshold)
def _basetop(dprof: np.ndarray, pind: int) -> Tuple[int, int]: """Finds the base and top of peak in ldr or v profile.""" top = droplet.ind_top(dprof, pind, len(dprof), 10, 2) base = droplet.ind_base(dprof, pind, 10, 2) return base, top
def test_ind_top_3(self): small_threshold = 1.01 assert droplet.ind_top(self.dx, self.peak_position, self.n_prof, self.search_range, small_threshold) == 3
def test_ind_top_2(self): huge_threshold = 5000 assert droplet.ind_top(self.dx, self.peak_position, self.n_prof, self.search_range, huge_threshold) == 7
def test_ind_top_1(self): search_range = 100 assert droplet.ind_top(self.dx, self.peak_position, self.n_prof, search_range, self.threshold) == 3
def _basetop(dprof, pind): """Finds the base and top of peak in ldr or v profile.""" top = droplet.ind_top(dprof, pind, len(dprof), 10, 2) base = droplet.ind_base(dprof, pind, 10, 2) return top, base
def test_ind_top_0(self): assert (droplet.ind_top(self.dx, self.peak_position, self.n_prof, self.search_range, self.threshold) == 3)