dyff-schema 0.36.2__tar.gz → 0.36.4__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 (68) hide show
  1. {dyff_schema-0.36.2/dyff_schema.egg-info → dyff_schema-0.36.4}/PKG-INFO +1 -1
  2. dyff_schema-0.36.4/dyff/schema/_version.py +2 -0
  3. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/commands.py +3 -8
  4. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/platform.py +40 -2
  5. {dyff_schema-0.36.2 → dyff_schema-0.36.4/dyff_schema.egg-info}/PKG-INFO +1 -1
  6. dyff_schema-0.36.2/dyff/schema/_version.py +0 -2
  7. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/.gitignore +0 -0
  8. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/.gitlab-ci.yml +0 -0
  9. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/.idea/dyff-schema.iml +0 -0
  10. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/.licenserc.yaml +0 -0
  11. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/.pre-commit-config.yaml +0 -0
  12. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/.prettierignore +0 -0
  13. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/.secrets.baseline +0 -0
  14. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/CODE_OF_CONDUCT.md +0 -0
  15. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/LICENSE +0 -0
  16. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/NOTICE +0 -0
  17. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/README.md +0 -0
  18. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/__init__.py +0 -0
  19. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/adapters.py +0 -0
  20. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/annotations.py +0 -0
  21. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/base.py +0 -0
  22. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/commands.py +0 -0
  23. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/copydoc.py +0 -0
  24. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/dataset/__init__.py +0 -0
  25. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/dataset/arrow.py +0 -0
  26. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/dataset/binary.py +0 -0
  27. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/dataset/classification.py +0 -0
  28. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/dataset/embedding.py +0 -0
  29. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/dataset/text.py +0 -0
  30. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/dataset/vision.py +0 -0
  31. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/errors.py +0 -0
  32. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/ids.py +0 -0
  33. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/io/__init__.py +0 -0
  34. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/io/vllm.py +0 -0
  35. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/platform.py +0 -0
  36. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/py.typed +0 -0
  37. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/quantity.py +0 -0
  38. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/requests.py +0 -0
  39. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/responses.py +0 -0
  40. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/test.py +0 -0
  41. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/__init__.py +0 -0
  42. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/__init__.py +0 -0
  43. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/adapters.py +0 -0
  44. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/base.py +0 -0
  45. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/dataset/__init__.py +0 -0
  46. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/dataset/arrow.py +0 -0
  47. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/dataset/binary.py +0 -0
  48. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/dataset/classification.py +0 -0
  49. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/dataset/embedding.py +0 -0
  50. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/dataset/text.py +0 -0
  51. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/dataset/vision.py +0 -0
  52. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/io/__init__.py +0 -0
  53. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/io/vllm.py +0 -0
  54. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/oci.py +0 -0
  55. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/requests.py +0 -0
  56. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/responses.py +0 -0
  57. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/test.py +0 -0
  58. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/v0/r1/version.py +0 -0
  59. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff/schema/version.py +0 -0
  60. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff_schema.egg-info/SOURCES.txt +0 -0
  61. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff_schema.egg-info/dependency_links.txt +0 -0
  62. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff_schema.egg-info/requires.txt +0 -0
  63. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/dyff_schema.egg-info/top_level.txt +0 -0
  64. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/makefile +0 -0
  65. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/pyproject.toml +0 -0
  66. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/setup.cfg +0 -0
  67. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/tests/test_adapters.py +0 -0
  68. {dyff_schema-0.36.2 → dyff_schema-0.36.4}/tests/test_import.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dyff-schema
3
- Version: 0.36.2
3
+ Version: 0.36.4
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
@@ -0,0 +1,2 @@
1
+ __version__ = version = "0.36.4"
2
+ __version_tuple__ = version_tuple = (0, 36, 4)
@@ -147,13 +147,8 @@ class EditChallengeContentPatch(DyffSchemaBaseModel):
147
147
  )
148
148
 
149
149
 
150
- class EditChallengeContentAttributes(DyffSchemaBaseModel):
151
- """Attributes for the EditChallengePageContent command."""
152
-
153
- content: Optional[EditChallengeContentPatch] = pydantic.Field(
154
- default=None,
155
- description="Edits to make to the content of the main challenge page.",
156
- )
150
+ class EditChallengeContentAttributes(EditChallengeContentPatch):
151
+ """Attributes for the EditChallengeContent command."""
157
152
 
