dyff-schema 0.4.0__tar.gz → 0.5.0__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.

Files changed (55) hide show
  1. {dyff_schema-0.4.0/dyff_schema.egg-info → dyff_schema-0.5.0}/PKG-INFO +1 -1
  2. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/platform.py +110 -3
  3. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/requests.py +8 -2
  4. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/version.py +5 -5
  5. {dyff_schema-0.4.0 → dyff_schema-0.5.0/dyff_schema.egg-info}/PKG-INFO +1 -1
  6. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/.gitignore +0 -0
  7. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/.gitlab-ci.yml +0 -0
  8. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/.licenserc.yaml +0 -0
  9. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/.pre-commit-config.yaml +0 -0
  10. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/.prettierignore +0 -0
  11. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/.secrets.baseline +0 -0
  12. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/CODE_OF_CONDUCT.md +0 -0
  13. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/LICENSE +0 -0
  14. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/NOTICE +0 -0
  15. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/README.md +0 -0
  16. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/__init__.py +0 -0
  17. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/adapters.py +0 -0
  18. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/base.py +0 -0
  19. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/copydoc.py +0 -0
  20. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/dataset/__init__.py +0 -0
  21. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/dataset/arrow.py +0 -0
  22. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/dataset/binary.py +0 -0
  23. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/dataset/classification.py +0 -0
  24. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/dataset/text.py +0 -0
  25. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/dataset/vision.py +0 -0
  26. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/ids.py +0 -0
  27. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/io/__init__.py +0 -0
  28. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/io/vllm.py +0 -0
  29. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/platform.py +0 -0
  30. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/py.typed +0 -0
  31. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/quantity.py +0 -0
  32. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/requests.py +0 -0
  33. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/test.py +0 -0
  34. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/__init__.py +0 -0
  35. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/__init__.py +0 -0
  36. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/adapters.py +0 -0
  37. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/base.py +0 -0
  38. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/dataset/__init__.py +0 -0
  39. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/dataset/arrow.py +0 -0
  40. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/dataset/binary.py +0 -0
  41. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/dataset/classification.py +0 -0
  42. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/dataset/text.py +0 -0
  43. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/dataset/vision.py +0 -0
  44. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/io/__init__.py +0 -0
  45. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/io/vllm.py +0 -0
  46. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/v0/r1/test.py +0 -0
  47. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff/schema/version.py +0 -0
  48. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff_schema.egg-info/SOURCES.txt +0 -0
  49. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff_schema.egg-info/dependency_links.txt +0 -0
  50. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff_schema.egg-info/requires.txt +0 -0
  51. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/dyff_schema.egg-info/top_level.txt +0 -0
  52. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/makefile +0 -0
  53. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/pyproject.toml +0 -0
  54. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/setup.cfg +0 -0
  55. {dyff_schema-0.4.0 → dyff_schema-0.5.0}/tests/test_import.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dyff-schema
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Data models for the Dyff AI auditing platform.
5
5
  Author-email: Digital Safety Research Institute <contact@dsri.org>
6
6
  License: Apache-2.0
@@ -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 VERSION, Versioned
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 DyffEntity(Status, Labeled, Versioned, DyffModelWithID):
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=VERSION, description="The dyff schema version"
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",
@@ -30,11 +30,12 @@ from .platform import (
30
30
  ModelSpec,
31
31
  ModuleBase,
32
32
  ReportBase,
33
+ TagBase,
33
34
  )
34
- from .version import Versioned
35
+ from .version import SchemaVersion
35
36
 
36
37
 
37
- class DyffEntityCreateRequest(Versioned, DyffSchemaBaseModel):
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
  ]
@@ -5,16 +5,16 @@ from typing import Literal
5
5
 
6
6
  import pydantic
7
7
 
8
- VERSION: str = "0.1"
8
+ SCHEMA_VERSION: str = "0.1"
9
9
 
10
10
 
11
- class Versioned(pydantic.BaseModel):
11
+ class SchemaVersion(pydantic.BaseModel):
12
12
  schemaVersion: Literal["0.1"] = pydantic.Field(
13
- default=VERSION, description="The schema version."
13
+ default=SCHEMA_VERSION, description="The schema version."
14
14
  )
15
15
 
16
16
 
17
17
  __all__ = [
18
- "VERSION",
19
- "Versioned",
18
+ "SCHEMA_VERSION",
19
+ "SchemaVersion",
20
20
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dyff-schema
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Data models for the Dyff AI auditing platform.
5
5
  Author-email: Digital Safety Research Institute <contact@dsri.org>
6
6
  License: Apache-2.0
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