dyff-schema 0.4.0__py3-none-any.whl → 0.5.0__py3-none-any.whl
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/v0/r1/platform.py +110 -3
- dyff/schema/v0/r1/requests.py +8 -2
- dyff/schema/v0/r1/version.py +5 -5
- {dyff_schema-0.4.0.dist-info → dyff_schema-0.5.0.dist-info}/METADATA +1 -1
- {dyff_schema-0.4.0.dist-info → dyff_schema-0.5.0.dist-info}/RECORD +9 -9
- {dyff_schema-0.4.0.dist-info → dyff_schema-0.5.0.dist-info}/LICENSE +0 -0
- {dyff_schema-0.4.0.dist-info → dyff_schema-0.5.0.dist-info}/NOTICE +0 -0
- {dyff_schema-0.4.0.dist-info → dyff_schema-0.5.0.dist-info}/WHEEL +0 -0
- {dyff_schema-0.4.0.dist-info → dyff_schema-0.5.0.dist-info}/top_level.txt +0 -0
dyff/schema/v0/r1/platform.py
CHANGED
|
@@ -30,7 +30,7 @@ from ... import named_data_schema, product_schema
|
|
|
30
30
|
from ...version import SomeSchemaVersion
|
|
31
31
|
from .base import DyffSchemaBaseModel
|
|
32
32
|
from .dataset import arrow, make_item_type, make_response_type
|
|
33
|
-
from .version import
|
|
33
|
+
from .version import SCHEMA_VERSION, SchemaVersion
|
|
34
34
|
|
|
35
35
|
SYSTEM_ATTRIBUTES = frozenset(["creationTime", "status", "reason"])
|
|
36
36
|
|
|
@@ -149,6 +149,7 @@ class Entities(str, enum.Enum):
|
|
|
149
149
|
DataSource = "DataSource"
|
|
150
150
|
Dataset = "Dataset"
|
|
151
151
|
Evaluation = "Evaluation"
|
|
152
|
+
Family = "Family"
|
|
152
153
|
InferenceService = "InferenceService"
|
|
153
154
|
InferenceSession = "InferenceSession"
|
|
154
155
|
Measurement = "Measurement"
|
|
@@ -157,6 +158,7 @@ class Entities(str, enum.Enum):
|
|
|
157
158
|
Module = "Module"
|
|
158
159
|
Report = "Report"
|
|
159
160
|
SafetyCase = "SafetyCase"
|
|
161
|
+
Tag = "Tag"
|
|
160
162
|
|
|
161
163
|
|
|
162
164
|
class Resources(str, enum.Enum):
|
|
@@ -168,6 +170,7 @@ class Resources(str, enum.Enum):
|
|
|
168
170
|
Dataset = "datasets"
|
|
169
171
|
DataSource = "datasources"
|
|
170
172
|
Evaluation = "evaluations"
|
|
173
|
+
Family = "families"
|
|
171
174
|
InferenceService = "inferenceservices"
|
|
172
175
|
InferenceSession = "inferencesessions"
|
|
173
176
|
Measurement = "measurements"
|
|
@@ -176,6 +179,7 @@ class Resources(str, enum.Enum):
|
|
|
176
179
|
Module = "modules"
|
|
177
180
|
Report = "reports"
|
|
178
181
|
SafetyCase = "safetycases"
|
|
182
|
+
Tag = "tags"
|
|
179
183
|
|
|
180
184
|
Task = "tasks"
|
|
181
185
|
"""
|
|
@@ -294,7 +298,96 @@ class Status(DyffSchemaBaseModel):
|
|
|
294
298
|
)
|
|
295
299
|
|
|
296
300
|
|
|
297
|
-
class
|
|
301
|
+
class Documentation(DyffSchemaBaseModel):
|
|
302
|
+
title: Optional[str] = pydantic.Field(
|
|
303
|
+
default=None,
|
|
304
|
+
description='A short plain string suitable as a title or "headline".',
|
|
305
|
+
)
|
|
306
|
+
|
|
307
|
+
summary: Optional[str] = pydantic.Field(
|
|
308
|
+
default=None,
|
|
309
|
+
description="A brief summary, suitable for display in"
|
|
310
|
+
" small UI elements. Interpreted as Markdown. Excessively long"
|
|
311
|
+
" summaries may be truncated in the UI, especially on small displays.",
|
|
312
|
+
)
|
|
313
|
+
|
|
314
|
+
fullPage: Optional[str] = pydantic.Field(
|
|
315
|
+
default=None,
|
|
316
|
+
description="Long-form documentation. Interpreted as"
|
|
317
|
+
" Markdown. There are no length constraints, but be reasonable.",
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
class Documented(DyffSchemaBaseModel):
|
|
322
|
+
documentation: Documentation = pydantic.Field(
|
|
323
|
+
default_factory=Documentation,
|
|
324
|
+
description="Documentation of the resource. The content is used to"
|
|
325
|
+
" populate various views in the web UI.",
|
|
326
|
+
)
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
class FamilyMemberKind(str, enum.Enum):
|
|
330
|
+
"""The kinds of entities that can be members of a Family.
|
|
331
|
+
|
|
332
|
+
These are resources for which it makes sense to have different versions or variants
|
|
333
|
+
that evolve over time.
|
|
334
|
+
"""
|
|
335
|
+
|
|
336
|
+
Dataset = "Dataset"
|
|
337
|
+
InferenceService = "InferenceService"
|
|
338
|
+
Method = "Method"
|
|
339
|
+
Model = "Model"
|
|
340
|
+
Module = "Module"
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
class FamilyMember(DyffSchemaBaseModel):
|
|
344
|
+
family: Optional[str] = pydantic.Field(
|
|
345
|
+
default=None,
|
|
346
|
+
description="ID of the Family to which the resource belongs.",
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
class TagBase(DyffSchemaBaseModel):
|
|
351
|
+
tag: str = pydantic.Field(
|
|
352
|
+
description="An interpretable identifier for the tag that is unique in"
|
|
353
|
+
" the context of the corresponding Family."
|
|
354
|
+
)
|
|
355
|
+
|
|
356
|
+
resource: str = pydantic.Field(
|
|
357
|
+
description="ID of the resource this tag references.",
|
|
358
|
+
)
|
|
359
|
+
|
|
360
|
+
description: str = pydantic.Field(
|
|
361
|
+
description="A short description of the tag. Interpreted as Markdown."
|
|
362
|
+
" This should include information about how the tagged version is"
|
|
363
|
+
" different from other versions."
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
class Tag(TagBase):
|
|
368
|
+
created: datetime = pydantic.Field(description="Tag creation time.")
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
class Family(Labeled, SchemaVersion, DyffModelWithID):
|
|
372
|
+
kind: Literal["Family"] = "Family"
|
|
373
|
+
|
|
374
|
+
resourceKind: FamilyMemberKind = pydantic.Field(
|
|
375
|
+
description="The kind of resource that comprises the family.",
|
|
376
|
+
)
|
|
377
|
+
|
|
378
|
+
tags: list[Tag] = pydantic.Field(
|
|
379
|
+
default_factory=list,
|
|
380
|
+
description="Tags mapping interpretable names to resource IDs.",
|
|
381
|
+
)
|
|
382
|
+
|
|
383
|
+
documentation: Documentation = pydantic.Field(
|
|
384
|
+
default_factory=Documentation,
|
|
385
|
+
description="Documentation of the resource family. The content is used"
|
|
386
|
+
" to populate various views in the web UI.",
|
|
387
|
+
)
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
class DyffEntity(Status, Labeled, SchemaVersion, DyffModelWithID):
|
|
298
391
|
kind: Literal[
|
|
299
392
|
"Analysis",
|
|
300
393
|
"Audit",
|
|
@@ -373,6 +466,9 @@ class APIFunctions(str, enum.Enum):
|
|
|
373
466
|
query = "query"
|
|
374
467
|
"""Query the resource collection."""
|
|
375
468
|
|
|
469
|
+
edit = "edit"
|
|
470
|
+
"""Edit properties of existing resources."""
|
|
471
|
+
|
|
376
472
|
download = "download"
|
|
377
473
|
"""
|
|
378
474
|
.. deprecated:: 0.5.0
|
|
@@ -578,7 +674,7 @@ class DyffDataSchema(DyffSchemaBaseModel):
|
|
|
578
674
|
" the composition of these component schemas.",
|
|
579
675
|
)
|
|
580
676
|
schemaVersion: SomeSchemaVersion = pydantic.Field(
|
|
581
|
-
default=
|
|
677
|
+
default=SCHEMA_VERSION, description="The dyff schema version"
|
|
582
678
|
)
|
|
583
679
|
|
|
584
680
|
def model_type(self) -> Type[DyffSchemaBaseModel]:
|
|
@@ -601,6 +697,12 @@ class DataSchema(DyffSchemaBaseModel):
|
|
|
601
697
|
default=None, description="The schema in JSON Schema format"
|
|
602
698
|
)
|
|
603
699
|
|
|
700
|
+
@staticmethod
|
|
701
|
+
def from_model(model: Type[DyffSchemaBaseModel]) -> "DataSchema":
|
|
702
|
+
arrowSchema = arrow.encode_schema(arrow.arrow_schema(model))
|
|
703
|
+
jsonSchema = model.schema()
|
|
704
|
+
return DataSchema(arrowSchema=arrowSchema, jsonSchema=jsonSchema)
|
|
705
|
+
|
|
604
706
|
@staticmethod
|
|
605
707
|
def make_input_schema(
|
|
606
708
|
schema: Union[pyarrow.Schema, Type[DyffSchemaBaseModel], DyffDataSchema],
|
|
@@ -1746,6 +1848,9 @@ __all__ = [
|
|
|
1746
1848
|
"Evaluation",
|
|
1747
1849
|
"EvaluationBase",
|
|
1748
1850
|
"ExtractorStep",
|
|
1851
|
+
"Family",
|
|
1852
|
+
"FamilyMember",
|
|
1853
|
+
"FamilyMemberKind",
|
|
1749
1854
|
"ForeignInferenceService",
|
|
1750
1855
|
"ForeignMethod",
|
|
1751
1856
|
"ForeignModel",
|
|
@@ -1807,6 +1912,8 @@ __all__ = [
|
|
|
1807
1912
|
"SchemaAdapter",
|
|
1808
1913
|
"Status",
|
|
1809
1914
|
"StorageSignedURL",
|
|
1915
|
+
"Tag",
|
|
1916
|
+
"TagBase",
|
|
1810
1917
|
"TaskSchema",
|
|
1811
1918
|
"entity_class",
|
|
1812
1919
|
"JobStatus",
|
dyff/schema/v0/r1/requests.py
CHANGED
|
@@ -30,11 +30,12 @@ from .platform import (
|
|
|
30
30
|
ModelSpec,
|
|
31
31
|
ModuleBase,
|
|
32
32
|
ReportBase,
|
|
33
|
+
TagBase,
|
|
33
34
|
)
|
|
34
|
-
from .version import
|
|
35
|
+
from .version import SchemaVersion
|
|
35
36
|
|
|
36
37
|
|
|
37
|
-
class DyffEntityCreateRequest(
|
|
38
|
+
class DyffEntityCreateRequest(SchemaVersion, DyffSchemaBaseModel):
|
|
38
39
|
account: str = pydantic.Field(description="Account that owns the entity")
|
|
39
40
|
|
|
40
41
|
|
|
@@ -105,6 +106,10 @@ class ReportCreateRequest(DyffEntityCreateRequest, ReportBase):
|
|
|
105
106
|
)
|
|
106
107
|
|
|
107
108
|
|
|
109
|
+
class TagCreateRequest(TagBase):
|
|
110
|
+
pass
|
|
111
|
+
|
|
112
|
+
|
|
108
113
|
class LabelUpdateRequest(Labeled):
|
|
109
114
|
pass
|
|
110
115
|
|
|
@@ -229,4 +234,5 @@ __all__ = [
|
|
|
229
234
|
"ReportCreateRequest",
|
|
230
235
|
"ReportQueryRequest",
|
|
231
236
|
"SafetyCaseQueryRequest",
|
|
237
|
+
"TagCreateRequest",
|
|
232
238
|
]
|
dyff/schema/v0/r1/version.py
CHANGED
|
@@ -5,16 +5,16 @@ from typing import Literal
|
|
|
5
5
|
|
|
6
6
|
import pydantic
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
SCHEMA_VERSION: str = "0.1"
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
11
|
+
class SchemaVersion(pydantic.BaseModel):
|
|
12
12
|
schemaVersion: Literal["0.1"] = pydantic.Field(
|
|
13
|
-
default=
|
|
13
|
+
default=SCHEMA_VERSION, description="The schema version."
|
|
14
14
|
)
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
__all__ = [
|
|
18
|
-
"
|
|
19
|
-
"
|
|
18
|
+
"SCHEMA_VERSION",
|
|
19
|
+
"SchemaVersion",
|
|
20
20
|
]
|
|
@@ -21,10 +21,10 @@ dyff/schema/v0/__init__.py,sha256=L5y8UhRnojerPYHumsxQJRcHCNz8Hj9NM8b47mewMNs,92
|
|
|
21
21
|
dyff/schema/v0/r1/__init__.py,sha256=L5y8UhRnojerPYHumsxQJRcHCNz8Hj9NM8b47mewMNs,92
|
|
22
22
|
dyff/schema/v0/r1/adapters.py,sha256=2t2oxsnGfSEDKKDIEYw4qqLXMH7qlFIwPVuLyUmbsHs,23552
|
|
23
23
|
dyff/schema/v0/r1/base.py,sha256=g_wqh4OU_9ftMHovVxPtdeup4O5MZi422v3eZH99ZQI,17139
|
|
24
|
-
dyff/schema/v0/r1/platform.py,sha256=
|
|
25
|
-
dyff/schema/v0/r1/requests.py,sha256=
|
|
24
|
+
dyff/schema/v0/r1/platform.py,sha256=pqCqqXDRucfyag7IEyVGEqVMYM-xNfAq3BJXsJW2vSk,59912
|
|
25
|
+
dyff/schema/v0/r1/requests.py,sha256=jbFaSQtL78csEcaTDheKokAXMUBF31k4tM1-x4N19ig,7851
|
|
26
26
|
dyff/schema/v0/r1/test.py,sha256=X6dUyVd5svcPCI-PBMOAqEfK9jv3bRDvkQTJzwS96c0,10720
|
|
27
|
-
dyff/schema/v0/r1/version.py,sha256=
|
|
27
|
+
dyff/schema/v0/r1/version.py,sha256=isKAGuGxsdru8vDaYmI4YiZdJOu_wNxXK7u6QzD6FE4,392
|
|
28
28
|
dyff/schema/v0/r1/dataset/__init__.py,sha256=LbVlkO2asyGYBKk2z49xjJYTM-pu9y9e4eQDXgTDLnM,2553
|
|
29
29
|
dyff/schema/v0/r1/dataset/arrow.py,sha256=juJ3MbiCL54zn3dSmXVl4GBhfLJPk6Qvasb0epFZ4V0,12312
|
|
30
30
|
dyff/schema/v0/r1/dataset/binary.py,sha256=MLqj_O7iJvsDiom23jxR054seJaJntc0FTTkHuHYDJg,544
|
|
@@ -33,9 +33,9 @@ dyff/schema/v0/r1/dataset/text.py,sha256=nLIn91Zlt0tNdXUklSgjJ-kEDxoPX32ISLkiv2D
|
|
|
33
33
|
dyff/schema/v0/r1/dataset/vision.py,sha256=aIe0fbfM_g3DsrDTdg2K803YKLjZBpurM_VJcJFuZLc,369
|
|
34
34
|
dyff/schema/v0/r1/io/__init__.py,sha256=L5y8UhRnojerPYHumsxQJRcHCNz8Hj9NM8b47mewMNs,92
|
|
35
35
|
dyff/schema/v0/r1/io/vllm.py,sha256=CUE9y8KthtUI7sD49S875rDmPvKotSXVIRaBS79aBZs,5320
|
|
36
|
-
dyff_schema-0.
|
|
37
|
-
dyff_schema-0.
|
|
38
|
-
dyff_schema-0.
|
|
39
|
-
dyff_schema-0.
|
|
40
|
-
dyff_schema-0.
|
|
41
|
-
dyff_schema-0.
|
|
36
|
+
dyff_schema-0.5.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
37
|
+
dyff_schema-0.5.0.dist-info/METADATA,sha256=wubxswOJygm24kPJ6d0lYOYo4kNsHAqexU9JG7UvQ08,3459
|
|
38
|
+
dyff_schema-0.5.0.dist-info/NOTICE,sha256=YONACu0s_Ui6jNi-wtEsVQbTU1JIkh8wvLH6d1-Ni_w,43
|
|
39
|
+
dyff_schema-0.5.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
40
|
+
dyff_schema-0.5.0.dist-info/top_level.txt,sha256=9e3VVdeX73t_sUJOPQPCcGtYO1JhoErhHIi3WoWGcFI,5
|
|
41
|
+
dyff_schema-0.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|