158
153
  tasks: Optional[dict[str, EditChallengeContentPatch]] = pydantic.Field(
159
154
  default=None, description="Edits to make to the content of the challenge tasks."
@@ -161,7 +156,7 @@ class EditChallengeContentAttributes(DyffSchemaBaseModel):
161
156
 
162
157
 
163
158
  class EditChallengeContentData(EntityIdentifier):
164
- """Payload data for the EditChallengePageContent command."""
159
+ """Payload data for the EditChallengeContent command."""
165
160
 
166
161
  attributes: EditChallengeContentAttributes = pydantic.Field(
167
162
  description="The command attributes"
@@ -25,7 +25,7 @@ import urllib.parse
25
25
  from datetime import datetime, timedelta, timezone
26
26
  from enum import Enum
27
27
  from pathlib import Path
28
- from typing import Any, Literal, NamedTuple, Optional, Type, Union
28
+ from typing import Any, Literal, NamedTuple, Optional, Type, TypeVar, Union
29
29
 
30
30
  import i18naddress
31
31
  import pyarrow
@@ -227,6 +227,13 @@ class Entities(str, enum.Enum):
227
227
  Team = "Team"
228
228
  UseCase = "UseCase"
229
229
 
230
+ @staticmethod
231
+ def for_type(t: type["DyffEntityT"]) -> "Entities":
232
+ try:
233
+ return Entities(t.__name__)
234
+ except ValueError:
235
+ raise ValueError(f"not a DyffEntity type: {t}")
236
+
230
237
 
231
238
  class Resources(str, enum.Enum):
232
239
  """The resource names corresponding to entities that have API endpoints."""
@@ -2393,7 +2400,7 @@ class TeamMember(DyffSchemaBaseModel):
2393
2400
 
2394
2401
 
2395
2402
  class GoogleI18nMailingAddress(DyffSchemaBaseModel):
2396
- """An international mailing address, in the schema used by Google's
2403
+ """An international mailing address, in the schema used by Google's main challenge page
2397
2404
  i18n address metadata repository
2398
2405
  (https://chromium-i18n.appspot.com/ssl-address) and as interpreted by the
2399
2406
  Python ``google-i18n-address`` package.
@@ -2945,6 +2952,8 @@ def entity_class(kind: Entities):
2945
2952
  return _ENTITY_CLASS[kind]
2946
2953
 
2947
2954
 
2955
+ # A Union type containing all Dyff top-level schema types, except the ones that
2956
+ # should not have Revisions generated for them when they change
2948
2957
  _DyffEntityTypeRevisable = Union[
2949
2958
  Audit,
2950
2959
  AuditProcedure,
@@ -3016,9 +3025,37 @@ class Revision(DyffEntity, RevisionMetadata):
3016
3025
  return None
3017
3026
 
3018
3027
 
3028
+ # A Union type containing all Dyff top-level schema types
3019
3029
  DyffEntityType = Union[_DyffEntityTypeRevisable, History, Revision]
3020
3030
 
3021
3031
 
3032
+ # A TypeVar that matches any Dyff top-level schema type
3033
+ DyffEntityT = TypeVar(
3034
+ "DyffEntityT",
3035
+ Audit,
3036
+ AuditProcedure,
3037
+ Challenge,
3038
+ DataSource,
3039
+ Dataset,
3040
+ Evaluation,
3041
+ Family,
3042
+ Hazard,
3043
+ History,
3044
+ InferenceService,
3045
+ InferenceSession,
3046
+ Measurement,
3047
+ Method,
3048
+ Model,
3049
+ Module,
3050
+ OCIArtifact,
3051
+ Report,
3052
+ Revision,
3053
+ SafetyCase,
3054
+ Team,
3055
+ UseCase,
3056
+ )
3057
+
3058
+
3022
3059
  __all__ = [
3023
3060
  "SYSTEM_ATTRIBUTES",
3024
3061
  "Accelerator",
@@ -3064,6 +3101,7 @@ __all__ = [
3064
3101
  "Documented",
3065
3102
  "DyffDataSchema",
3066
3103
  "DyffEntity",
3104
+ "DyffEntityT",
3067
3105
  "DyffEntityType",
3068
3106
  "DyffModelWithID",
3069
3107
  "DyffSchemaBaseModel",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dyff-schema
3
- Version: 0.36.2
3
+ Version: 0.36.4
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
@@ -1,2 +0,0 @@
1
- __version__ = version = "0.36.2"
2
- __version_tuple__ = version_tuple = (0, 36, 2)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes