def test_works_with_hdf5_fibsem(self):
     train_dataset = get_train_dataset(h5py.File)
     dataset = train_dataset[0]
     origin = (105, 100, 100)
     numpy_dataset, expected_dataset = self.get_datasets(dataset, origin)
     for key in ['data', 'label', 'mask']:
         self.assertEqual(numpy_dataset[key].shape, expected_dataset[key].shape)
         np.testing.assert_almost_equal(
             numpy_dataset[key],
             expected_dataset[key],
             err_msg=str((key, "result", numpy_dataset[key], "desired", expected_dataset[key])),
         )
 def test_works_with_dvid(self):
     train_dataset = get_train_dataset(DVIDDataInstance)
     dataset = train_dataset[0]
     dataset['body_names_to_exclude'] = ['out']
     origin = (3000, 3000, 3000)
     numpy_dataset, expected_dataset = self.get_datasets(dataset, origin)
     for key in ['data', 'label', 'mask']:
         self.assertEqual(numpy_dataset[key].shape, expected_dataset[key].shape)
         np.testing.assert_almost_equal(
             numpy_dataset[key],
             expected_dataset[key],
             err_msg=str((key, "result", numpy_dataset[key], "desired", expected_dataset[key])),
         )
 def test_works_with_hdf5_fibsem(self):
     train_dataset = get_train_dataset(h5py.File)
     dataset = train_dataset[0]
     origin = (105, 100, 100)
     numpy_dataset, expected_dataset = self.get_datasets(dataset, origin)
     for key in ['data', 'label', 'mask']:
         self.assertEqual(numpy_dataset[key].shape,
                          expected_dataset[key].shape)
         np.testing.assert_almost_equal(
             numpy_dataset[key],
             expected_dataset[key],
             err_msg=str((key, "result", numpy_dataset[key], "desired",
                          expected_dataset[key])),
         )
 def test_works_with_dvid(self):
     train_dataset = get_train_dataset(DVIDDataInstance)
     dataset = train_dataset[0]
     dataset['body_names_to_exclude'] = ['out']
     origin = (3000, 3000, 3000)
     numpy_dataset, expected_dataset = self.get_datasets(dataset, origin)
     for key in ['data', 'label', 'mask']:
         self.assertEqual(numpy_dataset[key].shape,
                          expected_dataset[key].shape)
         np.testing.assert_almost_equal(
             numpy_dataset[key],
             expected_dataset[key],
             err_msg=str((key, "result", numpy_dataset[key], "desired",
                          expected_dataset[key])),
         )