示例#1
0
    def test_Spatial_Rate_tabular(self):
        out_sr = sm.Spatial_Rate(self.df[self.ename], self.df[self.bname],
                                 self.w).r
        np.testing.assert_allclose(out_sr[:5].flatten(),
                                   self.sr,
                                   rtol=RTOL,
                                   atol=ATOL)
        self.assertIsInstance(out_sr, np.ndarray)

        out_sr = sm.Spatial_Rate.by_col(self.df,
                                        self.ename,
                                        self.bname,
                                        w=self.w)
        outcol = '{}-{}_spatial_rate'.format(self.ename, self.bname)
        r = out_sr[outcol].values
        self.assertIsInstance(r, np.ndarray)
        np.testing.assert_allclose(r[:5], self.sr, rtol=RTOL, atol=ATOL)
示例#2
0
 def test_Spatial_Rate(self):
     out_sr = sm.Spatial_Rate(self.e, self.b, self.w).r
     out_sr = [round(i, 7) for i in out_sr[:5]]
     self.assertEquals(out_sr, self.sr)
示例#3
0
 def test_Spatial_Rate(self):
     out_sr = sm.Spatial_Rate(self.e, self.b, self.w).r
     np.testing.assert_allclose(out_sr[:5].flatten(),
                                self.sr,
                                rtol=RTOL,
                                atol=ATOL)