-
Notifications
You must be signed in to change notification settings - Fork 4
/
models.py
129 lines (118 loc) · 3.82 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
from pydantic import BaseModel, Field
class BaseAnalysisModel(BaseModel):
table: str = Field(
default=None, title="Name of the table to perform analysis on."
)
database: str = Field(
default=None, title="Name of the database the table belongs to."
)
class StatusResponseModel(BaseModel):
status: str = Field(
default="SUCCESS"
)
new_table_id: str = Field(
default="shnxppipxrppsdkozuroilkubktfodibtqorhucjvxlcdrqyhh",
title="50 character new table_id in postgresql."
)
completion_time: str = Field(
default="2022-07-06T19:33:17.950059"
)
run_time_in_seconds: float = Field(
default=1.78599
)
class BaseResponseModel(BaseModel):
process_id: str = Field(
default="472e29dc-91a8-41d3-b05f-cee34006e3f7"
)
url: str = Field(
default="http://127.0.0.1:8000/api/v1/analysis/status/472e29dc-91a8-41d3-b05f-cee34006e3f7"
)
class BadResponseModel(BaseModel):
status: str = Field(
default="FAILURE"
)
completion_time: str = Field(
default="2022-07-06T19:33:17.950059"
)
run_time_in_seconds: float = Field(
default=1.78599
)
class BufferModel(BaseModel):
table: str = Field(
default=None, title="Name of the table to perform analysis on."
)
database: str = Field(
default=None, title="Name of the database the table belongs to."
)
distance_in_kilometers: float = Field(
default=None, title="Size of buffer in kilometers."
)
class DissolveByValueModel(BaseModel):
table: str = Field(
default=None, title="Name of the table to perform analysis on."
)
database: str = Field(
default=None, title="Name of the database the table belongs to."
)
column: str = Field(
default=None, title="Column used to dissolve geometry."
)
class GridModel(BaseModel):
table: str = Field(
default=None, title="Name of the table to perform analysis on."
)
database: str = Field(
default=None, title="Name of the database the table belongs to."
)
grid_size_in_kilometers: float = Field(
default=None, title="Size of grids in kilometers."
)
class KMeansModel(BaseModel):
table: str = Field(
default=None, title="Name of the table to perform analysis on."
)
database: str = Field(
default=None, title="Name of the database the table belongs to."
)
number_of_clusters: int = Field(
default=None, title="Number of clusters to group points together."
)
class FindWithinDistanceModel(BaseModel):
table: str = Field(
default=None, title="Name of the table to perform analysis on."
)
database: str = Field(
default=None, title="Name of the database the table belongs to."
)
latitude: float = Field(
default=None, title="Starting Latitude."
)
longitude: float = Field(
default=None, title="Starting Latitude."
)
distance_in_kilometers: float = Field(
default=None, title="Size to search in kilometers."
)
class PolygonsModel(BaseModel):
table: str = Field(
default=None, title="Name of the table to perform analysis on."
)
database: str = Field(
default=None, title="Name of the database the table belongs to."
)
polygons: str = Field(
default=None, title="Name of the table of polygons."
)
class AggregatePointsByGridsModel(BaseModel):
table: str = Field(
default=None, title="Name of the table to perform analysis on."
)
database: str = Field(
default=None, title="Name of the database the table belongs to."
)
distance_in_kilometers: float = Field(
default=None, title="Size to search in kilometers."
)
grid_type: str = Field(
default=None, title="Type of grid to use."
)