Skip to content

Commit 80a6d8e

Browse files
committed
v4.2.14 Release.
1 parent 3f61ffc commit 80a6d8e

File tree

4 files changed

+65
-47
lines changed

4 files changed

+65
-47
lines changed

python/deeplake/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def progress_bar(iterable, *args, **kwargs):
1616
from deeplake.ingestion import from_coco
1717

1818

19-
__version__ = "4.2.12"
19+
__version__ = "4.2.14"
2020

2121
__all__ = [
2222
"__version__",
@@ -143,6 +143,7 @@ def progress_bar(iterable, *args, **kwargs):
143143
"create_async",
144144
"_create_global_cache",
145145
"delete",
146+
"delete_async",
146147
"disconnect",
147148
"exists",
148149
"explain_query",

python/deeplake/__init__.pyi

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ __all__ = [
131131
"create_async",
132132
"_create_global_cache",
133133
"delete",
134+
"delete_async",
134135
"disconnect",
135136
"exists",
136137
"explain_query",
@@ -2521,19 +2522,6 @@ class Dataset(DatasetView):
25212522
The history of the dataset.
25222523
"""
25232524

2524-
@property
2525-
def _reader(self) -> storage.Reader:
2526-
"""
2527-
A [reader][deeplake.storage.Reader] that can be used to directly access files from the dataset's storage.
2528-
2529-
Primarily used for debugging purposes.
2530-
"""
2531-
...
2532-
2533-
@property
2534-
def _datafiles(self) -> list[tuple[str, int]]:
2535-
...
2536-
25372525
@property
25382526
def id(self) -> str:
25392527
"""
@@ -2640,12 +2628,7 @@ class Dataset(DatasetView):
26402628
arg0 (dict): The pickled state used to restore the dataset.
26412629
"""
26422630

2643-
def add_column(
2644-
self,
2645-
name: str,
2646-
dtype: types.DataType | str | types.Type | type | typing.Callable,
2647-
default_value: typing.Any = None,
2648-
) -> None:
2631+
def add_column(self, name: str, dtype: typing.Any, default_value: typing.Any = None) -> None:
26492632
"""
26502633
Add a new column to the dataset.
26512634
@@ -3023,19 +3006,6 @@ class ReadOnlyDataset(DatasetView):
30233006
"""
30243007
...
30253008

3026-
@property
3027-
def _reader(self) -> storage.Reader:
3028-
"""
3029-
A [reader][deeplake.storage.Reader] that can be used to directly access files from the dataset's storage.
3030-
3031-
Primarily used for debugging purposes.
3032-
"""
3033-
...
3034-
3035-
@property
3036-
def _datafiles(self) -> list[tuple[str, int]]:
3037-
...
3038-
30393009
@property
30403010
def id(self) -> str:
30413011
"""
@@ -3447,7 +3417,7 @@ def create(
34473417
url: str,
34483418
creds: dict[str, str] | None = None,
34493419
token: str | None = None,
3450-
schema: dict[str, types.DataType | str | types.Type] | None = None,
3420+
schema: dict[str, typing.Any] | typing.Any | None = None,
34513421
) -> Dataset:
34523422
"""
34533423
Creates a new dataset at the given URL.
@@ -3527,7 +3497,7 @@ def create_async(
35273497
url: str,
35283498
creds: dict[str, str] | None = None,
35293499
token: str | None = None,
3530-
schema: dict[str, types.DataType | str | types.Type] | None = None,
3500+
schema: dict[str, typing.Any] | typing.Any | None = None,
35313501
) -> Future:
35323502
"""
35333503
Asynchronously creates a new dataset at the given URL.
@@ -3641,6 +3611,19 @@ def delete(
36413611
It's recommended to use this operation with caution.
36423612
"""
36433613

3614+
def delete_async(
3615+
url: str, creds: dict[str, str] | None = None, token: str | None = None
3616+
) -> FutureVoid:
3617+
"""
3618+
Asynchronously deletes an existing dataset.
3619+
3620+
!!! warning
3621+
This operation is irreversible. All data will be lost.
3622+
3623+
If concurrent processes are attempting to write to the dataset while it's being deleted, it may lead to data inconsistency.
3624+
It's recommended to use this operation with caution.
3625+
"""
3626+
36443627
def exists(
36453628
url: str, creds: dict[str, str] | None = None, token: str | None = None
36463629
) -> bool:

python/deeplake/types.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
__all__ = [
44
"Array",
5+
"Audio",
56
"BM25",
67
"Binary",
78
"BinaryMask",
@@ -15,8 +16,8 @@
1516
"Dict",
1617
"Embedding",
1718
"EmbeddingIndex",
18-
"EmbeddingIndexType",
1919
"EmbeddingIndexEnumType",
20+
"EmbeddingIndexType",
2021
"EmbeddingsMatrixIndex",
2122
"EmbeddingsMatrixIndexType",
2223
"Exact",
@@ -31,21 +32,22 @@
3132
"Int8",
3233
"Inverted",
3334
"Link",
34-
"Polygon",
35+
"Medical",
3536
"Point",
37+
"Polygon",
3638
"QuantizationType",
3739
"SegmentMask",
38-
"Medical",
3940
"Sequence",
4041
"Struct",
4142
"Text",
4243
"TextIndex",
43-
"TextIndexType",
4444
"TextIndexEnumType",
45+
"TextIndexType",
4546
"Type",
4647
"TypeKind",
4748
"UInt16",
4849
"UInt32",
4950
"UInt64",
5051
"UInt8"
5152
]
53+

python/deeplake/types.pyi

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ from __future__ import annotations
22

33
import typing
44

5-
__all__ = [
6-
"Array",
5+
__all__ = ["Array",
6+
"Audio",
77
"BM25",
88
"Binary",
99
"BinaryMask",
@@ -17,8 +17,8 @@ __all__ = [
1717
"Dict",
1818
"Embedding",
1919
"EmbeddingIndex",
20-
"EmbeddingIndexType",
2120
"EmbeddingIndexEnumType",
21+
"EmbeddingIndexType",
2222
"EmbeddingsMatrixIndex",
2323
"EmbeddingsMatrixIndexType",
2424
"Exact",
@@ -33,17 +33,17 @@ __all__ = [
3333
"Int8",
3434
"Inverted",
3535
"Link",
36-
"Polygon",
36+
"Medical",
3737
"Point",
38+
"Polygon",
3839
"QuantizationType",
3940
"SegmentMask",
40-
"Medical",
4141
"Sequence",
4242
"Struct",
4343
"Text",
4444
"TextIndex",
45-
"TextIndexType",
4645
"TextIndexEnumType",
46+
"TextIndexType",
4747
"Type",
4848
"TypeKind",
4949
"UInt16",
@@ -336,7 +336,7 @@ class TypeKind:
336336
Medical: Medical data type
337337
Link: Link data type
338338
"""
339-
339+
Audio: typing.ClassVar[TypeKind]
340340
BinaryMask: typing.ClassVar[TypeKind]
341341
BoundingBox: typing.ClassVar[TypeKind]
342342
ClassLabel: typing.ClassVar[TypeKind]
@@ -422,6 +422,38 @@ def Array(
422422
"""
423423
...
424424

425+
def Audio(dtype: DataType | str = "uint8", sample_compression: str = "mp3") -> Type:
426+
"""
427+
Creates an audio data type.
428+
429+
Parameters:
430+
dtype: DataType | str
431+
The datatype of the audio samples. Defaults to "uint8".
432+
sample_compression: str
433+
The compression format for the audio samples wav or mp3. Defaults to "mp3".
434+
435+
Returns:
436+
Type: A new audio data type.
437+
438+
<!--
439+
```python
440+
ds = deeplake.create("tmp://")
441+
```
442+
-->
443+
444+
Examples:
445+
Create an audio column with default settings:
446+
```python
447+
ds.add_column("col1", types.Audio())
448+
```
449+
450+
Create an audio column with specific sample compression:
451+
```python
452+
ds.add_column("col2", types.Audio(sample_compression="wav"))
453+
```
454+
"""
455+
...
456+
425457
def Bool() -> DataType:
426458
"""
427459
Creates a boolean value type.
@@ -1175,4 +1207,4 @@ def UInt8() -> DataType:
11751207
ds.add_column("col1", types.UInt16)
11761208
```
11771209
"""
1178-
...
1210+
...

0 commit comments

Comments
 (0)