| 247 | |
| 248 | |
| 249 | class PapermillEnvironment(IPythonZMQEnvironment): |
| 250 | name = "Papermill Environment" |
| 251 | |
| 252 | def _get_notebook_path(self) -> Path: |
| 253 | user_ns = get_ipython_user_ns() |
| 254 | if path := user_ns.get("PAPERMILL_OUTPUT_PATH", None): |
| 255 | return Path(path) |
| 256 | return super()._get_notebook_path() |
| 257 | |
| 258 | @cached_property |
| 259 | def support_rich_display(self) -> bool: # type: ignore[override] |
| 260 | return get_ipython_user_ns().get("DP_SERVER_RUNNER", False) |