dyff-schema 0.3.5__tar.gz → 0.3.7__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.3.5/dyff_schema.egg-info → dyff-schema-0.3.7}/PKG-INFO +1 -1
  2. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/platform.py +58 -37
  3. {dyff-schema-0.3.5 → dyff-schema-0.3.7/dyff_schema.egg-info}/PKG-INFO +1 -1
  4. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/.gitignore +0 -0
  5. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/.gitlab-ci.yml +0 -0
  6. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/.licenserc.yaml +0 -0
  7. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/.pre-commit-config.yaml +0 -0
  8. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/.prettierignore +0 -0
  9. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/.secrets.baseline +0 -0
  10. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/CODE_OF_CONDUCT.md +0 -0
  11. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/LICENSE +0 -0
  12. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/NOTICE +0 -0
  13. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/README.md +0 -0
  14. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/__init__.py +0 -0
  15. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/adapters.py +0 -0
  16. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/base.py +0 -0
  17. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/copydoc.py +0 -0
  18. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/dataset/__init__.py +0 -0
  19. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/dataset/arrow.py +0 -0
  20. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/dataset/binary.py +0 -0
  21. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/dataset/classification.py +0 -0
  22. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/dataset/text.py +0 -0
  23. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/dataset/vision.py +0 -0
  24. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/ids.py +0 -0
  25. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/io/__init__.py +0 -0
  26. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/io/vllm.py +0 -0
  27. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/platform.py +0 -0
  28. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/py.typed +0 -0
  29. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/quantity.py +0 -0
  30. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/requests.py +0 -0
  31. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/test.py +0 -0
  32. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/__init__.py +0 -0
  33. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/__init__.py +0 -0
  34. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/adapters.py +0 -0
  35. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/base.py +0 -0
  36. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/dataset/__init__.py +0 -0
  37. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/dataset/arrow.py +0 -0
  38. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/dataset/binary.py +0 -0
  39. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/dataset/classification.py +0 -0
  40. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/dataset/text.py +0 -0
  41. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/dataset/vision.py +0 -0
  42. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/io/__init__.py +0 -0
  43. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/io/vllm.py +0 -0
  44. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/requests.py +0 -0
  45. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/test.py +0 -0
  46. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/v0/r1/version.py +0 -0
  47. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff/schema/version.py +0 -0
  48. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff_schema.egg-info/SOURCES.txt +0 -0
  49. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff_schema.egg-info/dependency_links.txt +0 -0
  50. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff_schema.egg-info/requires.txt +0 -0
  51. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/dyff_schema.egg-info/top_level.txt +0 -0
  52. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/makefile +0 -0
  53. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/pyproject.toml +0 -0
  54. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/setup.cfg +0 -0
  55. {dyff-schema-0.3.5 → dyff-schema-0.3.7}/tests/test_import.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dyff-schema
3
- Version: 0.3.5
3
+ Version: 0.3.7
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
@@ -1141,16 +1141,6 @@ class MeasurementSpec(DyffSchemaBaseModel):
1141
1141
  )
1142
1142
 
1143
1143
 
1144
- class Measurement(DyffEntity, MeasurementSpec, AnalysisOutputQueryFields):
1145
- kind: Literal["Measurement"] = Entities.Measurement.value
1146
-
1147
- def dependencies(self) -> list[str]:
1148
- return [self.analysis]
1149
-
1150
- def resource_allocation(self) -> Optional[ResourceAllocation]:
1151
- return None
1152
-
1153
-
1154
1144
  class SafetyCaseSpec(DyffSchemaBaseModel):
1155
1145
  name: str = pydantic.Field(description="Descriptive name of the SafetyCase.")
1156
1146
  description: Optional[str] = pydantic.Field(
@@ -1158,16 +1148,6 @@ class SafetyCaseSpec(DyffSchemaBaseModel):
1158
1148
  )
1159
1149
 
1160
1150
 
1161
- class SafetyCase(DyffEntity, SafetyCaseSpec, AnalysisOutputQueryFields):
1162
- kind: Literal["SafetyCase"] = Entities.SafetyCase.value
1163
-
1164
- def dependencies(self) -> list[str]:
1165
- return [self.analysis]
1166
-
1167
- def resource_allocation(self) -> Optional[ResourceAllocation]:
1168
- return None
1169
-
1170
-
1171
1151
  class MethodImplementationKind(str, enum.Enum):
1172
1152
  JupyterNotebook = "JupyterNotebook"
1173
1153
  PythonFunction = "PythonFunction"
@@ -1277,9 +1257,19 @@ class MethodOutput(DyffSchemaBaseModel):
1277
1257
  )
1278
1258
 
1279
1259
 
1260
+ class MethodScope(str, enum.Enum):
1261
+ InferenceService = Entities.InferenceService.value
1262
+ Evaluation = Entities.Evaluation.value
1263
+
1264
+
1280
1265
  class MethodBase(DyffSchemaBaseModel):
1281
1266
  name: str = pydantic.Field(description="Descriptive name of the Method.")
1282
1267
 
1268
+ scope: MethodScope = pydantic.Field(
1269
+ description="The scope of the Method. The Method produces outputs that"
1270
+ " are specific to one entity of the type specified in the .scope field."
1271
+ )
1272
+
1283
1273
  description: Optional[str] = pydantic.Field(
1284
1274
  default=None, description="Long-form description, interpreted as Markdown."
1285
1275
  )
@@ -1318,12 +1308,6 @@ class Method(DyffEntity, MethodBase):
1318
1308
  return None
1319
1309
 
1320
1310
 
