dyff-schema 0.38.0__tar.gz → 0.38.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.38.0/dyff_schema.egg-info → dyff_schema-0.38.2}/PKG-INFO +1 -1
- dyff_schema-0.38.2/dyff/schema/_version.py +2 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/platform.py +77 -40
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/requests.py +1 -2
- {dyff_schema-0.38.0 → dyff_schema-0.38.2/dyff_schema.egg-info}/PKG-INFO +1 -1
- dyff_schema-0.38.0/dyff/schema/_version.py +0 -2
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/.gitignore +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/.gitlab-ci.yml +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/.idea/dyff-schema.iml +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/.licenserc.yaml +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/.pre-commit-config.yaml +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/.prettierignore +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/.secrets.baseline +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/CODE_OF_CONDUCT.md +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/LICENSE +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/NOTICE +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/README.md +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/__init__.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/adapters.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/annotations.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/base.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/commands.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/copydoc.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/dataset/__init__.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/dataset/arrow.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/dataset/binary.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/dataset/classification.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/dataset/embedding.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/dataset/text.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/dataset/vision.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/errors.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/ids.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/io/__init__.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/io/vllm.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/platform.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/py.typed +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/quantity.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/requests.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/responses.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/test.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/__init__.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/__init__.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/adapters.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/base.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/commands.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/dataset/__init__.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/dataset/arrow.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/dataset/binary.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/dataset/classification.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/dataset/embedding.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/dataset/text.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/dataset/vision.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/io/__init__.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/io/vllm.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/oci.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/responses.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/test.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/v0/r1/version.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff/schema/version.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff_schema.egg-info/SOURCES.txt +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff_schema.egg-info/dependency_links.txt +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff_schema.egg-info/requires.txt +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/dyff_schema.egg-info/top_level.txt +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/makefile +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/pyproject.toml +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/setup.cfg +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/tests/test_adapters.py +0 -0
- {dyff_schema-0.38.0 → dyff_schema-0.38.2}/tests/test_import.py +0 -0
|
@@ -1732,8 +1732,6 @@ class EvaluationRequestBase(EvaluationBase):
|
|
|
1732
1732
|
"""A description of how to run an InferenceService on a Dataset to obtain a set of
|
|
1733
1733
|
evaluation results."""
|
|
1734
1734
|
|
|
1735
|
-
kind: Literal["EvaluationRequest"] = "EvaluationRequest"
|
|
1736
|
-
|
|
1737
1735
|
inferenceSession: Optional[EvaluationInferenceSessionRequest] = pydantic.Field(
|
|
1738
1736
|
default=None,
|
|
1739
1737
|
description="Specification of the InferenceSession that will perform inference for the evaluation.",
|
|
@@ -2255,8 +2253,6 @@ class AnalysisBase(DyffSchemaBaseModel):
|
|
|
2255
2253
|
|
|
2256
2254
|
|
|
2257
2255
|
class AnalysisRequestBase(AnalysisBase):
|
|
2258
|
-
kind: Literal["AnalysisRequest"] = "AnalysisRequest"
|
|
2259
|
-
|
|
2260
2256
|
method: EntityIDField = pydantic.Field(description="Method ID")
|
|
2261
2257
|
|
|
2262
2258
|
|
|
@@ -2765,13 +2761,34 @@ class ChallengeSubmission(DyffEntity):
|
|
|
2765
2761
|
# ---------------------------------------------------------------------------
|
|
2766
2762
|
# Pipelines
|
|
2767
2763
|
|
|
2764
|
+
|
|
2765
|
+
class PipelineEvaluationRequest(EvaluationRequestBase):
|
|
2766
|
+
kind: Literal["PipelineEvaluationRequest"] = "PipelineEvaluationRequest"
|
|
2767
|
+
|
|
2768
|
+
|
|
2769
|
+
class PipelineMeasurementRequest(AnalysisRequestBase):
|
|
2770
|
+
kind: Literal["PipelineMeasurementRequest"] = "PipelineMeasurementRequest"
|
|
2771
|
+
|
|
2772
|
+
|
|
2773
|
+
class PipelineSafetyCaseRequest(AnalysisRequestBase):
|
|
2774
|
+
kind: Literal["PipelineSafetyCaseRequest"] = "PipelineSafetyCaseRequest"
|
|
2775
|
+
|
|
2776
|
+
|
|
2768
2777
|
PipelineNodeRequest: TypeAlias = Union[
|
|
2769
|
-
|
|
2770
|
-
|
|
2778
|
+
PipelineEvaluationRequest,
|
|
2779
|
+
PipelineMeasurementRequest,
|
|
2780
|
+
PipelineSafetyCaseRequest,
|
|
2771
2781
|
]
|
|
2772
2782
|
|
|
2773
2783
|
|
|
2774
2784
|
class PipelineNode(DyffSchemaBaseModel):
|
|
2785
|
+
"""A node in the graph that defines the pipeline.
|
|
2786
|
+
|
|
2787
|
+
Each node contains a Dyff API request that might depend on the outcome of other
|
|
2788
|
+
requests in the pipeline graph. When the pipeline runs, the requests are executed in
|
|
2789
|
+
an order that respects these dependencies.
|
|
2790
|
+
"""
|
|
2791
|
+
|
|
2775
2792
|
name: str = pydantic.Field(
|
|
2776
2793
|
description="The name of the node. Must be unique in the context of the pipeline."
|
|
2777
2794
|
)
|
|
@@ -2779,7 +2796,7 @@ class PipelineNode(DyffSchemaBaseModel):
|
|
|
2779
2796
|
request: PipelineNodeRequest = pydantic.Field( # type: ignore[valid-type]
|
|
2780
2797
|
discriminator="kind",
|
|
2781
2798
|
description="The request template that will be executed when this node"
|
|
2782
|
-
' executes. You can use the syntax
|
|
2799
|
+
' executes. You can use the syntax "$(node_name)" in request fields'
|
|
2783
2800
|
" that reference another entity to indicate that the request depends"
|
|
2784
2801
|
" on another node in the pipeline. The placeholder will be substituted"
|
|
2785
2802
|
" with the ID of the created entity once it is known. Dyff infers the"
|
|
@@ -2797,7 +2814,9 @@ class PipelineParameter(DyffSchemaBaseModel):
|
|
|
2797
2814
|
" parameter value. Should be a string like 'node_name.field1.field2'."
|
|
2798
2815
|
)
|
|
2799
2816
|
description: Optional[str] = pydantic.Field(
|
|
2800
|
-
default=None,
|
|
2817
|
+
default=None,
|
|
2818
|
+
description="A description of the argument.",
|
|
2819
|
+
max_length=summary_maxlen(),
|
|
2801
2820
|
)
|
|
2802
2821
|
|
|
2803
2822
|
|
|
@@ -2818,11 +2837,16 @@ class PipelineBase(DyffSchemaBaseModel):
|
|
|
2818
2837
|
class Pipeline(DyffEntity, PipelineBase):
|
|
2819
2838
|
"""A set of Dyff workflows that can be executed as a group.
|
|
2820
2839
|
|
|
2821
|
-
The pipeline
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
then create a SafetyCase from the evaluation output. This pipeline would
|
|
2840
|
+
The pipeline is a directed acyclic graph representing data dependencies
|
|
2841
|
+
between workflows. For example, a simple pipeline might run an Evaluation
|
|
2842
|
+
and then create a SafetyCase from the evaluation output. This pipeline would
|
|
2825
2843
|
have a graph structure like ``evaluation -> safetycase``.
|
|
2844
|
+
|
|
2845
|
+
Each node in the pipeline contains the specification of a Dyff API request.
|
|
2846
|
+
The request specifications may contain placeholders that reference other
|
|
2847
|
+
nodes in the pipeline graph. When the pipeline is run, the nodes execute
|
|
2848
|
+
in an order that respects their dependencies, and the placeholders are
|
|
2849
|
+
replaced with concrete values once they are known.
|
|
2826
2850
|
"""
|
|
2827
2851
|
|
|
2828
2852
|
kind: Literal["Pipeline"] = Entities.Pipeline.value
|
|
@@ -2859,6 +2883,12 @@ class PipelineRun(DyffEntity, PipelineRunBase):
|
|
|
2859
2883
|
return None
|
|
2860
2884
|
|
|
2861
2885
|
|
|
2886
|
+
class PipelineRunStatus(Status):
|
|
2887
|
+
nodes: dict[str, Status] = pydantic.Field(
|
|
2888
|
+
default_factory=dict, description="The status of each pipeline node."
|
|
2889
|
+
)
|
|
2890
|
+
|
|
2891
|
+
|
|
2862
2892
|
# ---------------------------------------------------------------------------
|
|
2863
2893
|
# Status enumerations
|
|
2864
2894
|
|
|
@@ -3099,34 +3129,6 @@ def is_status_success(status: str) -> bool:
|
|
|
3099
3129
|
return status in [EntityStatus.complete, EntityStatus.ready]
|
|
3100
3130
|
|
|
3101
3131
|
|
|
3102
|
-
_ENTITY_CLASS = {
|
|
3103
|
-
Entities.Analysis: Analysis,
|
|
3104
|
-
Entities.Artifact: OCIArtifact,
|
|
3105
|
-
Entities.Audit: Audit,
|
|
3106
|
-
Entities.AuditProcedure: AuditProcedure,
|
|
3107
|
-
Entities.Challenge: Challenge,
|
|
3108
|
-
Entities.Dataset: Dataset,
|
|
3109
|
-
Entities.DataSource: DataSource,
|
|
3110
|
-
Entities.Evaluation: Evaluation,
|
|
3111
|
-
Entities.Family: Family,
|
|
3112
|
-
Entities.Hazard: Hazard,
|
|
3113
|
-
Entities.InferenceService: InferenceService,
|
|
3114
|
-
Entities.InferenceSession: InferenceSession,
|
|
3115
|
-
Entities.Measurement: Measurement,
|
|
3116
|
-
Entities.Method: Method,
|
|
3117
|
-
Entities.Model: Model,
|
|
3118
|
-
Entities.Module: Module,
|
|
3119
|
-
Entities.Report: Report,
|
|
3120
|
-
Entities.SafetyCase: SafetyCase,
|
|
3121
|
-
Entities.Team: Team,
|
|
3122
|
-
Entities.UseCase: UseCase,
|
|
3123
|
-
}
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
def entity_class(kind: Entities):
|
|
3127
|
-
return _ENTITY_CLASS[kind]
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
3132
|
# A Union type containing all Dyff top-level schema types, except the ones that
|
|
3131
3133
|
# should not have Revisions generated for them when they change
|
|
3132
3134
|
_DyffEntityTypeRevisable = Union[
|
|
@@ -3206,6 +3208,37 @@ class Revision(DyffEntity, RevisionMetadata):
|
|
|
3206
3208
|
DyffEntityType = Union[_DyffEntityTypeRevisable, History, Revision]
|
|
3207
3209
|
|
|
3208
3210
|
|
|
3211
|
+
_ENTITY_CLASS: dict[Entities, type[DyffEntityType]] = {
|
|
3212
|
+
Entities.Artifact: OCIArtifact,
|
|
3213
|
+
Entities.Audit: Audit,
|
|
3214
|
+
Entities.AuditProcedure: AuditProcedure,
|
|
3215
|
+
Entities.Challenge: Challenge,
|
|
3216
|
+
Entities.Dataset: Dataset,
|
|
3217
|
+
Entities.DataSource: DataSource,
|
|
3218
|
+
Entities.Evaluation: Evaluation,
|
|
3219
|
+
Entities.Family: Family,
|
|
3220
|
+
Entities.Hazard: Hazard,
|
|
3221
|
+
Entities.History: History,
|
|
3222
|
+
Entities.InferenceService: InferenceService,
|
|
3223
|
+
Entities.InferenceSession: InferenceSession,
|
|
3224
|
+
Entities.Measurement: Measurement,
|
|
3225
|
+
Entities.Method: Method,
|
|
3226
|
+
Entities.Model: Model,
|
|
3227
|
+
Entities.Module: Module,
|
|
3228
|
+
Entities.Pipeline: Pipeline,
|
|
3229
|
+
Entities.PipelineRun: PipelineRun,
|
|
3230
|
+
Entities.Report: Report,
|
|
3231
|
+
Entities.Revision: Revision,
|
|
3232
|
+
Entities.SafetyCase: SafetyCase,
|
|
3233
|
+
Entities.Team: Team,
|
|
3234
|
+
Entities.UseCase: UseCase,
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
|
|
3238
|
+
def entity_class(kind: Entities) -> type[DyffEntityType]:
|
|
3239
|
+
return _ENTITY_CLASS[kind]
|
|
3240
|
+
|
|
3241
|
+
|
|
3209
3242
|
# A TypeVar that matches any Dyff top-level schema type
|
|
3210
3243
|
DyffEntityT = TypeVar(
|
|
3211
3244
|
"DyffEntityT",
|
|
@@ -3371,10 +3404,14 @@ __all__ = [
|
|
|
3371
3404
|
"OCIArtifact",
|
|
3372
3405
|
"Pipeline",
|
|
3373
3406
|
"PipelineBase",
|
|
3407
|
+
"PipelineEvaluationRequest",
|
|
3408
|
+
"PipelineMeasurementRequest",
|
|
3374
3409
|
"PipelineNode",
|
|
3375
3410
|
"PipelineParameter",
|
|
3376
3411
|
"PipelineRun",
|
|
3377
3412
|
"PipelineRunBase",
|
|
3413
|
+
"PipelineRunStatus",
|
|
3414
|
+
"PipelineSafetyCaseRequest",
|
|
3378
3415
|
"QueryableDyffEntity",
|
|
3379
3416
|
"Report",
|
|
3380
3417
|
"ReportBase",
|
|
@@ -19,11 +19,10 @@ from datetime import datetime
|
|
|
19
19
|
from typing import Any, Literal, Optional, Union
|
|
20
20
|
|
|
21
21
|
import pydantic
|
|
22
|
-
from typing_extensions import TypeAlias
|
|
23
22
|
|
|
24
23
|
from ... import upcast
|
|
25
24
|
from . import commands
|
|
26
|
-
from .base import DyffBaseModel,
|
|
25
|
+
from .base import DyffBaseModel, JsonMergePatchSemantics
|
|
27
26
|
from .platform import (
|
|
28
27
|
AnalysisRequestBase,
|
|
29
28
|
AnalysisScope,
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|