Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • I IMP3
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 28
    • Issues 28
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • IMP
  • IMP3
  • Issues
  • #43

Closed
Open
Created Aug 27, 2021 by Valentina Galata@valentina.galataMaintainer

Formatting convention

Formatting convention

Define a formatting convention and clean up the code according to the new guidelines.

The formatting convention is defined in the Wiki.

To define:

  • rule structure template/guidelines
  • Python:
    • PEP8
    • 4 spaces instead of tabs
    • double or single quotes?
    • comments: reStructered Text or NumPy/SciPy?
  • settings access
    • either only global variables or config
    • if global variables, then these should be defined in one place

To try:

  • code quality checker (linter): snakemake --lint
    • highlights issues to be solved to follow best practices
    • highly recommended before publishing workflows
  • automatic formatter: Snakefmt, based on Black

References:

  • Python docstring formats

Code "cleaning"

  • changes w.r.t. formatting conventions mentioned above
    • Python code
    • snakemake rules
    • (other scripts)
  • add comments where possible
  • one place for all helper functions
    • no variables/functions inside rule files
  • use os.path utils when working with paths
  • replace code duplication with custom functions
  • consistent indentation
  • Q: can we simplify the structure in workflow/rules/ ???
Edited Sep 07, 2021 by Valentina Galata
Assignee
Assign to
Time tracking