Repository: yasufumy/pipelib

Issue:
Shorten concatenate method
- [x] rename `Dataset.concatenate` to `Dataset.concat`

Discussion:

Patch:
diff --git a/README.md b/README.md
index 85f6fe6..6fda755 100644
--- a/README.md
+++ b/README.md
@@ -87,7 +87,7 @@ Concatenate datasets:
 
 ```py
 >>> other = Dataset(range(3)).map(lambda x: 1 + x ** 2)
->>> other.concatenate(data).take(5)
+>>> other.concat(data).take(5)
 [1, 2, 5, 0, 1]
 ```
 
diff --git a/examples/serialize_pipeline.py b/examples/serialize_pipeline.py
index bdaf1a5..9247d43 100644
--- a/examples/serialize_pipeline.py
+++ b/examples/serialize_pipeline.py
@@ -23,7 +23,7 @@ if __name__ == '__main__':
     en_test = TextDataset('test.en')
 
     # build vocabulary
-    token_to_index = build_vocab(en_train.concatenate(en_test).map(str.split).flat_map(lambda x: x))
+    token_to_index = build_vocab(en_train.concat(en_test).map(str.split).flat_map(lambda x: x))
 
     # process training data
     en_train = en_train.map(str.split).map(lambda x: [token_to_index[token] for token in x])
diff --git a/pipelib/core.py b/pipelib/core.py
index e93a646..b37a695 100644
--- a/pipelib/core.py
+++ b/pipelib/core.py
@@ -64,7 +64,7 @@ class Dataset:
             yield from zip(dataset, *others)
         return PipelinedDataset(self, f)
 
-    def concatenate(self, *others):
+    def concat(self, *others):
         assert all(isinstance(other, pipelib.Dataset) for other in others)
 
         def f(dataset):


Test patch:
diff --git a/tests/test_core.py b/tests/test_core.py
index d3165ba..a9cc5e1 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -106,11 +106,11 @@ class DatasetTestCase(TestCase):
 
         self.check_correct_pipelined_dataset(data, self.base)
 
-    def test_concatenate(self):
+    def test_concat(self):
         data1 = self.data.map(lambda x: x ** 2)
         data2 = self.data.map(lambda x: x / 2)
 
-        data = data1.concatenate(data2)
+        data = data1.concat(data2)
         expected = [x ** 2 for x in self.base] + [x / 2 for x in self.base]
 
         self.check_for_loop(data, expected)