Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

kernel_name argument of papermill.execute seems to have no effect. #856

Open
@m-d-grunnill

Description

@m-d-grunnill

🐛 Bug

The kernel_name argument of papermill.execute seems to have no effect. The executing notebook uses the Jupyter kernel specified in the original notebook's metatdata. Using papermill v2.6.0. Or at least the display_name in the metadata is unchanged, this is what jupyter hub uses to display the name of the kernal being used.

Something along the lines of this function should fix this:

importnbformatasnbfdefchange_notebook_kernel(input_path,output_path,kernel):"""    Change a Jupyter Notebook's kernel.    Parameters    ----------    input_path: str        Path to the input notebook.    output_path: str        Path to the output notebook.    kernel: str        Name of the kernel_name to change to.    """notebook=nbf.read(input_path,as_version=4)notebook['metadata']['kernelspec']['name']=kernelnotebook['metadata']['kernelspec']['display_name']=kernelnbf.write(notebook,output_path)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp