Skip to content

Commit 6039f72

Browse files
authored
v4.0.1 Release. (#2982)
1 parent 8ade865 commit 6039f72

File tree

4 files changed

+154
-3
lines changed

4 files changed

+154
-3
lines changed

python/deeplake/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
import os
22
from typing import Callable, Any, Dict
33

4+
import numpy
5+
46
import deeplake
57
from ._deeplake import *
68
from ._deeplake import _deepcopy
79

8-
__version__ = "4.0.0"
10+
__version__ = "4.0.1"
911

1012
__all__ = [
1113
"__version__",
1214
"FutureVoid",
1315
"Future",
1416
"Tag",
17+
"TagView",
1518
"TagNotFoundError",
1619
"Tags",
20+
"TagsView",
1721
"ColumnDefinition",
1822
"ColumnDefinitionView",
1923
"ColumnView",
@@ -29,6 +33,7 @@
2933
"UnevenUpdateError",
3034
"ColumnMissingAppendValueError",
3135
"ColumnAlreadyExistsError",
36+
"ColumnDoesNotExistError",
3237
"InvalidColumnValueError",
3338
"GcsStorageProviderFailed",
3439
"History",

python/deeplake/__init__.pyi

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ __all__ = [
1111
"FutureVoid",
1212
"Future",
1313
"Tag",
14+
"TagView",
1415
"TagNotFoundError",
1516
"Tags",
17+
"TagsView",
1618
"ColumnDefinition",
1719
"ColumnDefinitionView",
1820
"ColumnView",
@@ -28,6 +30,7 @@ __all__ = [
2830
"UnevenUpdateError",
2931
"ColumnMissingAppendValueError",
3032
"ColumnAlreadyExistsError",
33+
"ColumnDoesNotExistError",
3134
"InvalidColumnValueError",
3235
"GcsStorageProviderFailed",
3336
"History",
@@ -321,8 +324,52 @@ class Tag:
321324
"""
322325
...
323326

327+
def open_async(self) -> Future:
328+
"""
329+
Asynchronously fetches the dataset corresponding to the tag and returns a Future object.
330+
"""
331+
...
332+
324333
def __repr__(self) -> str: ...
325334

335+
class TagView:
336+
"""
337+
Describes a read-only tag within the dataset.
338+
339+
Tags are created using [deeplake.Dataset.tag][].
340+
"""
341+
342+
@property
343+
def id(self) -> str:
344+
"""
345+
The unique identifier of the tag
346+
"""
347+
348+
@property
349+
def name(self) -> str:
350+
"""
351+
The name of the tag
352+
"""
353+
354+
@property
355+
def version(self) -> str:
356+
"""
357+
The version that has been tagged
358+
"""
359+
360+
def open(self) -> ReadOnlyDataset:
361+
"""
362+
Fetches the dataset corresponding to the tag
363+
"""
364+
...
365+
366+
def open_async(self) -> Future:
367+
"""
368+
Asynchronously fetches the dataset corresponding to the tag and returns a Future object.
369+
"""
370+
...
371+
372+
def __repr__(self) -> str: ...
326373

327374
class TagNotFoundError(Exception):
328375
pass
@@ -361,6 +408,34 @@ class Tags:
361408

362409
...
363410

411+
class TagsView:
412+
"""
413+
Provides access to the tags within a dataset.
414+
415+
It is returned by the [deeplake.Dataset.tags][] property on a [deeplake.ReadOnlyDataset][].
416+
"""
417+
418+
def __getitem__(self, name: str) -> TagView:
419+
"""
420+
Return a tag by name
421+
"""
422+
...
423+
424+
def __len__(self) -> int:
425+
"""
426+
The total number of tags in the dataset
427+
"""
428+
...
429+
430+
def __repr__(self) -> str: ...
431+
432+
def names(self) -> list[str]:
433+
"""
434+
Return a list of tag names
435+
"""
436+
437+
...
438+
364439

365440
class ColumnDefinition:
366441
def __repr__(self) -> str: ...
@@ -1329,9 +1404,9 @@ class ReadOnlyDataset(DatasetView):
13291404
def __repr__(self) -> str: ...
13301405

13311406
@property
1332-
def tags(self) -> Tags:
1407+
def tags(self) -> TagsView:
13331408
"""
1334-
The collection of [deeplake.Tags][] within the dataset
1409+
The collection of [deeplake.TagsView][] within the dataset
13351410
"""
13361411
...
13371412

@@ -1437,6 +1512,10 @@ class ColumnAlreadyExistsError(Exception):
14371512
pass
14381513

14391514

1515+
class ColumnDoesNotExistError(Exception):
1516+
pass
1517+
1518+
14401519
class InvalidColumnValueError(Exception):
14411520
pass
14421521

python/deeplake/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"BoundingBox",
2727
"BinaryMask",
2828
"SegmentMask",
29+
"TypeKind",
2930
"TextIndexType",
3031
"QuantizationType",
3132
"Binary",

python/deeplake/types.pyi

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ __all__ = [
2828
"BoundingBox",
2929
"BinaryMask",
3030
"SegmentMask",
31+
"TypeKind",
3132
"TextIndexType",
3233
"QuantizationType",
3334
"Binary",
@@ -144,6 +145,10 @@ class Type:
144145
def is_sequence(self) -> bool:
145146
...
146147

148+
@property
149+
def kind(self) -> TypeKind:
150+
...
151+
147152
@property
148153
def shape(self) -> list[int] | None:
149154
"""
@@ -152,6 +157,66 @@ class Type:
152157
...
153158

154159

160+
class TypeKind:
161+
"""
162+
Members:
163+
164+
Generic
165+
166+
Text
167+
168+
Dict
169+
170+
Embedding
171+
172+
Sequence
173+
174+
Image
175+
176+
BoundingBox
177+
178+
BinaryMask
179+
180+
SegmentMask
181+
"""
182+
BinaryMask: typing.ClassVar[TypeKind]
183+
BoundingBox: typing.ClassVar[TypeKind]
184+
Dict: typing.ClassVar[TypeKind]
185+
Embedding: typing.ClassVar[TypeKind]
186+
Generic: typing.ClassVar[TypeKind]
187+
Image: typing.ClassVar[TypeKind]
188+
SegmentMask: typing.ClassVar[TypeKind]
189+
Sequence: typing.ClassVar[TypeKind]
190+
Text: typing.ClassVar[TypeKind]
191+
__members__: typing.ClassVar[dict[str, TypeKind]]
192+
def __eq__(self, other: typing.Any) -> bool:
193+
...
194+
def __getstate__(self) -> int:
195+
...
196+
def __hash__(self) -> int:
197+
...
198+
def __index__(self) -> int:
199+
...
200+
def __init__(self, value: int) -> None:
201+
...
202+
def __int__(self) -> int:
203+
...
204+
def __ne__(self, other: typing.Any) -> bool:
205+
...
206+
def __repr__(self) -> str:
207+
...
208+
def __setstate__(self, state: int) -> None:
209+
...
210+
def __str__(self) -> str:
211+
...
212+
@property
213+
def name(self) -> str:
214+
...
215+
@property
216+
def value(self) -> int:
217+
...
218+
219+
155220
@typing.overload
156221
def Array(dtype: DataType | str, dimensions: int) -> DataType: ...
157222

@@ -250,6 +315,7 @@ def Embedding(size: int, dtype: DataType | str = "float32", quantization: Quanti
250315
size: The size of the embedding
251316
dtype: The datatype of the embedding. Defaults to float32
252317
quantization: How to compress the embeddings in the index. Default uses no compression, but can be set to [deeplake.types.QuantizationType.Binary][]
318+
253319
Examples:
254320
>>> ds.add_column("col1", types.Embedding(768))
255321
>>> ds.add_column("col2", types.Embedding(768, quantization=types.QuantizationType.Binary))

0 commit comments

Comments
 (0)