Beispiel #1
0
def run_notebook(ipython_arguments):
    ipython_arguments.extend(['--ext', 'django_extensions.management.notebook_extension'])
    sh.ipython('notebook', *ipython_arguments, _bg=True, _env={
        'PYTHONPATH' : settings.PROJECT_ROOT,
        'DJANGO_SETTINGS_MODULE' : 'settings',
        'LD_LIBRARY_PATH' : os.path.join(os.environ['VIRTUAL_ENV'], 'lib')
    })
Beispiel #2
0
    def start_notebook(self):
        """
        Start a notebook on the local machine.
        :return:
        """

        base_command = "notebook --existing %(kernel_name)s"
        fill_ins = {"kernel_name": self.kernel_name}

        sh.ipython(base_command % fill_ins)
Beispiel #3
0
def setup_ipython(scheduler, queues):
    for ptype, queue in zip(["", "multicore"], queues):
        if ptype:
            profile = "%s_%s" % (scheduler, ptype)
        else:
            profile = scheduler
        sh.ipython("profile", "create", reset=True, parallel=True, profile=profile)
        config_dir = _find_ipython_dir(profile)
        update_ipcontroller_config(config_dir)
        update_ipcluster_config(config_dir, scheduler, ptype, queue)
Beispiel #4
0
def run_notebook(ipython_arguments):
    ipython_arguments.extend(
        ['--ext', 'django_extensions.management.notebook_extension'])
    sh.ipython('notebook',
               *ipython_arguments,
               _bg=True,
               _env={
                   'PYTHONPATH':
                   settings.PROJECT_ROOT,
                   'DJANGO_SETTINGS_MODULE':
                   'settings',
                   'LD_LIBRARY_PATH':
                   os.path.join(os.environ['VIRTUAL_ENV'], 'lib')
               })