예제 #1
0
 def test_flat_file_save_load_with_file_object(self):
     save_dnpy(self.output_path, self.larr0)
     with open(self.output_path, 'rb') as fp:
         larr1 = load_dnpy(comm=self.comm, file=fp)
     self.assertTrue(isinstance(larr1, LocalArray))
     assert_allclose(self.larr0, larr1)
예제 #2
0
 def _local_load_dnpy_names(comm, fnames):
     from distarray.localapi import load_dnpy
     fname = fnames[comm.Get_rank()]
     local_arr = load_dnpy(comm, fname)
     return proxyize(local_arr)
예제 #3
0
 def test_flat_file_save_load_with_filename(self):
     save_dnpy(self.output_path, self.larr0)
     larr1 = load_dnpy(comm=self.comm, file=self.output_path)
     self.assertTrue(isinstance(larr1, LocalArray))
     assert_allclose(self.larr0, larr1)
예제 #4
0
 def _local_load_dnpy(comm, fname_base):
     from distarray.localapi import load_dnpy
     fname = "%s_%s.dnpy" % (fname_base, comm.Get_rank())
     local_arr = load_dnpy(comm, fname)
     return proxyize(local_arr)
예제 #5
0
 def test_flat_file_save_load_with_file_object(self):
     save_dnpy(self.output_path, self.larr0)
     with open(self.output_path, 'rb') as fp:
         larr1 = load_dnpy(comm=self.comm, file=fp)
     self.assertTrue(isinstance(larr1, LocalArray))
     assert_allclose(self.larr0, larr1)
예제 #6
0
 def test_flat_file_save_load_with_filename(self):
     save_dnpy(self.output_path, self.larr0)
     larr1 = load_dnpy(comm=self.comm, file=self.output_path)
     self.assertTrue(isinstance(larr1, LocalArray))
     assert_allclose(self.larr0, larr1)
예제 #7
0
 def _local_load_dnpy_names(comm, fnames):
     from distarray.localapi import load_dnpy
     fname = fnames[comm.Get_rank()]
     local_arr = load_dnpy(comm, fname)
     return proxyize(local_arr)
예제 #8
0
 def _local_load_dnpy(comm, fname_base):
     from distarray.localapi import load_dnpy
     fname = "%s_%s.dnpy" % (fname_base, comm.Get_rank())
     local_arr = load_dnpy(comm, fname)
     return proxyize(local_arr)