Repository: dwavesystems/dimod

Issue:
numpy FutureWarning
FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.
  samples_matrix = samples_df.as_matrix(columns=variable_labels)

Discussion:

Patch:
diff --git a/dimod/response.py b/dimod/response.py
index 1378ed70..89891418 100644
--- a/dimod/response.py
+++ b/dimod/response.py
@@ -230,7 +230,7 @@ class Response(Iterable, Sized):
             True
 
         """
-        return all(future.done() for future in self._futures)
+        return all(future.done() for future in self._futures.get('futures', tuple()))
 
     ##############################################################################################
     # Construction and updates
@@ -421,7 +421,7 @@ class Response(Iterable, Sized):
         import pandas as pd
 
         variable_labels = list(samples_df.columns)
-        samples_matrix = samples_df.as_matrix(columns=variable_labels)
+        samples_matrix = np.matrix(samples_df.values)
 
         if isinstance(data_vectors, pd.DataFrame):
             raise NotImplementedError("support for DataFrame data_vectors is forthcoming")
@@ -559,7 +559,7 @@ class Response(Iterable, Sized):
         response = cls.empty(vartype)
 
         # now dump all of the remaining information into the _futures
-        response._futures = {'futures': futures,
+        response._futures = {'futures': list(futures),
                              'samples_key': samples_key,
                              'data_vector_keys': data_vector_keys,
                              'info_keys': info_keys,


Test patch:
diff --git a/tests/test_response.py b/tests/test_response.py
index bd18948e..c3c0ddf3 100644
--- a/tests/test_response.py
+++ b/tests/test_response.py
@@ -301,6 +301,8 @@ class TestResponse(unittest.TestCase):
 
         response = dimod.Response.from_futures(_futures(), vartype=dimod.SPIN, num_variables=3)
 
+        self.assertTrue(response.done())
+
         matrix = response.samples_matrix
 
         npt.assert_equal(matrix, np.matrix([[-1, -1, 1], [-1, -1, 1]]))