예제 #1
0
 def test_expand_2d(self):
     col = SiteCollection(self.SITES)
     col.indices = numpy.array([1, 3, 5, 6])
     data_condensed = numpy.array([[1, 2, 3], [5, 6, 7], [10, 11, 12], [15, 16, 17]])
     data_expanded = col.expand(data_condensed, total_sites=8, placeholder=-1)
     data_expanded_expected = numpy.array(
         [[-1, -1, -1], [1, 2, 3], [-1, -1, -1], [5, 6, 7], [-1, -1, -1], [10, 11, 12], [15, 16, 17], [-1, -1, -1]]
     )
     numpy.testing.assert_array_equal(data_expanded, data_expanded_expected)
예제 #2
0
파일: site_test.py 프로젝트: angri/nhlib
 def test_expand_2d(self):
     col = SiteCollection(self.SITES)
     col.indices = numpy.array([1, 3, 5, 6])
     data_condensed = numpy.array([[1, 2, 3], [5, 6, 7], [10, 11, 12],
                                   [15, 16, 17]])
     data_expanded = col.expand(data_condensed,
                                total_sites=8,
                                placeholder=-1)
     data_expanded_expected = numpy.array([[-1, -1, -1], [1, 2, 3],
                                           [-1, -1, -1], [5, 6, 7],
                                           [-1, -1, -1], [10, 11, 12],
                                           [15, 16, 17], [-1, -1, -1]])
     numpy.testing.assert_array_equal(data_expanded, data_expanded_expected)