Skip to content

Commit cfd5e1c

Browse files
committed
v4.1.16 Release
1 parent c44d023 commit cfd5e1c

File tree

6 files changed

+106
-16
lines changed

6 files changed

+106
-16
lines changed

python/deeplake/__init__.py

+5-3
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.1.12"
19+
__version__ = "4.1.16"
2020

2121
__all__ = [
2222
"__version__",
@@ -27,7 +27,6 @@ def progress_bar(iterable, *args, **kwargs):
2727
"BadRequestError",
2828
"Branch",
2929
"BranchExistsError",
30-
"BranchHasChildrenError",
3130
"BranchNotFoundError",
3231
"BranchView",
3332
"Branches",
@@ -36,7 +35,6 @@ def progress_bar(iterable, *args, **kwargs):
3635
"CanNotCreateTensorWithProvidedCompressions",
3736
"CannotDeleteMainBranchError",
3837
"CannotRenameMainBranchError",
39-
"CannotTagUncommittedDatasetError",
4038
"Client",
4139
"Column",
4240
"ColumnAlreadyExistsError",
@@ -89,6 +87,8 @@ def progress_bar(iterable, *args, **kwargs):
8987
"NotLoggedInAgreementError",
9088
"PushError",
9189
"QuantizationType",
90+
"Random",
91+
"random",
9292
"ReadOnlyDataset",
9393
"ReadOnlyDatasetModificationError",
9494
"ReadOnlyMetadata",
@@ -152,6 +152,8 @@ def progress_bar(iterable, *args, **kwargs):
152152
"storage",
153153
"tql",
154154
"types",
155+
"TelemetryClient",
156+
"telemetry_client"
155157
]
156158

157159

python/deeplake/__init__.pyi

+53-10
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ __all__ = [
1515
"BadRequestError",
1616
"Branch",
1717
"BranchExistsError",
18-
"BranchHasChildrenError",
1918
"BranchNotFoundError",
2019
"BranchView",
2120
"Branches",
@@ -24,7 +23,6 @@ __all__ = [
2423
"CanNotCreateTensorWithProvidedCompressions",
2524
"CannotDeleteMainBranchError",
2625
"CannotRenameMainBranchError",
27-
"CannotTagUncommittedDatasetError",
2826
"Client",
2927
"Column",
3028
"ColumnAlreadyExistsError",
@@ -77,6 +75,8 @@ __all__ = [
7775
"NotLoggedInAgreementError",
7876
"PushError",
7977
"QuantizationType",
78+
"Random",
79+
"random",
8080
"ReadOnlyDataset",
8181
"ReadOnlyDatasetModificationError",
8282
"ReadOnlyMetadata",
@@ -140,6 +140,8 @@ __all__ = [
140140
"storage",
141141
"tql",
142142
"types",
143+
"TelemetryClient",
144+
"telemetry_client"
143145
]
144146

145147
class Future:
@@ -739,6 +741,14 @@ class Client:
739741
"""
740742
endpoint: str
741743

744+
class Random:
745+
"""
746+
A pseudorandom number generator class that allows for deterministic random number generation
747+
through seed control.
748+
"""
749+
750+
seed: int | None
751+
742752
class Branch:
743753
"""
744754
Describes a branch within the dataset.
@@ -2152,6 +2162,38 @@ class Dataset(DatasetView):
21522162
"""
21532163
...
21542164

2165+
def merge(self, branch_name: str, version: str | None = None) -> None:
2166+
"""
2167+
Merge the given branch into the current branch. If no version is given, the current version will be picked up.
2168+
2169+
Parameters:
2170+
name: The name of the branch
2171+
version: The version of the dataset
2172+
2173+
<!-- test-context
2174+
```python
2175+
import deeplake
2176+
```
2177+
-->
2178+
2179+
Examples:
2180+
```python
2181+
ds = deeplake.create("mem://merge_branch")
2182+
ds.add_column("c1", deeplake.types.Int64())
2183+
ds.append({"c1": [1, 2, 3]})
2184+
ds.commit()
2185+
2186+
b = ds.branch("Branch1")
2187+
branch_ds = b.open()
2188+
branch_ds.append({"c1": [4, 5, 6]})
2189+
branch_ds.commit()
2190+
2191+
ds.merge("Branch1")
2192+
print(len(ds))
2193+
```
2194+
"""
2195+
...
2196+
21552197
def tag(self, name: str, version: str | None = None) -> Tag:
21562198
"""
21572199
Tags a version of the dataset. If no version is given, the current version is tagged.
@@ -2879,18 +2921,12 @@ class BranchExistsError(Exception):
28792921
class BranchNotFoundError(Exception):
28802922
pass
28812923

2882-
class BranchHasChildrenError(Exception):
2883-
pass
2884-
28852924
class TagNotFoundError(Exception):
28862925
pass
28872926

28882927
class TagExistsError(Exception):
28892928
pass
28902929

2891-
class CannotTagUncommittedDatasetError(Exception):
2892-
pass
2893-
28942930
class PushError(Exception):
28952931
pass
28962932

@@ -3176,7 +3212,7 @@ def create(
31763212
```
31773213
31783214
Raises:
3179-
ValueError: if a dataset already exists at the given URL
3215+
LogExistsError: if a dataset already exists at the given URL
31803216
"""
31813217

31823218
def create_async(
@@ -3239,7 +3275,7 @@ def create_async(
32393275
```
32403276
32413277
Raises:
3242-
ValueError: if a dataset already exists at the given URL (will be raised when the future is awaited)
3278+
RuntimeError: if a dataset already exists at the given URL (will be raised when the future is awaited)
32433279
"""
32443280

32453281
def copy(
@@ -3661,3 +3697,10 @@ def from_coco(
36613697
"""
36623698

36633699
def __prepare_atfork() -> None: ...
3700+
3701+
class TelemetryClient:
3702+
"""
3703+
Client for logging deeplake messages to telemetry.
3704+
"""
3705+
endpoint: str
3706+
api_key: str

python/deeplake/storage.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from ._deeplake.types import *
22

3-
__all__ = ["Reader", "Writer"]
3+
__all__ = ["Reader", "Writer", "ResourceMeta"]

python/deeplake/storage.pyi

+24-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ Storage readers and writers - s3, gcs, azure, filesystem, etc.
33
"""
44

55
from __future__ import annotations
6+
import datetime
67
import deeplake._deeplake.core
78
import typing
89

9-
__all__ = ["Reader", "Writer"]
10+
__all__ = ["Reader", "Writer", "ResourceMeta"]
1011

1112
class Reader:
1213
def __getstate__(self) -> tuple: ...
@@ -15,7 +16,7 @@ class Reader:
1516
self, path: str, start_bytes: int | None = None, end_bytes: int | None = None
1617
) -> deeplake._deeplake.core.MemoryBuffer: ...
1718
def length(self, path: str) -> int: ...
18-
def list(self, path: str) -> list: ...
19+
def list(self, path: str) -> list[ResourceMeta]: ...
1920
def subdir(self, subpath: str) -> Reader: ...
2021
@property
2122
def original_path(self) -> str: ...
@@ -37,3 +38,24 @@ class Writer:
3738
def path(self) -> str: ...
3839
@property
3940
def token(self) -> str: ...
41+
42+
class ResourceMeta:
43+
__hash__: typing.ClassVar[None] = None
44+
def __eq__(self, other: ResourceMeta) -> bool:
45+
...
46+
def __lt__(self, other: ResourceMeta) -> bool:
47+
...
48+
def __repr__(self) -> str:
49+
...
50+
@property
51+
def etag(self) -> str:
52+
...
53+
@property
54+
def last_modified(self) -> datetime.datetime:
55+
...
56+
@property
57+
def path(self) -> str:
58+
...
59+
@property
60+
def size(self) -> int:
61+
...

python/deeplake/types.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"EmbeddingIndexEnumType",
2020
"EmbeddingsMatrixIndex",
2121
"EmbeddingsMatrixIndexType",
22+
"Float16",
2223
"Float32",
2324
"Float64",
2425
"Image",

python/deeplake/types.pyi

+22
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ __all__ = [
2121
"EmbeddingIndexEnumType",
2222
"EmbeddingsMatrixIndex",
2323
"EmbeddingsMatrixIndexType",
24+
"Float16",
2425
"Float32",
2526
"Float64",
2627
"Image",
@@ -643,6 +644,27 @@ def EmbeddingsMatrixIndex() -> EmbeddingsMatrixIndexType:
643644
"""
644645
...
645646

647+
def Float16() -> DataType:
648+
"""
649+
Creates a 16-bit (half) float value type.
650+
651+
Returns:
652+
DataType: A new 16-bit float data type.
653+
654+
<!--
655+
```python
656+
ds = deeplake.create("tmp://")
657+
```
658+
-->
659+
660+
Examples:
661+
Create a column with 16-bit float type:
662+
```python
663+
ds.add_column("col1", types.Float16)
664+
```
665+
"""
666+
...
667+
646668
def Float32() -> DataType:
647669
"""
648670
Creates a 32-bit float value type.

0 commit comments

Comments
 (0)