QInfer/python-qinfer

View on GitHub
src/qinfer/tests/test_precession_model.py

Summary

Maintainability
A
0 mins
Test Coverage

Cyclomatic complexity is too high in method test_bim. (6)
Open

    def test_bim(self):
        """
        Checks that the fitters converge on true value on simple precession_model. Is a stochastic
        test but I ran 100 times and there were no fails, with these parameters.
        """

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Indentation contains tabs
Open

    PRIOR = UniformDistribution([[0,2]])

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Trailing whitespace
Open

        self.num_precession_model = NumericalSimplePrecessionModel() 

Trailing whitespace is superfluous.

The warning returned varies on whether the line itself is blank,
for easier filtering for those who want to indent their blank lines.

Okay: spam(1)\n#
W291: spam(1) \n#
W293: class Foo(object):\n    \n    bang = 12

Line too long (85 > 79 characters)
Open

        assert_almost_equal(self.num_updater_bayes.est_mean(),TestSMCUpdater.MODELPARAMS,2)

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Whitespace before ')'
Open

                TestSMCUpdater.TEST_EXPPARAMS,repeat=1 ).reshape(-1,1)

Avoid extraneous whitespace.

Avoid extraneous whitespace in these situations:
- Immediately inside parentheses, brackets or braces.
- Immediately before a comma, semicolon, or colon.

Okay: spam(ham[1], {eggs: 2})
E201: spam( ham[1], {eggs: 2})
E201: spam(ham[ 1], {eggs: 2})
E201: spam(ham[1], { eggs: 2})
E202: spam(ham[1], {eggs: 2} )
E202: spam(ham[1 ], {eggs: 2})
E202: spam(ham[1], {eggs: 2 })

E203: if x == 4: print x, y; x, y = y , x
E203: if x == 4: print x, y ; x, y = y, x
E203: if x == 4 : print x, y; x, y = y, x

Missing whitespace after ','
Open

                TestSMCUpdater.TEST_EXPPARAMS,repeat=1 ).reshape(-1,1)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR,adaptive=True)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

    # True model parameter for test

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR,adaptive=True)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

    TEST_EXPPARAMS = np.linspace(1.,10.,100,dtype=np.float)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

    PRIOR = UniformDistribution([[0,2]])

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Continuation line under-indented for visual indent
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR)

Continuation lines indentation.

Continuation lines should align wrapped elements either vertically
using Python's implicit line joining inside parentheses, brackets
and braces, or using a hanging indent.

When using a hanging indent these considerations should be applied:
- there should be no arguments on the first line, and
- further indentation should be used to clearly distinguish itself
  as a continuation line.

Okay: a = (\n)
E123: a = (\n    )

Okay: a = (\n    42)
E121: a = (\n   42)
E122: a = (\n42)
E123: a = (\n    42\n    )
E124: a = (24,\n     42\n)
E125: if (\n    b):\n    pass
E126: a = (\n        42)
E127: a = (24,\n      42)
E128: a = (24,\n    42)
E129: if (a or\n    b):\n    pass
E131: a = (\n    42\n 24)

Indentation contains tabs
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR,adaptive=True)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        self.updater.batch_update(self.outcomes,self.expparams)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

from qinfer.smc import SMCUpdater,SMCUpdaterBCRB

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Expected 2 blank lines, found 1
Open

class NumericalSimplePrecessionModel(ScoreMixin, SimplePrecessionModel):

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Missing whitespace after ','
Open

    MODELPARAMS = np.array([1,])

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        assert_almost_equal(self.updater.est_mean(),TestSMCUpdater.MODELPARAMS,2)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Continuation line under-indented for visual indent
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR)

Continuation lines indentation.

Continuation lines should align wrapped elements either vertically
using Python's implicit line joining inside parentheses, brackets
and braces, or using a hanging indent.

When using a hanging indent these considerations should be applied:
- there should be no arguments on the first line, and
- further indentation should be used to clearly distinguish itself
  as a continuation line.

Okay: a = (\n)
E123: a = (\n    )

Okay: a = (\n    42)
E121: a = (\n   42)
E122: a = (\n42)
E123: a = (\n    42\n    )
E124: a = (24,\n     42\n)
E125: if (\n    b):\n    pass
E126: a = (\n        42)
E127: a = (24,\n      42)
E128: a = (24,\n    42)
E129: if (a or\n    b):\n    pass
E131: a = (\n    42\n 24)

Line too long (92 > 79 characters)
Open

        Checks that the fitters converge on true value on simple precession_model. Is a stochastic

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Indentation contains tabs
Open

        test but I ran 100 times and there were no fails, with these parameters.

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

    TEST_EXPPARAMS = np.linspace(1.,10.,100,dtype=np.float)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

        super(TestSMCUpdater,self).setUp()

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert_almost_equal(self.num_updater.est_mean(),TestSMCUpdater.MODELPARAMS,2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

        assert_almost_equal(self.num_updater_bayes.est_mean(),TestSMCUpdater.MODELPARAMS,2)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Continuation line under-indented for visual indent
Open

                TestSMCUpdater.TEST_EXPPARAMS,repeat=1 ).reshape(-1,1)

Continuation lines indentation.

Continuation lines should align wrapped elements either vertically
using Python's implicit line joining inside parentheses, brackets
and braces, or using a hanging indent.

When using a hanging indent these considerations should be applied:
- there should be no arguments on the first line, and
- further indentation should be used to clearly distinguish itself
  as a continuation line.

Okay: a = (\n)
E123: a = (\n    )

Okay: a = (\n    42)
E121: a = (\n   42)
E122: a = (\n42)
E123: a = (\n    42\n    )
E124: a = (24,\n     42\n)
E125: if (\n    b):\n    pass
E126: a = (\n        42)
E127: a = (24,\n      42)
E128: a = (24,\n    42)
E129: if (a or\n    b):\n    pass
E131: a = (\n    42\n 24)

Indentation contains tabs
Open

        self.updater = SMCUpdater(self.precession_model,

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR,adaptive=True)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Too many blank lines (2)
Open

    def test_smc_fitting(self):

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Block comment should start with '# '
Open

        #Assert that models have learned true model parameters from data 

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Indentation contains tabs
Open

        for i in range(self.outcomes.shape[0]):            

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert not np.all(bim_adaptives == bim_adaptives[0,...])

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

                TestSMCUpdater.TEST_EXPPARAMS,repeat=1 ).reshape(-1,1)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        self.updater_bayes.batch_update(self.outcomes,self.expparams)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

        assert_almost_equal(self.num_updater_bayes.est_mean(),TestSMCUpdater.MODELPARAMS,2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

        assert_array_less(self.updater.est_covariance_mtx(),TestSMCUpdater.TEST_TARGET_COV)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        bim_adaptives = []

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Block comment should start with '# '
Open

        #track bims throughout experiments

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Block comment should start with '# '
Open

        #verify that BCRB is approximately reached 

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Missing whitespace after ','
Open

        super(TestSMCUpdater,self).setUp()

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

        self.precession_model = SimplePrecessionModel()

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        """

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        #track bims throughout experiments

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Trailing whitespace
Open

        for i in range(self.outcomes.shape[0]):            

Trailing whitespace is superfluous.

The warning returned varies on whether the line itself is blank,
for easier filtering for those who want to indent their blank lines.

Okay: spam(1)\n#
W291: spam(1) \n#
W293: class Foo(object):\n    \n    bang = 12

Indentation contains tabs
Open

            bim_adaptives.append(self.updater_bayes.adaptive_bim)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        #compare numerical and analytical bims 

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert_almost_equal(self.updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.adaptive_bim),2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

    TEST_EXPPARAMS = np.linspace(1.,10.,100,dtype=np.float)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Line too long (87 > 79 characters)
Open

        self.outcomes = self.precession_model.simulate_experiment(TestSMCUpdater.MODELPARAMS,

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Indentation contains tabs
Open

        self.outcomes = self.precession_model.simulate_experiment(TestSMCUpdater.MODELPARAMS,

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        self.updater_bayes = SMCUpdaterBCRB(self.precession_model,

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Continuation line under-indented for visual indent
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR,adaptive=True)

Continuation lines indentation.

Continuation lines should align wrapped elements either vertically
using Python's implicit line joining inside parentheses, brackets
and braces, or using a hanging indent.

When using a hanging indent these considerations should be applied:
- there should be no arguments on the first line, and
- further indentation should be used to clearly distinguish itself
  as a continuation line.

Okay: a = (\n)
E123: a = (\n    )

Okay: a = (\n    42)
E121: a = (\n   42)
E122: a = (\n42)
E123: a = (\n    42\n    )
E124: a = (24,\n     42\n)
E125: if (\n    b):\n    pass
E126: a = (\n        42)
E127: a = (24,\n      42)
E128: a = (24,\n    42)
E129: if (a or\n    b):\n    pass
E131: a = (\n    42\n 24)

Missing whitespace after ','
Open

        self.num_updater.batch_update(self.outcomes,self.expparams)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Trailing whitespace
Open

        #Assert that models have learned true model parameters from data 

Trailing whitespace is superfluous.

The warning returned varies on whether the line itself is blank,
for easier filtering for those who want to indent their blank lines.

Okay: spam(1)\n#
W291: spam(1) \n#
W293: class Foo(object):\n    \n    bang = 12

Block comment should start with '# '
Open

        #test means

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Missing whitespace after ','
Open

        assert_almost_equal(self.updater_bayes.est_mean(),TestSMCUpdater.MODELPARAMS,2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

        assert_almost_equal(self.num_updater.est_mean(),TestSMCUpdater.MODELPARAMS,2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

        assert_array_less(self.updater.est_covariance_mtx(),TestSMCUpdater.TEST_TARGET_COV)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

        assert_array_less(self.updater_bayes.est_covariance_mtx(),TestSMCUpdater.TEST_TARGET_COV)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Line too long (111 > 79 characters)
Open

        assert_almost_equal(self.updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.adaptive_bim),2)

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Missing whitespace after ','
Open

        assert_almost_equal(self.num_updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.current_bim),2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

    N_PARTICLES = 10000

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        self.expparams = TestSMCUpdater.TEST_EXPPARAMS.reshape(-1,1)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

                TestSMCUpdater.TEST_EXPPARAMS,repeat=1 ).reshape(-1,1)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR,adaptive=True)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR,adaptive=True)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

    def test_smc_fitting(self):

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        """

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        self.num_updater.batch_update(self.outcomes,self.expparams)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Line too long (85 > 79 characters)
Open

        assert_array_less(self.updater.est_covariance_mtx(),TestSMCUpdater.TEST_TARGET_COV)

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Block comment should start with '# '
Open

        #verify that array copying of properties is working

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Too many blank lines (3)
Open

class TestSMCUpdater(DerandomizedTestCase):

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Indentation contains mixed spaces and tabs
Open

    # True model parameter for test

Never mix tabs and spaces.

The most popular way of indenting Python is with spaces only.  The
second-most popular way is with tabs only.  Code indented with a
mixture of tabs and spaces should be converted to using spaces
exclusively.  When invoking the Python command line interpreter with
the -t option, it issues warnings about code that illegally mixes
tabs and spaces.  When using -tt these warnings become errors.
These options are highly recommended!

Okay: if a == 0:\n    a = 1\n    b = 1
E101: if a == 0:\n        a = 1\n\tb = 1

Indentation contains tabs
Open

        self.num_precession_model = NumericalSimplePrecessionModel() 

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

        self.num_updater_bayes.batch_update(self.outcomes,self.expparams)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

            self.num_updater_bayes.update(self.outcomes[i],self.expparams[i])

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

            bim_currents.append(self.updater_bayes.current_bim)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        num_bim_adaptives = np.array(num_bim_adaptives)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        #verify that array copying of properties is working

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        assert not np.all(num_bim_adaptives == num_bim_adaptives[0,...])

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Line too long (115 > 79 characters)
Open

        assert_almost_equal(self.num_updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.adaptive_bim),2)

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

At least two spaces before inline comment
Open

from __future__ import division # Ensures that a/b is always a float.

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Indentation contains tabs
Open

    TEST_EXPPARAMS = np.linspace(1.,10.,100,dtype=np.float)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        self.expparams = TestSMCUpdater.TEST_EXPPARAMS.reshape(-1,1)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Continuation line under-indented for visual indent
Open

                TestSMCUpdater.N_PARTICLES,TestSMCUpdater.PRIOR,adaptive=True)

Continuation lines indentation.

Continuation lines should align wrapped elements either vertically
using Python's implicit line joining inside parentheses, brackets
and braces, or using a hanging indent.

When using a hanging indent these considerations should be applied:
- there should be no arguments on the first line, and
- further indentation should be used to clearly distinguish itself
  as a continuation line.

Okay: a = (\n)
E123: a = (\n    )

Okay: a = (\n    42)
E121: a = (\n   42)
E122: a = (\n42)
E123: a = (\n    42\n    )
E124: a = (24,\n     42\n)
E125: if (\n    b):\n    pass
E126: a = (\n        42)
E127: a = (24,\n      42)
E128: a = (24,\n    42)
E129: if (a or\n    b):\n    pass
E131: a = (\n    42\n 24)

Indentation contains tabs
Open

        #Assert that models have learned true model parameters from data 

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Line too long (92 > 79 characters)
Open

        Checks that the fitters converge on true value on simple precession_model. Is a stochastic

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Indentation contains tabs
Open

        Checks that the fitters converge on true value on simple precession_model. Is a stochastic

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert_almost_equal(bim_currents,num_bim_currents,2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

        assert_almost_equal(bim_adaptives,num_bim_adaptives,2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

        assert_almost_equal(self.updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.current_bim),2)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert_almost_equal(self.updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.current_bim),2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

        self.num_updater_bayes = SMCUpdaterBCRB(self.num_precession_model,

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        """

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        self.num_updater_bayes.batch_update(self.outcomes,self.expparams)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

        assert_almost_equal(self.updater_bayes.est_mean(),TestSMCUpdater.MODELPARAMS,2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

        test but I ran 100 times and there were no fails, with these parameters.

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        assert_almost_equal(self.num_updater.est_mean(),TestSMCUpdater.MODELPARAMS,2)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        """

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert_almost_equal(self.num_updater_bayes.est_mean(),TestSMCUpdater.MODELPARAMS,2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

            self.updater_bayes.update(self.outcomes[i],self.expparams[i])

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        #test covs 

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

            self.updater_bayes.update(self.outcomes[i],self.expparams[i])

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Line too long (95 > 79 characters)
Open

        assert_array_less(self.num_updater_bayes.est_covariance_mtx(),TestSMCUpdater.TEST_TARGET_COV)

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Indentation contains tabs
Open

        assert_almost_equal(bim_currents,num_bim_currents,2)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

            num_bim_adaptives.append(self.num_updater_bayes.adaptive_bim)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        bim_currents = np.array(bim_currents)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert not np.all(num_bim_currents == num_bim_currents[0,...])

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

        assert_almost_equal(bim_currents,num_bim_currents,2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

        #verify that BCRB is approximately reached 

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert_almost_equal(self.num_updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.current_bim),2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

    MODELPARAMS = np.array([1,])

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

    TEST_TARGET_COV = np.array([[0.01]])

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

    def setUp(self):

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        self.num_updater = SMCUpdater(self.num_precession_model,

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        self.updater.batch_update(self.outcomes,self.expparams)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        self.updater_bayes.batch_update(self.outcomes,self.expparams)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert_almost_equal(self.updater.est_mean(),TestSMCUpdater.MODELPARAMS,2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Line too long (81 > 79 characters)
Open

        assert_almost_equal(self.updater_bayes.est_mean(),TestSMCUpdater.MODELPARAMS,2)

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Too many blank lines (2)
Open

        #Assert that covariances have been reduced below thresholds

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Indentation contains tabs
Open

        assert_array_less(self.updater_bayes.est_covariance_mtx(),TestSMCUpdater.TEST_TARGET_COV)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert_array_less(self.num_updater.est_covariance_mtx(),TestSMCUpdater.TEST_TARGET_COV)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

        assert not np.all(bim_currents == bim_currents[0,...])

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

        Checks that the fitters converge on true value on simple precession_model. Is a stochastic

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        #test means

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert_almost_equal(self.updater.est_mean(),TestSMCUpdater.MODELPARAMS,2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

        assert_almost_equal(self.updater_bayes.est_mean(),TestSMCUpdater.MODELPARAMS,2)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

            self.num_updater_bayes.update(self.outcomes[i],self.expparams[i])

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        assert not np.all(bim_currents == bim_currents[0,...])

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        assert not np.all(bim_adaptives == bim_adaptives[0,...])

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Trailing whitespace
Open

        #verify that BCRB is approximately reached 

Trailing whitespace is superfluous.

The warning returned varies on whether the line itself is blank,
for easier filtering for those who want to indent their blank lines.

Okay: spam(1)\n#
W291: spam(1) \n#
W293: class Foo(object):\n    \n    bang = 12

Missing whitespace after ','
Open

        assert_almost_equal(self.num_updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.adaptive_bim),2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

        assert_array_less(self.num_updater.est_covariance_mtx(),TestSMCUpdater.TEST_TARGET_COV)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert_array_less(self.num_updater_bayes.est_covariance_mtx(),TestSMCUpdater.TEST_TARGET_COV)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Trailing whitespace
Open

        #compare numerical and analytical bims 

Trailing whitespace is superfluous.

The warning returned varies on whether the line itself is blank,
for easier filtering for those who want to indent their blank lines.

Okay: spam(1)\n#
W291: spam(1) \n#
W293: class Foo(object):\n    \n    bang = 12

Block comment should start with '# '
Open

        #compare numerical and analytical bims 

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Indentation contains tabs
Open

        assert_almost_equal(bim_adaptives,num_bim_adaptives,2)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        assert not np.all(num_bim_currents == num_bim_currents[0,...])

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert_almost_equal(self.updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.adaptive_bim),2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Indentation contains tabs
Open

        assert_almost_equal(self.num_updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.current_bim),2)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        #Assert that covariances have been reduced below thresholds

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        assert_array_less(self.num_updater_bayes.est_covariance_mtx(),TestSMCUpdater.TEST_TARGET_COV)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        bim_currents = []

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        num_bim_adaptives = []

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Too many blank lines (2)
Open

        #verify that BCRB is approximately reached 

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Line too long (110 > 79 characters)
Open

        assert_almost_equal(self.updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.current_bim),2)

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Indentation contains tabs
Open

        assert_almost_equal(self.num_updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.adaptive_bim),2)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Block comment should start with '# '
Open

        #test covs 

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Indentation contains tabs
Open

    def test_bim(self):

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Block comment should start with '# '
Open

        #Assert that covariances have been reduced below thresholds

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Indentation contains tabs
Open

            num_bim_currents.append(self.num_updater_bayes.current_bim)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Line too long (91 > 79 characters)
Open

        assert_array_less(self.updater_bayes.est_covariance_mtx(),TestSMCUpdater.TEST_TARGET_COV)

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Indentation contains tabs
Open

        bim_adaptives = np.array(bim_adaptives)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        num_bim_currents = np.array(num_bim_currents)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Trailing whitespace
Open

        #test covs 

Trailing whitespace is superfluous.

The warning returned varies on whether the line itself is blank,
for easier filtering for those who want to indent their blank lines.

Okay: spam(1)\n#
W291: spam(1) \n#
W293: class Foo(object):\n    \n    bang = 12

Missing whitespace after ','
Open

        assert_almost_equal(self.updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.current_bim),2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Line too long (89 > 79 characters)
Open

        assert_array_less(self.num_updater.est_covariance_mtx(),TestSMCUpdater.TEST_TARGET_COV)

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Indentation contains tabs
Open

        assert_almost_equal(self.updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.adaptive_bim),2)

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Indentation contains tabs
Open

        num_bim_currents = []

On new projects, spaces-only are strongly recommended over tabs.

Okay: if True:\n    return
W191: if True:\n\treturn

Missing whitespace after ','
Open

        assert_almost_equal(bim_adaptives,num_bim_adaptives,2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

        assert not np.all(num_bim_adaptives == num_bim_adaptives[0,...])

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Line too long (114 > 79 characters)
Open

        assert_almost_equal(self.num_updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.current_bim),2)

Limit all lines to a maximum of 79 characters.

There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side.  The default wrapping on such
devices looks ugly.  Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.

Reports error E501.

Missing whitespace after ','
Open

        assert_almost_equal(self.num_updater_bayes.est_covariance_mtx(),np.linalg.inv(self.updater_bayes.adaptive_bim),2)

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

There are no issues that match your filters.

Category
Status