Skip to content

Latest commit

 

History

History
50 lines (43 loc) · 1.15 KB

File metadata and controls

50 lines (43 loc) · 1.15 KB

Commit message rules

  • start with verb in infinitive form
  • be reasonably specific
  • e.g. "Add new sinogram plotting function to tools/sinogram.py"
  • add WIP to the begining of commit message if changes are not ready for implementation

Importing convetions

  • never use star imports eg.
# NEVER use
from numpy import *
# correct way
import numpy as np

shortcuts for modules

  • np for numpy
  • plt for matplotlib.pyplot

Docstrings

class Foo(object):
    """
    First line of docstring with class description
    
    Attributes
    ----------
    attr
        sum of first two parameters
    """
    def __init__(self, param1, param2):
        """
        Documentation of __init__
        
        Parameters
        ----------
        param1
            first param of __init__
        param2
            second param of __init__
        """ 
        self.attr = param1 + param2
        return