Skip to content

Move function definitions to a module #4

@janxkoci

Description

@janxkoci

I recommend moving definitions of functions from the notebooks into a module (which can be a simple python script file). This will provide the following benefits:

  1. Make the notebooks more clean and readable, as they will mostly contain plots made by calls to functions defined separately.
  2. Make easier to track changes to the function definitions, since it will be in standard python script file(s), rather than embedded inside a notebook. This in turn will facilitate contributions from users that don't know or use Jupyter notebooks.

I mostly use Jupyter notebooks with R, but I use this approach constantly and it works great. I think a good start would be to move all the cells with def statements and module imports into separate functions.py file, which can then be loaded at the top of the notebook.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions