Melvonaut Reference¶
Ciarc.
__main__
¶
Melvonaut :author: Jonathan Decker
current_telemetry = None
module-attribute
¶
cancel_tasks()
¶
Cancels all tasks and event loop.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/__main__.py
245 246 247 248 249 250 251 252 253 254 |
|
get_announcements(last_id=None)
async
¶
Fetches announcements asynchronously with event-stream handling.
This function continuously listens for new announcements from the API and processes them. If announcements are received, they are logged and stored.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
last_id
|
Optional[str]
|
The ID of the last processed event to resume from, if applicable. |
None
|
Returns:
Type | Description |
---|---|
Optional[str]
|
Optional[str]: The ID of the last received announcement, or None if an error occurs. |
Source code in src/melvonaut/__main__.py
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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 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 |
|
get_observations()
async
¶
Async get observations from the Melvin API and update the state planner
This function establishes a session with the API and retrieves observation data. If the response is successful, it updates the telemetry state. If any errors occur, they are logged accordingly.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/__main__.py
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 |
|
main()
¶
Melvonaut.
Source code in src/melvonaut/__main__.py
288 289 290 291 292 293 294 295 |
|
read_images()
async
¶
Reads image files asynchronously from a designated directory.
This function iterates over stored images, extracts metadata from filenames, and
yields MelvinImage
objects.
Yields:
Name | Type | Description |
---|---|---|
MelvinImage |
AsyncIterable[MelvinImage]
|
An image object containing extracted metadata. |
Source code in src/melvonaut/__main__.py
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 |
|
run_get_announcements()
async
¶
Continuously fetches announcements from the API.
This function runs in an infinite loop, restarting the subscription when needed.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/__main__.py
173 174 175 176 177 178 179 180 181 182 183 184 |
|
run_get_observations()
async
¶
Runs the observation fetching function in a loop.
This function repeatedly fetches observations based on a specified refresh rate, adjusting for simulation speed.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/__main__.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
run_read_images()
async
¶
Log all receives images.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/__main__.py
235 236 237 238 239 240 241 242 |
|
start_event_loop()
¶
Initializes and starts the asynchronous event loop.
This function sets up signal handlers, registers tasks for fetching observations, announcements, and API interactions, and starts the event loop.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/__main__.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
|
api
¶
Handler = Callable[[web.Request], Awaitable[web.StreamResponse]]
module-attribute
¶
catcher_middleware(request, handler)
async
¶
Middleware to catch and log unhandled exceptions in request handling.
If an exception occurs while processing the request, this middleware logs the error and returns a 500 Internal Server Error response with the error message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
handler
|
Handler
|
The next request handler in the middleware chain. |
required |
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
The HTTP response from the handler, or a 500 error response |
Any
|
if an exception occurs. |
Source code in src/melvonaut/api.py
687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 |
|
compression_middleware(request, handler)
async
¶
Middleware to handle response compression using gzip or deflate.
This middleware checks the Accept-Encoding
header of the request
to determine if the client supports gzip or deflate compression.
If supported, it applies the corresponding compression to the response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
handler
|
Handler
|
The next request handler in the middleware chain. |
required |
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
The compressed HTTP response if the client supports it, |
Any
|
otherwise the original response. |
Source code in src/melvonaut/api.py
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 |
|
get_all_settings(request)
async
¶
Retrieve all settings configured in the system.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: JSON response containing all system settings. |
Source code in src/melvonaut/api.py
590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 |
|
get_clear_all_images(request)
async
¶
Clears all stored images.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: JSON response containing a list of cleared images. |
Source code in src/melvonaut/api.py
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 |
|
get_clear_all_logs(request)
async
¶
Clears all log files in the system.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: JSON response containing a list of cleared log files. |
Source code in src/melvonaut/api.py
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
|
get_clear_events(request)
async
¶
Deletes the event log file from the system.
If the event log file exists, it is deleted. If it does not exist, a 404 response is returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: A 200 response if the file is successfully deleted. |
Response
|
web.Response: A 404 response if the file is not found. |
Source code in src/melvonaut/api.py
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
|
get_clear_telemetry(request)
async
¶
Clears the telemetry data file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: A success response if the file is deleted, otherwise a 404 response. |
Source code in src/melvonaut/api.py
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 |
|
get_cpu_usage(request)
async
¶
Retrieve CPU usage statistics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: JSON response containing CPU usage data including user, system, idle time, percent usage, core count, and frequency. |
Source code in src/melvonaut/api.py
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 |
|
get_disk_usage(request)
async
¶
Retrieve disk usage statistics for root and home directories.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: JSON response containing disk usage data. |
Source code in src/melvonaut/api.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
get_download_events(request)
async
¶
Handles the download of event logs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response | FileResponse
|
web.FileResponse: The requested event log file if it exists. |
Response | FileResponse
|
web.Response: A 404 response if the file is not found. |
Source code in src/melvonaut/api.py
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
|
get_download_events_and_clear(request)
async
¶
Downloads and clears the event log file.
This function retrieves the event log file, sends its content as a response, and then deletes the file from the system.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: A response containing the event log content if found. |
Response
|
web.Response: A 404 response if the file is not found. |
Source code in src/melvonaut/api.py
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
|
get_download_telemetry(request)
async
¶
Handles telemetry data download requests.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response | FileResponse
|
web.Response: The telemetry file if it exists, otherwise a 404 response. |
Source code in src/melvonaut/api.py
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
|
get_download_telemetry_and_clear(request)
async
¶
Handles telemetry data download requests and deletes the file after serving it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: The telemetry file if it exists, otherwise a 404 response. |
Source code in src/melvonaut/api.py
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
|
get_list_images(request)
async
¶
Lists all available image files.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: JSON response containing a list of image filenames. |
Source code in src/melvonaut/api.py
421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 |
|
get_list_log_files(request)
async
¶
Retrieve a list of log files from the log directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: JSON response containing a list of log filenames. |
Source code in src/melvonaut/api.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
get_melvin_version(request)
async
¶
Retrieve the current version of the Melvin service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: JSON response containing the Melvin service version. |
Source code in src/melvonaut/api.py
167 168 169 170 171 172 173 174 175 176 177 178 |
|
get_memory_usage(request)
async
¶
Retrieve memory usage statistics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: JSON response containing memory usage data. |
Source code in src/melvonaut/api.py
49 50 51 52 53 54 55 56 57 58 59 60 |
|
get_reset_settings(request)
async
¶
Resets all settings to their default values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: A success response confirming the reset. |
Source code in src/melvonaut/api.py
522 523 524 525 526 527 528 529 530 531 532 533 |
|
get_restart_melvin(request)
async
¶
Handles a request to restart the Melvin service.
This endpoint is not yet implemented and always returns a 501 Not Implemented response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: A response indicating that the operation is not implemented. |
Source code in src/melvonaut/api.py
90 91 92 93 94 95 96 97 98 99 100 101 |
|
get_shutdown_melvin(request)
async
¶
Handles a request to shut down the Melvin service.
If settings.DO_ACTUALLY_EXIT
is set to True, the event loop is stopped,
all pending tasks are canceled, and the process exits. Otherwise, a warning is logged.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: A response with status 200 indicating the shutdown request was received. |
Source code in src/melvonaut/api.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
health(request)
async
¶
Check if the API is running and healthy.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: A response with status 200 and text "OK". |
Source code in src/melvonaut/api.py
20 21 22 23 24 25 26 27 28 29 |
|
post_clear_log(request)
async
¶
Handles log file deletion requests.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request containing the log file name in JSON format. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: A success response if the log file is cleared, otherwise an error response. |
Source code in src/melvonaut/api.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
|
post_clear_setting(request)
async
¶
Clears a specific setting.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request containing the setting name in JSON format. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: A success response if the setting is cleared. |
Source code in src/melvonaut/api.py
552 553 554 555 556 557 558 559 560 561 562 563 564 565 |
|
post_download_image(request)
async
¶
Handles image file download requests.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request containing the image filename in JSON format. |
required |
Returns:
Type | Description |
---|---|
Response | FileResponse
|
web.Response: The requested image file if it exists, otherwise a 404 response. |
Source code in src/melvonaut/api.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
|
post_download_image_and_clear(request)
async
¶
Handles image file download requests and deletes the file after serving it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request containing the image filename in JSON format. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: The requested image file if it exists, otherwise a 404 response. |
Source code in src/melvonaut/api.py
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
|
post_download_log(request)
async
¶
Handles log file download requests.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request containing the log file name in JSON format. |
required |
Returns:
Type | Description |
---|---|
Response | FileResponse
|
web.Response: The requested log file if it exists, otherwise a 404 response. |
Source code in src/melvonaut/api.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
|
post_download_log_and_clear(request)
async
¶
Handles log file download requests and deletes the file after serving it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request containing the log file name in JSON format. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: The requested log file if it exists, otherwise a 404 response. |
Source code in src/melvonaut/api.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
|
post_execute_command(request)
async
¶
Execute a shell command asynchronously.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request containing JSON data with the command to execute. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: JSON response containing command output and return code. |
Source code in src/melvonaut/api.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
post_get_setting(request)
async
¶
Retrieves a specific setting.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request containing the setting name in JSON format. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: JSON response containing the requested setting value. |
Source code in src/melvonaut/api.py
568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 |
|
post_set_melvin_task(request)
async
¶
Sets a task for Melvin (a task management system).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request containing the task details in JSON format. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: A success response if the task is set. |
Source code in src/melvonaut/api.py
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 |
|
post_set_setting(request)
async
¶
Sets a new configuration setting.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
The incoming HTTP request containing settings in JSON format. |
required |
Returns:
Type | Description |
---|---|
Response
|
web.Response: A success response if the setting is applied. |
Source code in src/melvonaut/api.py
536 537 538 539 540 541 542 543 544 545 546 547 548 549 |
|
run_api()
async
¶
Starts the web API server.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/api.py
710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 |
|
setup_routes(app)
¶
Sets up API routes for the web application.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app
|
Application
|
The web application instance. |
required |
Source code in src/melvonaut/api.py
613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 |
|
ebt_calc
¶
events = Event.load_events_from_csv(path=path)
module-attribute
¶
processed = []
data = [(4097, 7652, 2041), (5758, 8357, 688), (6220, 8553, 1075), (7245, 8989, 1669)]¶
data = [ (19972.3165561, 113.5243816, 1454.48), (20486.232864, 331.337984, 930.35), (20998.9861724, 548.6578144, 787.93), (21510.18207954, 766.74099024, 1093.99), (18882.99334624, 2295.73420544, 1947.67), (19394.53293776, 2512.96329856, 1450.01), (19908.73421827, 2730.89789112, 1442.63), (20421.30728271, 2948.14119576, 1828.68), (20926.46189231, 3163.05597336, 1651.83), ] for d in data: s = ping( x=int(d[0] / scaling_factor), y=int(d[1] / scaling_factor), d=d[2] / scaling_factor, mind=int((d[2] - max_offset) / scaling_factor), maxd=int((d[2] + max_offset) / scaling_factor), ) processed.append(s) print(f"Added: {s}")
id = 201
module-attribute
¶
max_offset = 325
module-attribute
¶
path = con.CONSOLE_FROM_MELVONAUT_PATH + 'MelvonautEvents.csv'
module-attribute
¶
processed = parse_pings(id=id, events=events)
module-attribute
¶
res = find_matches(pings=processed)
module-attribute
¶
scaling_factor = 1
module-attribute
¶
x_0 = 0
module-attribute
¶
x_max = int(con.WORLD_X / scaling_factor)
module-attribute
¶
y_0 = 0
module-attribute
¶
y_max = int(con.WORLD_Y / scaling_factor)
module-attribute
¶
distance(x1, x2, y1, y2)
¶
Computes the Euclidean distance between two points, adjusting for wraparound conditions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x1
|
int
|
X-coordinate of the first point. |
required |
x2
|
int
|
X-coordinate of the second point. |
required |
y1
|
int
|
Y-coordinate of the first point. |
required |
y2
|
int
|
Y-coordinate of the second point. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The Euclidean distance between the two points. |
Source code in src/melvonaut/ebt_calc.py
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 |
|
draw_res(id, res, pings, show=False)
¶
Draws and saves a visualization of the computed emergency beacon locations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
int
|
Identifier for the emergency beacon tracker. |
required |
res
|
list[tuple[int, int]]
|
List of matched coordinate points. |
required |
pings
|
list[Ping]
|
List of Ping objects representing detected signals. |
required |
show
|
bool
|
Whether to display the plot. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
tuple[int, int]
|
tuple[int, int]: The estimated centroid of the matched points, or (-1, -1) if no matches were found. |
Source code in src/melvonaut/ebt_calc.py
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 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
|
f(d)
¶
Computes a transformed distance value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
d
|
float
|
Input distance value. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
Transformed distance value. |
Source code in src/melvonaut/ebt_calc.py
30 31 32 33 34 35 36 37 38 39 40 41 |
|
find_matches(pings)
¶
Identifies matching points from the given pings based on distance constraints.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pings
|
list[Ping]
|
List of Ping objects to process. |
required |
Returns:
Type | Description |
---|---|
list[tuple[int, int]]
|
list[tuple[int, int]]: List of coordinate pairs that satisfy all constraints. |
Source code in src/melvonaut/ebt_calc.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
parse_pings(id, events)
¶
Parses event data to extract relevant ping information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
int
|
Identifier for the event source. |
required |
events
|
list[Event]
|
List of event objects to be processed. |
required |
Returns:
Type | Description |
---|---|
list[Ping]
|
list[Ping]: A list of parsed Ping objects. |
Source code in src/melvonaut/ebt_calc.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
mel_telemetry
¶
MelTelemetry
¶
Bases: BaseTelemetry
Source code in src/melvonaut/mel_telemetry.py
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 |
|
timestamp
instance-attribute
¶
model_post_init(__context__)
¶
Initializes the telemetry model and triggers CSV storage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
__context__
|
Any
|
Context data passed during initialization. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/mel_telemetry.py
96 97 98 99 100 101 102 103 104 105 106 107 |
|
store_observation_csv()
async
¶
Stores the telemetry observation data in a CSV file.
This function converts the telemetry data into a flattened dictionary format, ensuring nested dictionaries are stored as separate fields. It then appends the data to an existing CSV file or creates a new file if one does not exist.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/mel_telemetry.py
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 |
|
store_observation_json()
async
¶
Stores the telemetry observation data in a JSON file.
This function retrieves the existing telemetry data from the JSON file and updates it with a new entry. If the JSON file does not exist, a new one is created. The data is formatted in a structured manner with timestamps as keys.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/mel_telemetry.py
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 |
|
settings
¶
file_log_handler_id = None
module-attribute
¶
settings = Settings()
module-attribute
¶
Settings
¶
Bases: BaseModel
Startup settings for Melvonaut, can be changed by Melvonaut API.
Source code in src/melvonaut/settings.py
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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 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 |
|
API_PORT = int(os.getenv('API_PORT', 8080))
class-attribute
instance-attribute
¶
BATTERY_HIGH_THRESHOLD = int(os.getenv('BATTERY_HIGH_THRESHOLD', 0))
class-attribute
instance-attribute
¶
BATTERY_LOW_THRESHOLD = int(os.getenv('BATTERY_LOW_THRESHOLD', 20))
class-attribute
instance-attribute
¶
CURRENT_MELVIN_TASK = MELVINTask.Mapping
class-attribute
instance-attribute
¶
DISCORD_ALERTS_ENABLED = bool(os.getenv('DISCORD_ALERTS_ENABLED', False))
class-attribute
instance-attribute
¶
DISCORD_WEBHOOK_TOKEN = os.getenv('DISCORD_WEBHOOK_TOKEN', None)
class-attribute
instance-attribute
¶
DISTANCE_BETWEEN_IMAGES = int(os.getenv('DISTANCE_BETWEEN_IMAGES', 450))
class-attribute
instance-attribute
¶
DO_ACTUALLY_EXIT = True
class-attribute
instance-attribute
¶
DO_TIMING_CHECK = False
class-attribute
instance-attribute
¶
FILE_LOGGING_LEVEL = os.getenv('FILE_LOGGING_LEVEL', 'INFO').upper()
class-attribute
instance-attribute
¶
NETWORK_SIM_ENABLED = bool(os.getenv('NETWORK_SIMULATION', False))
class-attribute
instance-attribute
¶
OBSERVATION_REFRESH_RATE = int(os.getenv('OBSERVATION_REFRESH_RATE', 5))
class-attribute
instance-attribute
¶
OVERRIDES = {}
class-attribute
instance-attribute
¶
START_TIME = datetime.datetime(2025, 1, 2, 12, 0, tzinfo=datetime.timezone.utc)
class-attribute
instance-attribute
¶
STOP_TIME = datetime.datetime(2025, 1, 30, 12, 0, tzinfo=datetime.timezone.utc)
class-attribute
instance-attribute
¶
TARGET_ANGLE_DEG = float(os.getenv('TARGET_ANGLE_DEG', 23.0))
class-attribute
instance-attribute
¶
TARGET_CAMERA_ANGLE_ACQUISITION = CameraAngle.Narrow
class-attribute
instance-attribute
¶
TARGET_SPEED_NARROW_X = float(os.getenv('TARGET_SPEED_NARROW_X', 6.95))
class-attribute
instance-attribute
¶
TARGET_SPEED_NARROW_Y = float(os.getenv('TARGET_SPEED_NARROW_Y', 2.95))
class-attribute
instance-attribute
¶
TARGET_SPEED_NORMAL_X = float(os.getenv('TARGET_SPEED_NORMAL_X', 35.03))
class-attribute
instance-attribute
¶
TARGET_SPEED_NORMAL_Y = float(os.getenv('TARGET_SPEED_NORMAL_Y', 14.87))
class-attribute
instance-attribute
¶
TARGET_SPEED_WIDE_X = float(os.getenv('TARGET_SPEED_WIDE_X', 49.84))
class-attribute
instance-attribute
¶
TARGET_SPEED_WIDE_Y = float(os.getenv('TARGET_SPEED_WIDE_Y', 21.16))
class-attribute
instance-attribute
¶
TERMINAL_LOGGING_LEVEL = os.getenv('TERMINAL_LOGGING_LEVEL', 'INFO').upper()
class-attribute
instance-attribute
¶
TRACING = bool(os.getenv('TRACING', False))
class-attribute
instance-attribute
¶
model_config = {'arbitrary_types_allowed': True}
class-attribute
instance-attribute
¶
__getattribute__(item)
¶
Overrides attribute access to check overrides before default settings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item
|
str
|
The attribute key to retrieve. |
required |
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
The overridden value if it exists, otherwise the default. |
Source code in src/melvonaut/settings.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
|
__init__()
¶
Initializes the Settings object, loading settings if they exist.
Source code in src/melvonaut/settings.py
224 225 226 227 228 |
|
__setattr__(key, value)
¶
Overrides attribute setting to ensure settings are properly stored.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The setting key. |
required |
value
|
Any
|
The value to assign to the setting. |
required |
Source code in src/melvonaut/settings.py
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
|
clear_settings()
¶
Clears all settings by setting overrides to None and saving.
Source code in src/melvonaut/settings.py
208 209 210 |
|
delete_settings(keys)
¶
Deletes specified settings from overrides and saves the settings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
keys
|
list[str]
|
A list of setting keys to remove. |
required |
Source code in src/melvonaut/settings.py
182 183 184 185 186 187 188 189 190 191 192 |
|
get_default_setting(key)
¶
Retrieves the default value of a setting from the class attributes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The setting key to retrieve. |
required |
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
The default value of the setting. |
Source code in src/melvonaut/settings.py
213 214 215 216 217 218 219 220 221 222 |
|
get_setting(key, default=None)
¶
Retrieves a setting value from overrides or returns the default.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The setting key to retrieve. |
required |
default
|
Any
|
The default value if the key is not found. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
The value of the setting if it exists, otherwise the default. |
Source code in src/melvonaut/settings.py
140 141 142 143 144 145 146 147 148 149 150 |
|
init_settings()
¶
Initializes settings by checking for an existing settings file.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if settings were newly created, False if they already exist. |
Source code in src/melvonaut/settings.py
194 195 196 197 198 199 200 201 202 203 204 205 |
|
load_settings()
¶
Loads settings from a persistent JSON file.
If the settings file does not exist or contains invalid JSON, the overrides dictionary is reset to an empty state.
Source code in src/melvonaut/settings.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
save_settings()
¶
Saves the current settings overrides to a persistent JSON file.
Source code in src/melvonaut/settings.py
134 135 136 137 |
|
set_setting(key, value)
¶
Sets a single setting in overrides and saves the settings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The setting key. |
required |
value
|
Any
|
The value to assign to the setting. |
required |
Source code in src/melvonaut/settings.py
153 154 155 156 157 158 159 160 161 162 163 164 |
|
set_settings(key_values)
¶
Sets multiple settings at once and saves them.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key_values
|
dict[str, Any]
|
A dictionary of key-value pairs to update. |
required |
Source code in src/melvonaut/settings.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
state_planer
¶
state_planner = StatePlanner()
module-attribute
¶
StatePlanner
¶
Bases: BaseModel
Source code in src/melvonaut/state_planer.py
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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 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 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 |
|
current_telemetry = None
class-attribute
instance-attribute
¶
melv_id = random.randint(0, 9999)
class-attribute
instance-attribute
¶
previous_state = None
class-attribute
instance-attribute
¶
previous_telemetry = None
class-attribute
instance-attribute
¶
recent_events = []
class-attribute
instance-attribute
¶
state_change_time = datetime.datetime.now()
class-attribute
instance-attribute
¶
submitted_transition_request = False
class-attribute
instance-attribute
¶
target_state = None
class-attribute
instance-attribute
¶
calc_current_location()
¶
Estimates the current location based on telemetry data and time elapsed.
Returns:
Type | Description |
---|---|
tuple[float, float]
|
tuple[float, float]: The estimated (x, y) coordinates. |
Source code in src/melvonaut/state_planer.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
calc_transition_remaining_time()
¶
Calculates the remaining time for state transition.
Returns:
Type | Description |
---|---|
timedelta
|
datetime.timedelta: The remaining transition time based on the simulation speed. |
Source code in src/melvonaut/state_planer.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
control_acquisition()
async
¶
Initializes acquisition mode by updating objectives and setting camera parameters.
Retrieves objectives from an external API, determines the current objective, and adjusts acquisition parameters accordingly. Also creates necessary directories for image storage.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/state_planer.py
685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 |
|
get_current_state()
¶
Retrieves the current state from telemetry data.
Returns:
Name | Type | Description |
---|---|---|
State |
State
|
The current state if telemetry is available, otherwise State.Unknown. |
Source code in src/melvonaut/state_planer.py
68 69 70 71 72 73 74 75 76 |
|
get_image()
async
¶
Captures an image if telemetry data is available and conditions are met.
If no telemetry data is available, the function waits for the next observation cycle. It checks various conditions (e.g., acceleration, camera angle, timing) before fetching an image from an external API and saving it with appropriate metadata.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/state_planer.py
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 |
|
get_previous_state()
¶
Retrieves the previous state from telemetry data.
Returns:
Name | Type | Description |
---|---|---|
State |
State
|
The previous state if telemetry is available, otherwise State.Unknown. |
Source code in src/melvonaut/state_planer.py
78 79 80 81 82 83 84 85 86 |
|
get_simulation_speed()
¶
Gets the current simulation speed from telemetry data.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The simulation speed if telemetry is available, otherwise 1. |
Source code in src/melvonaut/state_planer.py
88 89 90 91 92 93 94 95 96 |
|
get_time_since_state_change()
¶
Calculates the time elapsed since the last state change.
Returns:
Type | Description |
---|---|
timedelta
|
datetime.timedelta: The time difference between now and the last state change. |
Source code in src/melvonaut/state_planer.py
98 99 100 101 102 103 104 |
|
model_post_init(__context__)
¶
Initializes the recent_events list by loading events from a CSV file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
__context__
|
Any
|
Context data passed during initialization. |
required |
Source code in src/melvonaut/state_planer.py
60 61 62 63 64 65 66 |
|
plan_state_switching()
async
¶
Plans and executes state transitions based on current telemetry data.
This function checks the current state and decides whether to transition to another state based on conditions like battery level and velocity.
Logs relevant debug information and triggers state transitions when necessary.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/state_planer.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
run_get_image()
async
¶
Continuously captures images while in the Acquisition state.
This function continuously captures images at calculated intervals, adjusting timing based on velocity and acceleration.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/state_planer.py
643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 |
|
switch_if_battery_low(state_low_battery, state_high_battery)
async
¶
Switches state based on battery level.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state_low_battery
|
State
|
The state to switch to when battery is low. |
required |
state_high_battery
|
State
|
The state to switch to when battery is sufficient. |
required |
Source code in src/melvonaut/state_planer.py
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
|
trigger_camera_angle_change(new_angle)
async
¶
Tries to change the camera angle to new_angle
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_angle
|
CameraAngle
|
The desired camera angle. |
required |
Source code in src/melvonaut/state_planer.py
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 |
|
trigger_state_transition(new_state)
async
¶
Initiates a state transition if valid conditions are met.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_state
|
State
|
The target state to transition to. |
required |
Source code in src/melvonaut/state_planer.py
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 |
|
trigger_velocity_change(new_vel_x, new_vel_y)
async
¶
Sets new values for accelartion, also set _accelerating
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_vel_x
|
float
|
The target velocity in the x direction. |
required |
new_vel_y
|
float
|
The target velocity in the y direction. |
required |
Source code in src/melvonaut/state_planer.py
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 |
|
update_telemetry(new_telemetry)
async
¶
Updates the telemetry data and handles state changes.
This function updates the previous and current telemetry readings, logs relevant debug information, and checks for state changes.
If a state change occurs, it logs the transition, cancels image retrieval tasks if necessary, and triggers appropriate actions based on the new state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_telemetry
|
MelTelemetry
|
The new telemetry data to update. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/melvonaut/state_planer.py
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 |
|
utils
¶
file_log_handler_id = None
module-attribute
¶
melvin_notifier(body, title, notify_type, *args, **kwargs)
¶
Melvin-specific notification handler.
Just prints to stdout.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
str
|
The message body. |
required |
title
|
str
|
The notification title. |
required |
notify_type
|
NotifyType
|
The type of notification. |
required |
*args
|
Any
|
Additional arguments. |
()
|
**kwargs
|
dict[str, Any]
|
Additional keyword arguments. |
{}
|
Source code in src/melvonaut/utils.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
setup_file_logging()
¶
Configures file-based logging with rotation at midnight.
If a file log handler already exists, it is removed before adding a new one.
Source code in src/melvonaut/utils.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
setup_logging()
¶
Configures the logging system for the application.
This function removes existing log handlers, sets up terminal logging, and configures Apprise notifications for Discord and Melvin events.
Source code in src/melvonaut/utils.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|