State
Handles all app and run state changes.
create_new_user(app_state, first_name, last_name)
Creates a new user.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app_state |
AppState
|
The current app state. |
required |
first_name |
str
|
The user's first name. |
required |
last_name |
str
|
The user's last name. |
required |
Returns:
Type | Description |
---|---|
AppState
|
The updated app state. |
Source code in evaluator/backend/state.py
set_resume_session(app_state, resume_session)
Sets the resume session boolean.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app_state |
AppState
|
The current app state. |
required |
resume_session |
bool
|
The resume_session value to set. |
required |
Returns:
Type | Description |
---|---|
AppState
|
The updated app state. |
Source code in evaluator/backend/state.py
save_state(app_state)
Saves the state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app_state |
AppState
|
The app state to save. |
required |
Source code in evaluator/backend/state.py
submit_eval_state(app_state, run_state)
Updates the app state with the submitted evaluation data. If the eval state is the default eval state this function will silently not perform the update.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app_state |
AppState
|
The app state to update. |
required |
run_state |
RunState
|
The run state to update from. |
required |
Returns:
Type | Description |
---|---|
AppState
|
The updated app state. |
Source code in evaluator/backend/state.py
load_run_state(run_index, total_runs, app_state)
Create run state.
TODO : This function is messy, should be cleaned up at some point.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
run_index |
int
|
The run index to load from. |
required |
total_runs |
int
|
The total number of potential evaluation runs. |
required |
app_state |
AppState
|
The current app state. |
required |
Returns:
Type | Description |
---|---|
RunState
|
The run state for the run at the specified index. |
Source code in evaluator/backend/state.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|