Repository: biolab/orange3

Issue:
Unsure how to set metas
Hello,

I'm trying to create a data table from scratch, and I can't figure out how to add meta attributes to a table. This is what I have as a sample. I just want to able to replace the ? with a meta value.
![image](https://user-images.githubusercontent.com/50418145/60281252-2f49b780-98df-11e9-8bea-6b049c0131c2.png)



Discussion:
Methods that modify the table length are deprecated and will be removed in the future (#3501). I have to check why calling `append` did not give a deprecation warning. And I see that documentation still doesn't mention this.

Do it like this:

```
from Orange.data import Table, Domain, ContinuousVariable
import numpy as np

dom = Domain([ContinuousVariable("y")], metas=[ContinuousVariable("m")])
X = np.random.random((5, 1))
m = np.random.random((5, 1))
tab = Table(dom, X, None, metas=m)
```

Resolving patch:
diff --git a/Orange/data/table.py b/Orange/data/table.py
--- a/Orange/data/table.py
+++ b/Orange/data/table.py
@@ -12,6 +12,7 @@
 import numpy as np
 from scipy import sparse as sp
 
+from Orange.util import OrangeDeprecationWarning
 import Orange.data  # import for io.py
 from Orange.data import (
     _contingency, _valuecount,
@@ -47,7 +48,7 @@ def get_sample_datasets_dir():
 
 def pending_deprecation_resize(name):
     warnings.warn(f"Method Table.{name} will be removed in Orange 3.24",
-                  PendingDeprecationWarning)
+                  OrangeDeprecationWarning)
 
 
 class DomainTransformationError(Exception):
@@ -865,7 +866,11 @@ def __repr__(self):
         return s
 
     def clear(self):
-        """Remove all rows from the table."""
+        """
+        Remove all rows from the table.
+
+        This method is deprecated and will be removed in Orange 3.24.
+        """
         pending_deprecation_resize("clear()")
         if not self._check_all_dense():
             raise ValueError("Tables with sparse data cannot be cleared")
@@ -875,6 +880,8 @@ def append(self, instance):
         """
         Append a data instance to the table.
 
+        This method is deprecated and will be removed in Orange 3.24.
+
         :param instance: a data instance
         :type instance: Orange.data.Instance or a sequence of values
         """
@@ -885,6 +892,8 @@ def insert(self, row, instance):
         """
         Insert a data instance into the table.
 
+        This method is deprecated and will be removed in Orange 3.24.
+
         :param row: row index
         :type row: int
         :param instance: a data instance
@@ -924,6 +933,8 @@ def extend(self, instances):
         :obj:`~Orange.data.Instance` or a sequence of values (e.g. list,
         tuple, numpy.array).
 
+        This method is deprecated and will be removed in Orange 3.24.
+
         :param instances: additional instances
         :type instances: Orange.data.Table or a sequence of instances
         """


Test patch:
diff --git a/Orange/tests/test_table.py b/Orange/tests/test_table.py
--- a/Orange/tests/test_table.py
+++ b/Orange/tests/test_table.py
@@ -680,20 +680,6 @@ def test_concatenate(self):
         self.assertRaises(ValueError,
                           lambda: data.Table.concatenate((t1, t2), axis=5))
 
-        t3 = data.Table.concatenate((t1, t2))
-        self.assertEqual(t3.domain.attributes,
-                         t1.domain.attributes + t2.domain.attributes)
-        self.assertEqual(len(t3.domain.metas), 1)
-        self.assertEqual(t3.X.shape, (2, 2))
-        self.assertRaises(ValueError, lambda: data.Table.concatenate((t3, t1)))
-        self.assertRaises(ValueError, lambda: data.Table.concatenate((t3, t1), axis=0))
-
-        t4 = data.Table.concatenate((t3, t3), axis=0)
-        np.testing.assert_equal(t4.X, [[1, 3],
-                                       [2, 4],
-                                       [1, 3],
-                                       [2, 4]])
-
     def test_sparse_concatenate_rows(self):
         iris = Table("iris")
         iris.X = sp.csc_matrix(iris.X)