1321
- AnalysisOutputType = Union[
1322
- Measurement,
1323
- SafetyCase,
1324
- ]
1325
-
1326
-
1327
1311
  class AnalysisInput(DyffSchemaBaseModel):
1328
1312
  keyword: str = pydantic.Field(
1329
1313
  description="The 'keyword' specified for this input in the MethodSpec."
@@ -1347,7 +1331,19 @@ class ForeignMethod(DyffModelWithID, MethodBase):
1347
1331
  pass
1348
1332
 
1349
1333
 
1334
+ class AnalysisScope(DyffSchemaBaseModel):
1335
+ dataset: Optional[str]
1336
+ inferenceService: Optional[str]
1337
+ evaluation: Optional[str]
1338
+ model: Optional[str]
1339
+
1340
+
1350
1341
  class AnalysisBase(DyffSchemaBaseModel):
1342
+ scope: AnalysisScope = pydantic.Field(
1343
+ description="The specific entities to which the analysis results apply."
1344
+ " At a minimum, the field corresponding to method.scope must be set."
1345
+ )
1346
+
1351
1347
  arguments: list[AnalysisArgument] = pydantic.Field(
1352
1348
  default_factory=list,
1353
1349
  description="Arguments to pass to the Method implementation.",
@@ -1358,13 +1354,15 @@ class AnalysisBase(DyffSchemaBaseModel):
1358
1354
  )
1359
1355
 
1360
1356
 
1361
- class Analysis(DyffEntity, AnalysisBase):
1362
- kind: Literal["Analysis"] = Entities.Analysis.value
1363
-
1357
+ class Analysis(AnalysisBase):
1364
1358
  method: ForeignMethod = pydantic.Field(
1365
1359
  description="The analysis Method to run.",
1366
1360
  )
1367
1361
 
1362
+
1363
+ class Measurement(DyffEntity, MeasurementSpec, Analysis):
1364
+ kind: Literal["Measurement"] = Entities.Measurement.value
1365
+
1368
1366
  def dependencies(self) -> list[str]:
1369
1367
  return [self.method.id] + [x.entity for x in self.inputs]
1370
1368
 
@@ -1372,11 +1370,35 @@ class Analysis(DyffEntity, AnalysisBase):
1372
1370
  return None
1373
1371
 
1374
1372
 
1375
- class AnalysisAndOutputs(DyffSchemaBaseModel):
1376
- analysis: Analysis = pydantic.Field(description="The Analysis entity")
1377
- outputs: list[AnalysisOutputType] = pydantic.Field(
1378
- description="Concrete outputs of the Analysis"
1379
- )
1373
+ class SafetyCase(DyffEntity, SafetyCaseSpec, Analysis):
1374
+ kind: Literal["SafetyCase"] = Entities.SafetyCase.value
1375
+
1376
+ def dependencies(self) -> list[str]:
1377
+ return [self.method.id] + [x.entity for x in self.inputs]
1378
+
1379
+ def resource_allocation(self) -> Optional[ResourceAllocation]:
1380
+ return None
1381
+
1382
+
1383
+ # class Analysis(DyffEntity, AnalysisBase):
1384
+ # kind: Literal["Analysis"] = Entities.Analysis.value
1385
+
1386
+ # method: ForeignMethod = pydantic.Field(
1387
+ # description="The analysis Method to run.",
1388
+ # )
1389
+
1390
+ # def dependencies(self) -> list[str]:
1391
+ # return [self.method.id] + [x.entity for x in self.inputs]
1392
+
1393
+ # def resource_allocation(self) -> Optional[ResourceAllocation]:
1394
+ # return None
1395
+
1396
+
1397
+ # class AnalysisAndOutputs(DyffSchemaBaseModel):
1398
+ # analysis: Analysis = pydantic.Field(description="The Analysis entity")
1399
+ # outputs: list[AnalysisOutputType] = pydantic.Field(
1400
+ # description="Concrete outputs of the Analysis"
1401
+ # )
1380
1402
 
1381
1403
 
1382
1404
  # ---------------------------------------------------------------------------
@@ -1642,7 +1664,6 @@ def entity_class(kind: Entities):
1642
1664
 
1643
1665
 
1644
1666
  DyffEntityType = Union[
1645
- Analysis,
1646
1667
  Audit,
1647
1668
  AuditProcedure,
1648
1669
  DataSource,
@@ -1664,12 +1685,10 @@ __all__ = [
1664
1685
  "AcceleratorGPU",
1665
1686
  "AccessGrant",
1666
1687
  "Analysis",
1667
- "AnalysisAndOutputs",
1668
1688
  "AnalysisArgument",
1669
1689
  "AnalysisBase",
1670
1690
  "AnalysisInput",
1671
1691
  "AnalysisOutputQueryFields",
1672
- "AnalysisOutputType",
1673
1692
  "Annotation",
1674
1693
  "APIFunctions",
1675
1694
  "APIKey",
@@ -1695,6 +1714,7 @@ __all__ = [
1695
1714
  "EvaluationBase",
1696
1715
  "ExtractorStep",
1697
1716
  "ForeignInferenceService",
1717
+ "ForeignMethod",
1698
1718
  "ForeignModel",
1699
1719
  "Frameworks",
1700
1720
  "InferenceInterface",
@@ -1728,6 +1748,7 @@ __all__ = [
1728
1748
  "MethodOutput",
1729
1749
  "MethodOutputKind",
1730
1750
  "MethodParameter",
1751
+ "MethodScope",
1731
1752
  "Model",
1732
1753
  "ModelArtifact",
1733
1754
  "ModelArtifactHuggingFaceCache",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dyff-schema
3
- Version: 0.3.5
3
+ Version: 0.3.7
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