deephaven_enterprise.notebook

This module provides a way for users to modularize their Deephaven Web console notebooks and import and execute them as Python modules.

exec_notebook(db, path, globals=None)[source]

Executes a Deephaven Web console notebook.

Parameters:
  • db (Database) – Core+ Python Database object

  • path (str) – full path to Notebook, beginning with “/”

  • globals (dict[str, Any]) – the globals to use for execution of the notebook, if you want to have the variables from your script session available use “globals()”

Return type:

None

meta_import(db, root='notebook')[source]

Sets up a meta importer to enable using a Python import statement that references Deephaven Web console notebooks.

For example, after calling ‘meta_import(db, “notebook”)’; you can then call ‘import notebook.file’ to make the “/file.py” in your Web File Explorer available as a Python module.

Note: implicitly populated global objects like ‘db’, ‘performance_overview’, etc., in the main module are not automatically available in the imported module. You must explicitly import them or pass them as arguments to functions in the module. To import them, you can use the following:

from deephaven_enterprise.database import db

from deephaven_enterprise.performance_overview import performance_overview

Parameters:
  • db (Database) – Core+ Python Database object

  • root (str) – the module name that prefixes all web notebooks, defaults to “notebook”

Return type:

None