In [1]:
%%file calc.py
import numpy as np
def Calculator(x, y, method="sum"):
    return getattr(np, method)([x,y])

def testCalculator():
    assert Calculator(2,3, method="sum") == 5


Overwriting calc.py

In [2]:
import calc
calc.testCalculator()

In [3]:
!pep8 calc.py


calc.py:2:1: E302 expected 2 blank lines, found 0
calc.py:3:34: E231 missing whitespace after ','
calc.py:5:1: E302 expected 2 blank lines, found 1

In [4]:
%%file calc.py
# -- coding: utf-8 --
import numpy as np


def Calculator(x, y, method="sum"):
    return getattr(np, method)([x, y])


def testCalculator():
    assert Calculator(2, 3, method="sum") == 5


Overwriting calc.py

In [5]:
!pep8 calc.py

In [6]:
!pyflakes calc.py

In [7]:
!pylint calc.py


No config file found, using default configuration
************* Module calc
C:  1, 0: Missing module docstring (missing-docstring)
C:  5, 0: Invalid function name "Calculator" (invalid-name)
C:  5, 0: Invalid argument name "x" (invalid-name)
C:  5, 0: Invalid argument name "y" (invalid-name)
C:  5, 0: Missing function docstring (missing-docstring)
C:  9, 0: Invalid function name "testCalculator" (invalid-name)
C:  9, 0: Missing function docstring (missing-docstring)


Report
======
6 statements analysed.

Duplication
-----------

+-------------------------+------+---------+-----------+
|                         |now   |previous |difference |
+=========================+======+=========+===========+
|nb duplicated lines      |0     |NC       |NC         |
+-------------------------+------+---------+-----------+
|percent duplicated lines |0.000 |NC       |NC         |
+-------------------------+------+---------+-----------+



Messages by category
--------------------

+-----------+-------+---------+-----------+
|type       |number |previous |difference |
+===========+=======+=========+===========+
|convention |7      |NC       |NC         |
+-----------+-------+---------+-----------+
|refactor   |0      |NC       |NC         |
+-----------+-------+---------+-----------+
|warning    |0      |NC       |NC         |
+-----------+-------+---------+-----------+
|error      |0      |NC       |NC         |
+-----------+-------+---------+-----------+



Messages
--------

+------------------+------------+
|message id        |occurrences |
+==================+============+
|invalid-name      |4           |
+------------------+------------+
|missing-docstring |3           |
+------------------+------------+



Global evaluation
-----------------
Your code has been rated at -1.67/10

External dependencies
---------------------
::

    numpy (calc)



Raw metrics
-----------

+----------+-------+------+---------+-----------+
|type      |number |%     |previous |difference |
+==========+=======+======+=========+===========+
|code      |5      |55.56 |NC       |NC         |
+----------+-------+------+---------+-----------+
|docstring |0      |0.00  |NC       |NC         |
+----------+-------+------+---------+-----------+
|comment   |0      |0.00  |NC       |NC         |
+----------+-------+------+---------+-----------+
|empty     |4      |44.44 |NC       |NC         |
+----------+-------+------+---------+-----------+



Statistics by type
------------------

+---------+-------+-----------+-----------+------------+---------+
|type     |number |old number |difference |%documented |%badname |
+=========+=======+===========+===========+============+=========+
|module   |1      |NC         |NC         |0.00        |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|class    |0      |NC         |NC         |0           |0        |
+---------+-------+-----------+-----------+------------+---------+
|method   |0      |NC         |NC         |0           |0        |
+---------+-------+-----------+-----------+------------+---------+
|function |2      |NC         |NC         |0.00        |100.00   |
+---------+-------+-----------+-----------+------------+---------+




In [ ]: