Skip to content

Commit 7885002

Browse files
committed
blosc2.concatenate() -> blosc2.concat() (former name has been removed)
1 parent 4904bc7 commit 7885002

3 files changed

Lines changed: 10 additions & 12 deletions

File tree

‎caterva2/client.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ def copy(self, dst):
528528
"""
529529
return self.client.copy(self.path, dst)
530530

531-
def concatenate(self, srcs, dst, axis):
531+
def concat(self, srcs, dst, axis):
532532
"""
533533
Concatenate the file with srcs along axis to a new location dst.
534534
@@ -558,11 +558,11 @@ def concatenate(self, srcs, dst, axis):
558558
>>> root.upload('root-example/dir2/ds-4d.b2nd', "b.b2nd")
559559
<Dataset: @personal/b.b2nd>
560560
>>> file = root['a.b2nd']
561-
>>> file.concatenate('@personal/b.b2nd', '@personal/c.b2nd', axis=0)
561+
>>> file.concat('@personal/b.b2nd', '@personal/c.b2nd', axis=0)
562562
PurePosixPath('@personal/c.b2nd')
563563
"""
564564
srcs = [srcs] if not isinstance(srcs, list) else srcs # assure that srcs is list
565-
return self.client.concatenate([self.path] + srcs, dst, axis)
565+
return self.client.concat([self.path] + srcs, dst, axis)
566566

567567
def stack(self, srcs, dst, axis):
568568
"""
@@ -1347,7 +1347,7 @@ def copy(self, src, dst):
13471347
)
13481348
return pathlib.PurePosixPath(result)
13491349

1350-
def concatenate(self, srcs, dst, axis):
1350+
def concat(self, srcs, dst, axis):
13511351
"""
13521352
Concatenate the srcs along axis to a new location dst.
13531353
@@ -1376,7 +1376,7 @@ def concatenate(self, srcs, dst, axis):
13761376
<Dataset: @personal/a.b2nd>
13771377
>>> root.upload('root-example/dir2/ds-4d.b2nd', "b.b2nd")
13781378
<Dataset: @personal/b.b2nd>
1379-
>>> client.concatenate(['@personal/a.b2nd', '@personal/b.b2nd'], '@personal/c.b2nd', axis=0)
1379+
>>> client.concat(['@personal/a.b2nd', '@personal/b.b2nd'], '@personal/c.b2nd', axis=0)
13801380
PurePosixPath('@personal/c.b2nd')
13811381
"""
13821382
urlbase, _ = _format_paths(self.urlbase)

‎caterva2/services/server.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ async def concat(
881881
"""
882882
abspaths, dest_abspath, destpath = concatstackhelper(payload, user)
883883
list_of_arrays = [blosc2.open(path) for path in abspaths]
884-
blosc2.concatenate(list_of_arrays, payload.axis, urlpath=str(dest_abspath), mode="w")
884+
blosc2.concat(list_of_arrays, payload.axis, urlpath=str(dest_abspath), mode="w")
885885
return str(destpath)
886886

887887

‎caterva2/tests/test_api.py‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,22 +222,20 @@ def test_concat(auth_client, fill_auth, examples_dir):
222222
# Test for File class
223223
file = myshared[copyname]
224224
resultname = "result.b2nd"
225-
finalpath = file.concatenate([newpath2, newpath3], f"{myshared.name}/{resultname}", axis=0)
225+
finalpath = file.concat([newpath2, newpath3], f"{myshared.name}/{resultname}", axis=0)
226226

227227
assert myshared[resultname].shape[0] == 3 * myshared[copyname].shape[0]
228228

229229
# Check the data
230230
fname = examples_dir / "ds-1d.b2nd"
231231
a = blosc2.open(fname)
232-
locres = np.concatenate([a[:], a[:], a[:]], axis=0)
232+
locres = np.concat([a[:], a[:], a[:]], axis=0)
233233
sfile = myshared[resultname]
234234
np.testing.assert_array_equal(sfile[:], locres)
235235

236236
# Test for Client class
237237
resultname = "result2.b2nd"
238-
finalpath = auth_client.concatenate(
239-
[newpath, newpath2, newpath3], f"{myshared.name}/{resultname}", axis=0
240-
)
238+
finalpath = auth_client.concat([newpath, newpath2, newpath3], f"{myshared.name}/{resultname}", axis=0)
241239

242240
assert myshared[resultname].shape[0] == 3 * myshared[copyname].shape[0]
243241

@@ -321,7 +319,7 @@ def test_append(auth_client, fields, fill_auth, examples_dir):
321319
# Check the data
322320
fname = examples_dir / fname
323321
a = blosc2.open(fname)
324-
b = np.concatenate([a[:], data])
322+
b = np.concat([a[:], data])
325323
return np.testing.assert_array_equal(sfile[:], b)
326324

327325

0 commit comments

Comments
 (0)