dyff-schema 0.27.1__tar.gz → 0.27.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dyff-schema might be problematic. Click here for more details.
- {dyff_schema-0.27.1/dyff_schema.egg-info → dyff_schema-0.27.2}/PKG-INFO +1 -1
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/base.py +24 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/commands.py +7 -50
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/platform.py +32 -9
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/requests.py +9 -3
- {dyff_schema-0.27.1 → dyff_schema-0.27.2/dyff_schema.egg-info}/PKG-INFO +1 -1
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/.gitignore +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/.gitlab-ci.yml +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/.licenserc.yaml +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/.pre-commit-config.yaml +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/.prettierignore +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/.secrets.baseline +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/CODE_OF_CONDUCT.md +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/LICENSE +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/NOTICE +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/README.md +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/__init__.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/adapters.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/annotations.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/base.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/commands.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/copydoc.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/dataset/__init__.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/dataset/arrow.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/dataset/binary.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/dataset/classification.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/dataset/embedding.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/dataset/text.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/dataset/vision.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/errors.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/ids.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/io/__init__.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/io/vllm.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/platform.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/py.typed +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/quantity.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/requests.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/test.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/__init__.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/__init__.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/adapters.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/dataset/__init__.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/dataset/arrow.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/dataset/binary.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/dataset/classification.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/dataset/embedding.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/dataset/text.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/dataset/vision.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/io/__init__.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/io/vllm.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/test.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/v0/r1/version.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff/schema/version.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff_schema.egg-info/SOURCES.txt +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff_schema.egg-info/dependency_links.txt +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff_schema.egg-info/requires.txt +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/dyff_schema.egg-info/top_level.txt +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/makefile +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/pyproject.toml +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/setup.cfg +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/tests/test_adapters.py +0 -0
- {dyff_schema-0.27.1 → dyff_schema-0.27.2}/tests/test_import.py +0 -0
|
@@ -658,6 +658,29 @@ class DyffSchemaBaseModel(DyffBaseModel):
|
|
|
658
658
|
return values
|
|
659
659
|
|
|
660
660
|
|
|
661
|
+
class JsonMergePatchSemantics(DyffSchemaBaseModel):
|
|
662
|
+
"""Explicit None values will be output as json 'null', and fields that are not set
|
|
663
|
+
explicitly are not output.
|
|
664
|
+
|
|
665
|
+
In JSON Merge Patch terms, None means "delete this field", and not setting a value
|
|
666
|
+
means "leave this field unchanged".
|
|
667
|
+
"""
|
|
668
|
+
|
|
669
|
+
def dict(
|
|
670
|
+
self, *, by_alias: bool = True, exclude_unset=True, exclude_none=False, **kwargs
|
|
671
|
+
) -> _ModelAsDict:
|
|
672
|
+
return super().dict(
|
|
673
|
+
by_alias=by_alias, exclude_unset=True, exclude_none=False, **kwargs
|
|
674
|
+
)
|
|
675
|
+
|
|
676
|
+
def json(
|
|
677
|
+
self, *, by_alias: bool = True, exclude_unset=True, exclude_none=False, **kwargs
|
|
678
|
+
) -> str:
|
|
679
|
+
return super().json(
|
|
680
|
+
by_alias=by_alias, exclude_unset=True, exclude_none=False, **kwargs
|
|
681
|
+
)
|
|
682
|
+
|
|
683
|
+
|
|
661
684
|
__all__ = [
|
|
662
685
|
"DTYPE",
|
|
663
686
|
"DType",
|
|
@@ -671,6 +694,7 @@ __all__ = [
|
|
|
671
694
|
"Int16",
|
|
672
695
|
"Int32",
|
|
673
696
|
"Int64",
|
|
697
|
+
"JsonMergePatchSemantics",
|
|
674
698
|
"Null",
|
|
675
699
|
"UInt8",
|
|
676
700
|
"UInt16",
|
|
@@ -7,13 +7,14 @@ These are used internally by the platform and users typically won't encounter th
|
|
|
7
7
|
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
|
-
from typing import
|
|
10
|
+
from typing import Literal, Optional, Union
|
|
11
11
|
|
|
12
12
|
import pydantic
|
|
13
13
|
|
|
14
|
-
from .base import DyffSchemaBaseModel, Null
|
|
14
|
+
from .base import DyffSchemaBaseModel, JsonMergePatchSemantics, Null
|
|
15
15
|
from .platform import (
|
|
16
16
|
DyffEntityType,
|
|
17
|
+
EntityIdentifier,
|
|
17
18
|
EntityKindLiteral,
|
|
18
19
|
FamilyMember,
|
|
19
20
|
FamilyMembers,
|
|
@@ -29,33 +30,6 @@ from .platform import (
|
|
|
29
30
|
# ----------------------------------------------------------------------------
|
|
30
31
|
|
|
31
32
|
|
|
32
|
-
# mypy gets confused because 'dict' is the name of a method in DyffBaseModel
|
|
33
|
-
_ModelAsDict = dict[str, Any]
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class _JsonMergePatchSemantics(DyffSchemaBaseModel):
|
|
37
|
-
"""Explicit None values will be output as json 'null', and fields that are not set
|
|
38
|
-
explicitly are not output.
|
|
39
|
-
|
|
40
|
-
In JSON Merge Patch terms, None means "delete this field", and not setting a value
|
|
41
|
-
means "leave this field unchanged".
|
|
42
|
-
"""
|
|
43
|
-
|
|
44
|
-
def dict(
|
|
45
|
-
self, *, by_alias: bool = True, exclude_unset=True, exclude_none=False, **kwargs
|
|
46
|
-
) -> _ModelAsDict:
|
|
47
|
-
return super().dict(
|
|
48
|
-
by_alias=by_alias, exclude_unset=True, exclude_none=False, **kwargs
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
def json(
|
|
52
|
-
self, *, by_alias: bool = True, exclude_unset=True, exclude_none=False, **kwargs
|
|
53
|
-
) -> str:
|
|
54
|
-
return super().json(
|
|
55
|
-
by_alias=by_alias, exclude_unset=True, exclude_none=False, **kwargs
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
|
|
59
33
|
# class _NoneMeansUndefined(DyffSchemaBaseModel):
|
|
60
34
|
# """Fields with the value None will not be emitted in the JSON output."""
|
|
61
35
|
|
|
@@ -68,23 +42,6 @@ class _JsonMergePatchSemantics(DyffSchemaBaseModel):
|
|
|
68
42
|
# return super().json(exclude_none=True, **kwargs)
|
|
69
43
|
|
|
70
44
|
|
|
71
|
-
class EntityIdentifier(DyffSchemaBaseModel):
|
|
72
|
-
"""Identifies a single entity."""
|
|
73
|
-
|
|
74
|
-
@staticmethod
|
|
75
|
-
def of(entity: DyffEntityType) -> EntityIdentifier:
|
|
76
|
-
"""Create an identifier that identifies the given entity."""
|
|
77
|
-
return EntityIdentifier(kind=entity.kind, id=entity.id)
|
|
78
|
-
|
|
79
|
-
id: str = pydantic.Field(description="The .id of the entity.")
|
|
80
|
-
kind: Optional[EntityKindLiteral] = pydantic.Field(
|
|
81
|
-
default=None,
|
|
82
|
-
description="The .kind of the entity. This is optional because"
|
|
83
|
-
" sometimes you need to send a command without knowing the kind,"
|
|
84
|
-
" but it should be set whenever possible.",
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
|
|
88
45
|
class FamilyIdentifier(EntityIdentifier):
|
|
89
46
|
"""Identifies a single Family entity."""
|
|
90
47
|
|
|
@@ -123,7 +80,7 @@ class CreateEntity(Command):
|
|
|
123
80
|
# ----------------------------------------------------------------------------
|
|
124
81
|
|
|
125
82
|
|
|
126
|
-
class EditEntityDocumentationPatch(
|
|
83
|
+
class EditEntityDocumentationPatch(JsonMergePatchSemantics):
|
|
127
84
|
"""Same properties as DocumentationBase, but assigning None to a field is
|
|
128
85
|
interpreted as a command to delete that field.
|
|
129
86
|
|
|
@@ -186,7 +143,7 @@ class EditEntityDocumentation(Command):
|
|
|
186
143
|
# ----------------------------------------------------------------------------
|
|
187
144
|
|
|
188
145
|
|
|
189
|
-
class EditEntityLabelsAttributes(
|
|
146
|
+
class EditEntityLabelsAttributes(JsonMergePatchSemantics):
|
|
190
147
|
"""Attributes for the EditEntityLabels command."""
|
|
191
148
|
|
|
192
149
|
labels: dict[LabelKeyType, Optional[Union[LabelValueType, Null]]] = pydantic.Field(
|
|
@@ -220,7 +177,7 @@ class EditEntityLabels(Command):
|
|
|
220
177
|
# ----------------------------------------------------------------------------
|
|
221
178
|
|
|
222
179
|
|
|
223
|
-
class EditFamilyMembersAttributes(
|
|
180
|
+
class EditFamilyMembersAttributes(JsonMergePatchSemantics):
|
|
224
181
|
"""Attributes for the EditFamilyMembers command."""
|
|
225
182
|
|
|
226
183
|
members: dict[TagNameType, Optional[Union[FamilyMember, Null]]] = pydantic.Field(
|
|
@@ -262,7 +219,7 @@ class ForgetEntity(Command):
|
|
|
262
219
|
# ----------------------------------------------------------------------------
|
|
263
220
|
|
|
264
221
|
|
|
265
|
-
class UpdateEntityStatusAttributes(
|
|
222
|
+
class UpdateEntityStatusAttributes(JsonMergePatchSemantics):
|
|
266
223
|
"""Attributes for the UpdateEntityStatus command."""
|
|
267
224
|
|
|
268
225
|
status: str = pydantic.Field(
|
|
@@ -291,6 +291,23 @@ class DyffModelWithID(DyffSchemaBaseModel):
|
|
|
291
291
|
account: str = pydantic.Field(description="Account that owns the entity")
|
|
292
292
|
|
|
293
293
|
|
|
294
|
+
class EntityIdentifier(DyffSchemaBaseModel):
|
|
295
|
+
"""Identifies a single entity."""
|
|
296
|
+
|
|
297
|
+
@staticmethod
|
|
298
|
+
def of(entity: "DyffEntityType") -> "EntityIdentifier":
|
|
299
|
+
"""Create an identifier that identifies the given entity."""
|
|
300
|
+
return EntityIdentifier(kind=entity.kind, id=entity.id)
|
|
301
|
+
|
|
302
|
+
id: str = pydantic.Field(description="The .id of the entity.")
|
|
303
|
+
kind: Optional[EntityKindLiteral] = pydantic.Field(
|
|
304
|
+
default=None,
|
|
305
|
+
description="The .kind of the entity. This is optional because"
|
|
306
|
+
" sometimes you need to send a command without knowing the kind,"
|
|
307
|
+
" but it should be set whenever possible.",
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
|
|
294
311
|
def LabelKey() -> type[str]:
|
|
295
312
|
return pydantic.constr(
|
|
296
313
|
regex=_k8s_label_key_regex(), max_length=_k8s_label_key_maxlen()
|
|
@@ -682,24 +699,24 @@ class FamilyMemberKind(str, enum.Enum):
|
|
|
682
699
|
|
|
683
700
|
|
|
684
701
|
class FamilyMemberBase(DyffSchemaBaseModel):
|
|
685
|
-
|
|
686
|
-
description="An interpretable identifier for the member that is unique"
|
|
687
|
-
" in the context of the corresponding Family.",
|
|
688
|
-
)
|
|
689
|
-
|
|
690
|
-
resource: str = pydantic.Field(
|
|
702
|
+
entity: EntityIdentifier = pydantic.Field(
|
|
691
703
|
description="ID of the resource this member references.",
|
|
692
704
|
)
|
|
693
705
|
|
|
694
|
-
description: Optional[
|
|
706
|
+
description: Optional[pydantic.constr(max_length=summary_maxlen())] = pydantic.Field( # type: ignore
|
|
695
707
|
default=None,
|
|
696
|
-
description="A short description of the member.
|
|
697
|
-
" This should
|
|
708
|
+
description="A short description of the member."
|
|
709
|
+
" This should describe how this version of the resource"
|
|
698
710
|
" is different from other versions.",
|
|
699
711
|
)
|
|
700
712
|
|
|
701
713
|
|
|
702
714
|
class FamilyMember(FamilyMemberBase):
|
|
715
|
+
name: TagNameType = pydantic.Field(
|
|
716
|
+
description="An interpretable identifier for the member that is unique"
|
|
717
|
+
" in the context of the corresponding Family.",
|
|
718
|
+
)
|
|
719
|
+
|
|
703
720
|
family: str = pydantic.Field(
|
|
704
721
|
description="Identifier of the Family containing this tag."
|
|
705
722
|
)
|
|
@@ -725,6 +742,12 @@ class FamilyBase(DyffSchemaBaseModel):
|
|
|
725
742
|
class Family(DyffEntity, FamilyBase, FamilyMembers):
|
|
726
743
|
kind: Literal["Family"] = "Family"
|
|
727
744
|
|
|
745
|
+
def dependencies(self) -> list[str]:
|
|
746
|
+
return []
|
|
747
|
+
|
|
748
|
+
def resource_allocation(self) -> Optional[ResourceAllocation]:
|
|
749
|
+
return None
|
|
750
|
+
|
|
728
751
|
|
|
729
752
|
class RevisionMetadata(DyffSchemaBaseModel):
|
|
730
753
|
previousRevision: Optional[str] = pydantic.Field(
|
|
@@ -21,7 +21,7 @@ from typing import Any, Literal, Optional, Union
|
|
|
21
21
|
import pydantic
|
|
22
22
|
|
|
23
23
|
from . import commands
|
|
24
|
-
from .base import DyffBaseModel
|
|
24
|
+
from .base import DyffBaseModel, JsonMergePatchSemantics, Null
|
|
25
25
|
from .platform import (
|
|
26
26
|
AnalysisBase,
|
|
27
27
|
AnalysisScope,
|
|
@@ -31,12 +31,14 @@ from .platform import (
|
|
|
31
31
|
DocumentationBase,
|
|
32
32
|
EvaluationBase,
|
|
33
33
|
FamilyBase,
|
|
34
|
+
FamilyMemberBase,
|
|
34
35
|
InferenceServiceBase,
|
|
35
36
|
InferenceSessionBase,
|
|
36
37
|
MethodBase,
|
|
37
38
|
ModelSpec,
|
|
38
39
|
ModuleBase,
|
|
39
40
|
ReportBase,
|
|
41
|
+
TagNameType,
|
|
40
42
|
summary_maxlen,
|
|
41
43
|
title_maxlen,
|
|
42
44
|
)
|
|
@@ -242,8 +244,12 @@ class DocumentationEditRequest(
|
|
|
242
244
|
pass
|
|
243
245
|
|
|
244
246
|
|
|
245
|
-
class FamilyMembersEditRequest(DyffRequestBase,
|
|
246
|
-
|
|
247
|
+
class FamilyMembersEditRequest(DyffRequestBase, JsonMergePatchSemantics):
|
|
248
|
+
members: dict[TagNameType, Optional[Union[FamilyMemberBase, Null]]] = (
|
|
249
|
+
pydantic.Field(
|
|
250
|
+
description="Mapping of names to IDs of member resources.",
|
|
251
|
+
)
|
|
252
|
+
)
|
|
247
253
|
|
|
248
254
|
|
|
249
255
|
class LabelsEditRequest(DyffRequestBase, commands.EditEntityLabelsAttributes):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|