Skip to content

style guide #404

Description

@orbeckst

With an active and diverse developer community we need to spell out more clearly what we want the code to look like, i.e. we need a Style Guide.

Related questions have come up recently in #392 and #393 but there are also the recurring discussions about length of lines etc., in particular see #216 !

A very basic guideline consists of the editor settings:

# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
  • only use spaces for indentation
  • one level of indentation equals 4 spaces

Generally, PEP 8 is a good starting point (see #216 )

Either edit this post or add a comment and someone will add an item to the list below.

Questions to settle

Code

  • line length (80 79 chars)
  • indentation (spaces, 4 per level)
  • imports (absolute, aliasing eg import numpy as np import numpy as np #392)
  • capitalization (underscore_methods, CapitalClasses, etc as per pep8)
  • camelCase or underscores (underscores, see goodBye camelCase #389)
  • add style checker to travis (nope, but encourage style helpers)
  • Where does Cython code live Source file locations #444 ?

Testing

Documentation

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions