Skip to content

Commit 3445c4b

Browse files
committed
Add Pydantic support for schemas and update dependencies
- Introduced Pydantic for schema validation across various modules. - Updated `pyproject.toml` to include Pydantic as a dependency. - Refactored existing schemas to utilize Pydantic's BaseModel for better validation and error handling. - Enhanced documentation within schemas to clarify usage and attributes. - Adjusted example graphs and evaluation parameters to align with new schema structure.
1 parent 62f9376 commit 3445c4b

7 files changed

Lines changed: 1194 additions & 991 deletions

File tree

evaluation_function/schemas/__init__.py

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Graph Theory Evaluation Schemas
33
4-
This package contains all schema definitions for the Graph Theory
4+
This package contains all Pydantic schema definitions for the Graph Theory
55
Visualizer and Evaluator.
66
77
Modules:
@@ -14,9 +14,9 @@
1414

1515
# Graph structures
1616
from .graph import (
17-
NodeSchema,
18-
EdgeSchema,
19-
GraphSchema,
17+
Node,
18+
Edge,
19+
Graph,
2020
EXAMPLE_UNDIRECTED_GRAPH,
2121
EXAMPLE_DIRECTED_GRAPH,
2222
EXAMPLE_BIPARTITE_GRAPH,
@@ -26,16 +26,18 @@
2626
# Evaluation types
2727
from .evaluation_types import (
2828
EvaluationType,
29-
CoreEvaluationType,
30-
PathEvaluationType,
31-
CycleEvaluationType,
32-
TreeEvaluationType,
33-
ColoringEvaluationType,
34-
FlowEvaluationType,
35-
ComponentEvaluationType,
36-
StructureEvaluationType,
37-
OrderingEvaluationType,
38-
SpecialGraphEvaluationType,
29+
EvaluationCategory,
30+
CoreEvaluation,
31+
PathEvaluation,
32+
CycleEvaluation,
33+
TreeEvaluation,
34+
ColoringEvaluation,
35+
FlowEvaluation,
36+
ComponentEvaluation,
37+
StructureEvaluation,
38+
OrderingEvaluation,
39+
SpecialGraphEvaluation,
40+
EvaluationTypeInfo,
3941
EVALUATION_TYPE_INFO,
4042
)
4143

@@ -67,8 +69,8 @@
6769

6870
# Request/Response
6971
from .request import (
70-
ResponseSchema,
71-
AnswerSchema,
72+
Response,
73+
Answer,
7274
)
7375

7476
# Results
@@ -91,31 +93,33 @@
9193
ComputationStep,
9294
EvaluationDetails,
9395
VisualizationData,
94-
ExtendedResult,
96+
EvaluationResult,
9597
)
9698

9799
__all__ = [
98100
# Graph structures
99-
"NodeSchema",
100-
"EdgeSchema",
101-
"GraphSchema",
101+
"Node",
102+
"Edge",
103+
"Graph",
102104
"EXAMPLE_UNDIRECTED_GRAPH",
103105
"EXAMPLE_DIRECTED_GRAPH",
104106
"EXAMPLE_BIPARTITE_GRAPH",
105107
"EXAMPLE_FLOW_NETWORK",
106108

107109
# Evaluation types
108110
"EvaluationType",
109-
"CoreEvaluationType",
110-
"PathEvaluationType",
111-
"CycleEvaluationType",
112-
"TreeEvaluationType",
113-
"ColoringEvaluationType",
114-
"FlowEvaluationType",
115-
"ComponentEvaluationType",
116-
"StructureEvaluationType",
117-
"OrderingEvaluationType",
118-
"SpecialGraphEvaluationType",
111+
"EvaluationCategory",
112+
"CoreEvaluation",
113+
"PathEvaluation",
114+
"CycleEvaluation",
115+
"TreeEvaluation",
116+
"ColoringEvaluation",
117+
"FlowEvaluation",
118+
"ComponentEvaluation",
119+
"StructureEvaluation",
120+
"OrderingEvaluation",
121+
"SpecialGraphEvaluation",
122+
"EvaluationTypeInfo",
119123
"EVALUATION_TYPE_INFO",
120124

121125
# Parameters
@@ -143,8 +147,8 @@
143147
"TraversalParams",
144148

145149
# Request/Response
146-
"ResponseSchema",
147-
"AnswerSchema",
150+
"Response",
151+
"Answer",
148152

149153
# Results
150154
"PathResult",
@@ -165,5 +169,5 @@
165169
"ComputationStep",
166170
"EvaluationDetails",
167171
"VisualizationData",
168-
"ExtendedResult",
172+
"EvaluationResult",
169173
]

0 commit comments

Comments
 (0)