Python API
The Python API is centered around PerfmonitorService, a standalone orchestration class defined in jumper_extension.core.service. It wires together monitoring, visualization, reporting, cell history, and session management and can be used directly from Python code without IPython magics.
Constructing a service
The recommended entry point is the factory function build_perfmonitor_service:
from jumper_extension.core.service import build_perfmonitor_service
service = build_perfmonitor_service()
This function creates:
- A
Settingsinstance holding monitoring and reporting configuration. - A
PerformanceMonitorfor collecting metrics. - A
CellHistorytracker for executed cells. - A
PerformanceVisualizerandPerformanceReporterattached to the monitor and cell history. - A
NotebookScriptWriterfor script recording.
The returned PerfmonitorService exposes methods that mirror the high‑level commands used by the Jupyter API.
build_perfmonitor_service(plots_disabled=False, plots_disabled_reason='Plotting not available.', display_disabled=False, display_disabled_reason='Display not available.')
Build a new :class:PerfmonitorService instance.
This factory configures the default monitor, visualizer, reporter, cell history, and script writer for use in Python code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plots_disabled
|
bool
|
If |
False
|
plots_disabled_reason
|
str
|
Human-readable reason shown when plots are disabled. |
'Plotting not available.'
|
display_disabled
|
bool
|
If |
False
|
display_disabled_reason
|
str
|
Human-readable reason shown when rich display is disabled. |
'Display not available.'
|
Returns:
| Name | Type | Description |
|---|---|---|
PerfmonitorService |
PerfmonitorService
|
A fully initialized service instance. |
Examples:
>>> from jumper_extension.core.service import build_perfmonitor_service
>>> service = build_perfmonitor_service()
Source code in jumper_extension/core/service.py
965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 | |
build_perfmonitor_magic_adapter(plots_disabled=False, plots_disabled_reason='Plotting not available.', display_disabled=False, display_disabled_reason='Display not available.')
Build a new :class:PerfmonitorMagicAdapter instance.
This factory constructs a :class:PerfmonitorService and wraps it
with a string-based adapter suitable for IPython magics or other
command-style interfaces.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plots_disabled
|
bool
|
If |
False
|
plots_disabled_reason
|
str
|
Human-readable reason shown when plots are disabled. |
'Plotting not available.'
|
display_disabled
|
bool
|
If |
False
|
display_disabled_reason
|
str
|
Human-readable reason shown when rich display is disabled. |
'Display not available.'
|
Returns:
| Name | Type | Description |
|---|---|---|
PerfmonitorMagicAdapter |
PerfmonitorMagicAdapter
|
Adapter instance wrapping the service. |
Examples:
>>> from jumper_extension.core.service import (
... build_perfmonitor_magic_adapter,
... )
>>> adapter = build_perfmonitor_magic_adapter()
Source code in jumper_extension/core/service.py
1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 | |
Core service methods
Core methods control monitoring, plotting, and automatic per‑cell reports.
High-level performance monitoring service.
This service wires together monitoring, visualization, reporting, cell history, and script recording. It is the main entry point for using JUmPER from pure Python code.
Examples:
Build a default service::
from jumper_extension.core.service import (
build_perfmonitor_service,
)
service = build_perfmonitor_service()
Source code in jumper_extension/core/service.py
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 | |
start_monitoring(interval=None)
Start performance monitoring.
This method configures and starts the underlying performance monitor. If an offline (imported) session is currently attached, it is replaced with a new live monitor instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interval
|
Optional[float]
|
Sampling interval in seconds. If |
None
|
Returns:
| Type | Description |
|---|---|
Optional[ExtensionErrorCode]
|
Optional[ExtensionErrorCode]: An error code if monitoring |
Optional[ExtensionErrorCode]
|
was already running, otherwise |
Examples:
Start monitoring with the default interval::
service.start_monitoring()
Start monitoring with a custom interval::
service.start_monitoring(interval=0.5)
Source code in jumper_extension/core/service.py
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 | |
stop_monitoring()
Stop the active performance monitoring session.
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.stop_monitoring()
Source code in jumper_extension/core/service.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | |
enable_perfreports(level, interval=None, text=False)
Enable automatic performance reports after each cell.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
str
|
Monitoring level ( |
required |
interval
|
Optional[float]
|
Sampling interval in seconds. If provided, this value is used when starting monitoring. |
None
|
text
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
Enable HTML reports at process level::
service.enable_perfreports(level="process")
Enable text reports with a custom interval::
service.enable_perfreports(
level="user",
interval=0.5,
text=True,
)
Source code in jumper_extension/core/service.py
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 | |
disable_perfreports()
Disable automatic performance reports after cell execution.
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.disable_perfreports()
Source code in jumper_extension/core/service.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | |
show_perfreport(cell_range=None, level=None, text=False)
Show a performance report for the current session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell_range
|
Optional[Tuple[int, int]]
|
Optional tuple |
None
|
level
|
Optional[str]
|
Optional monitoring level override. If |
None
|
text
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
Show a report for all cells::
service.show_perfreport()
Show a report for cells 2 through 5 at system level::
service.show_perfreport(
cell_range=(2, 5),
level="system",
)
Source code in jumper_extension/core/service.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 | |
plot_performance(metrics=None, cell_range=None, level=None, save_jpeg=None, pickle_file=None)
Open an interactive performance plot.
Works for both live and imported sessions. Uses the attached
visualizer to display metrics and interactive widgets. When
level is provided (or inferred for exports), the plot is
rendered directly without ipywidgets, which also enables JPEG
and pickle exports.
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.plot_performance()
>>> service.plot_performance(
... metrics=["cpu_summary", "memory"],
... level="process",
... cell_range=(0, 3),
... )
Source code in jumper_extension/core/service.py
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 | |
Data access and export
The service exposes helpers for accessing collected data as pandas
DataFrame objects and exporting or loading them from disk.
High-level performance monitoring service.
This service wires together monitoring, visualization, reporting, cell history, and script recording. It is the main entry point for using JUmPER from pure Python code.
Examples:
Build a default service::
from jumper_extension.core.service import (
build_perfmonitor_service,
)
service = build_perfmonitor_service()
Source code in jumper_extension/core/service.py
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 | |
export_perfdata(file=None, level=None, name=None)
Export performance data or return it as data frames.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
Optional[str]
|
Optional target file path. If provided, data is
written using the monitor's data adapter. If |
None
|
level
|
Optional[str]
|
Optional monitoring level override. If |
None
|
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, DataFrame]]
|
Optional[Dict[str, pandas.DataFrame]]: If |
Optional[Dict[str, DataFrame]]
|
|
Optional[Dict[str, DataFrame]]
|
|
Examples:
Export metrics to a CSV file::
service.export_perfdata(
file="performance.csv",
level="process",
)
Get a DataFrame in memory::
frames = service.export_perfdata()
df = next(iter(frames.values()))
Source code in jumper_extension/core/service.py
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 | |
load_perfdata(file)
Load performance data from a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
str
|
Path to a CSV or JSON file containing performance data. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, DataFrame]]
|
Optional[Dict[str, pandas.DataFrame]]: Mapping from the |
Optional[Dict[str, DataFrame]]
|
configured variable name to the loaded data frame. |
Examples:
>>> frames = service.load_perfdata("performance.csv")
>>> df = next(iter(frames.values()))
Source code in jumper_extension/core/service.py
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 | |
export_cell_history(file=None, name=None)
Export cell history or return it as a data frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
Optional[str]
|
Optional target file path. If provided, the cell
history is written to disk. If |
None
|
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, DataFrame]]
|
Optional[Dict[str, pandas.DataFrame]]: If |
Optional[Dict[str, DataFrame]]
|
|
Optional[Dict[str, DataFrame]]
|
|
Examples:
Export cell history to CSV::
service.export_cell_history(file="cells.csv")
Get the history as a DataFrame::
frames = service.export_cell_history()
df = next(iter(frames.values()))
Source code in jumper_extension/core/service.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 520 521 522 523 524 525 526 527 528 529 530 531 532 | |
load_cell_history(file)
Load cell history from a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
str
|
Path to a CSV or JSON file containing cell history. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, DataFrame]]
|
Optional[Dict[str, pandas.DataFrame]]: Mapping from the |
Optional[Dict[str, DataFrame]]
|
configured variable name to the loaded data frame. |
Examples:
>>> frames = service.load_cell_history("cells.csv")
>>> df = next(iter(frames.values()))
Source code in jumper_extension/core/service.py
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 | |
Sessions, scripts, and utilities
For higher‑level workflows, the service also exposes helpers for resources, sessions, and script recording.
For direct interaction with string‑based commands or IPython magics, see the String Based API and Jupyter API sections.
High-level performance monitoring service.
This service wires together monitoring, visualization, reporting, cell history, and script recording. It is the main entry point for using JUmPER from pure Python code.
Examples:
Build a default service::
from jumper_extension.core.service import (
build_perfmonitor_service,
)
service = build_perfmonitor_service()
Source code in jumper_extension/core/service.py
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 | |
show_resources()
Display available hardware resources.
Prints information about CPUs, memory, and GPUs available to the current or imported session.
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.show_resources()
Source code in jumper_extension/core/service.py
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 | |
show_cell_history()
Show an interactive table of executed cells.
Displays the tracked cell history using an interactive table widget, if available.
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.show_cell_history()
Source code in jumper_extension/core/service.py
162 163 164 165 166 167 168 169 170 171 172 173 174 | |
export_session(path=None)
Export the full monitoring session.
This uses :class:SessionExporter to write performance data
and cell history to a directory or zip archive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Optional[str]
|
Optional target directory or |
None
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
Export to a directory::
service.export_session("session-dir")
Export to a zip archive::
service.export_session("session.zip")
Source code in jumper_extension/core/service.py
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 | |
import_session(path)
Import a monitoring session from disk.
Uses :class:SessionImporter to attach performance data and
cell history from the given directory or zip archive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Directory or |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.import_session("session.zip")
Source code in jumper_extension/core/service.py
587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 | |
fast_setup()
Quickly start monitoring with per-cell reports enabled.
This convenience helper starts monitoring with a one-second
interval and enables HTML performance reports at the process
level.
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.fast_setup()
Source code in jumper_extension/core/service.py
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 | |
start_script_recording(output_path=None)
Start recording code from cells to a Python script.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_path
|
Optional[str]
|
Optional path to the output script file. If
|
None
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
Start recording to an auto-generated file::
service.start_script_recording()
Record to a specific script path::
service.start_script_recording("analysis_script.py")
Source code in jumper_extension/core/service.py
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 | |
stop_script_recording()
Stop recording and save accumulated code to a script file.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
Optional[str]: Path to the saved script file, or |
Optional[str]
|
if recording was not active or no cells were captured. |
Examples:
>>> path = service.stop_script_recording()
>>> print(path)
Source code in jumper_extension/core/service.py
655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 | |
monitored()
Context manager for monitoring a code block.
This helper simulates a virtual cell: it registers a synthetic cell before the block and finalizes it afterwards so that the enclosed code is tracked like any other cell.
Yields:
| Name | Type | Description |
|---|---|---|
PerfmonitorService |
PerfmonitorService
|
The current service instance, for |
PerfmonitorService
|
optional use inside the context. |
Examples:
Use the service as a monitoring context::
with service.monitored():
do_expensive_work()
Source code in jumper_extension/core/service.py
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 | |