예제 #1
0
 def testimmutablecopyof(self):
     a = np.array([[429., 5.], [2., 14.]])
     npt.assert_almost_equal(a, np.array([[429., 5.], [2., 14.]]))
     a[1, 1] = 42.
     npt.assert_almost_equal(a, np.array([[429., 5.], [2., 42.]]))
     b = npu.immutablecopyof(a)
     npt.assert_almost_equal(b, np.array([[429., 5.], [2., 42.]]))
     with self.assertRaises(ValueError):
         b[1, 1] = 132.
     npt.assert_almost_equal(b, np.array([[429., 5.], [2., 42.]]))
     a[1, 1] = 132.
     npt.assert_almost_equal(b, np.array([[429., 5.], [2., 42.]]))
예제 #2
0
파일: particle.py 프로젝트: superidylle/tsa
 def weights(self):
     return npu.immutablecopyof(self._weights)
예제 #3
0
파일: particle.py 프로젝트: superidylle/tsa
 def unnormalised_weights(self):
     return npu.immutablecopyof(self._unnormalised_weights)
예제 #4
0
파일: particle.py 프로젝트: superidylle/tsa
 def resampled_particles(self):
     return npu.immutablecopyof(self._resampled_particles)
예제 #5
0
파일: particle.py 프로젝트: superidylle/tsa
 def prior_particles(self):
     return npu.immutablecopyof(self._prior_particles)