Skip to content

Contribution Guideline #1119

@mingxin-zheng

Description

@mingxin-zheng

Is your feature request related to a problem? Please describe.

MONAI tutorial repo lacks a guideline on how to contribute tutorials to the repository, which imposes burdens on maintainer.

Describe the solution you'd like

Adding a CONTRIBUTING.md to the root path.

A draft of the outline

  • Welcome message and introduction

  • Contributing process (similar to the process in the MONAI Core repo)

    • Submitting PR in GitHub
    • Signing the commits with git commit -s
    • Adding licensing/copyright information for new .ipynb and .py files
      • Code scripts: at the top
      • Jupyter notebook: first markdown block
    • As used in the MONAI repo, contributors first raise an issue, create a branch in contributor's forked repo (suggested by @yiheng-wang-nv).
    • Update the README.md in the root dir for new tutorials (suggested by @binliunls)
    • Info about how to test the tutorial changes in a user's local environment (suggested by @wyli) .
  • Style

    • Requirements (which will go through pre-commit checks/CI tests)
      • Add standard cellblocks "Setup environment" and "Setup imports" for every notebook.
        • "Setup environment" should include the pip commands !pip install to install MONAI and other necessary packages.
        • "Setup imports" should import all the library and end with monai.util.print_config().
      • Text outputs should be limited to avoid a large trunk of text outputs (maybe 50 lines should be the limit?)
      • Each folder should have a README.md (suggested by @KumoLiu).
    • Recommendations (won't be covered by tests, but reviewers will take a look)
      • If a dataset needs to be used with the script, contributor needs to provide links to the dataset and make a note about the dataset's licensing info. For example, some dataset may be used for non-commercial purposes only.
      • Avoid large files (dataset files, notebooks > 5M?)
      • Private information should be removed. For example, user name in the file paths in the notebook outputs and metadata.
      • Hyperlinks
        • avoid linking MONAI tutorial resources in the repo using web link (instead, use relative file paths)
        • avoid linking folders (folder links do not work well in Jupyter notebooks)
        • for graphs, it is recommended to download them and add to the repo in the ./figure folder
    • Encouragements (completely up to the contributors)
      • If both jupyter notebook and script are included, contributors can implement the code using torch or ignite separately (suggested by @KumoLiu )
      • Add multi-GPU implementation in the script (suggested by @KumoLiu )
  • Benchmarking

    • To meet the requirement of the MONAI Toolkit, A100 should be the standard device for benchmarking in all notebooks. (Contributors may have difficulties to get the computation resources. In that case, can the NV team do it after the initial PR is merged?)
  • CI Test Guide (suggested by @tangy5 )

    • documents of what CI will test and how to pass them

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