QInfer/python-qinfer

View on GitHub
src/qinfer/distributions.py

Summary

Maintainability
F
6 days
Test Coverage

File distributions.py has 1036 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# distributions.py: module for probability distributions.
##
Severity: Major
Found in src/qinfer/distributions.py - About 2 days to fix

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

        def in_credible_region(self, points, level=0.95, modelparam_slice=None, method='hpd-hull', tol=0.0001):
            """
            Decides whether each of the points lie within a credible region
            of the current distribution.
    
    
    Severity: Minor
    Found in src/qinfer/distributions.py by radon

    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

    Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, weights, dist, dist_args=None, dist_kw_args=None, shuffle=True):
    Severity: Minor
    Found in src/qinfer/distributions.py - About 35 mins to fix

      Function in_credible_region has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def in_credible_region(self, points, level=0.95, modelparam_slice=None, method='hpd-hull', tol=0.0001):
      Severity: Minor
      Found in src/qinfer/distributions.py - About 35 mins to fix

        Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, n, alpha=None, beta=None, mean=None, var=None):
        Severity: Minor
        Found in src/qinfer/distributions.py - About 35 mins to fix

          Function in_credible_region has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def in_credible_region(self, points, level=0.95, modelparam_slice=None, method='hpd-hull', tol=0.0001):
                  """
                  Decides whether each of the points lie within a credible region
                  of the current distribution.
          
          
          Severity: Minor
          Found in src/qinfer/distributions.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          TODO found
          Open

                  #TODO: generalize this to general dimensions
          Severity: Minor
          Found in src/qinfer/distributions.py by fixme

          TODO found
          Open

              # TODO: rewrite LiuWestResampler in terms of this and a
          Severity: Minor
          Found in src/qinfer/distributions.py by fixme

          TODO found
          Open

                  # TODO: add basis as an option
          Severity: Minor
          Found in src/qinfer/distributions.py by fixme

          TODO found
          Open

                  # TODO: document
          Severity: Minor
          Found in src/qinfer/distributions.py by fixme

          TODO found
          Open

                  # TODO: document
          Severity: Minor
          Found in src/qinfer/distributions.py by fixme

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                      self.var = n * alpha * beta * (alpha + beta + n) / ((alpha + beta) ** 2 * (alpha + beta + 1))
          Severity: Major
          Found in src/qinfer/distributions.py and 1 other location - About 3 hrs to fix
          src/qinfer/tests/test_distributions.py on lines 328..328

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 67.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  g = (np.random.randn(self.dim,self.dim) + 1j*np.random.randn(self.dim,self.dim))/np.sqrt(2.0)
          Severity: Major
          Found in src/qinfer/distributions.py and 1 other location - About 2 hrs to fix
          src/qinfer/distributions.py on lines 1251..1251

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 55.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  z = (np.random.randn(self.dim,self.dim) + 1j*np.random.randn(self.dim,self.dim))/np.sqrt(2.0)
          Severity: Major
          Found in src/qinfer/distributions.py and 1 other location - About 2 hrs to fix
          src/qinfer/distributions.py on lines 1192..1192

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 55.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              def __init__(self, *factors):
                  if len(factors) == 1:
                      try:
                          self._factors = list(factors[0])
                      except:
          Severity: Major
          Found in src/qinfer/distributions.py and 1 other location - About 2 hrs to fix
          src/qinfer/domains.py on lines 171..177

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 51.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  cov = (
                      # This sum is a reduction over the particle index, chosen to be
                      # axis=2. Thus, the sum represents an expectation value over the
                      # outer product $x . x^T$.
                      #
          Severity: Major
          Found in src/qinfer/distributions.py and 1 other location - About 1 hr to fix
          src/qinfer/utils.py on lines 261..277

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 49.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                  x = np.real(np.dot(psi.conj(),np.dot(np.array([[0,1],[1,0]]),psi)))
          Severity: Major
          Found in src/qinfer/distributions.py and 2 other locations - About 1 hr to fix
          src/qinfer/distributions.py on lines 1263..1263
          src/qinfer/distributions.py on lines 1264..1264

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 44.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                  y = np.real(np.dot(psi.conj(),np.dot(np.array([[0,-1j],[1j,0]]),psi)))
          Severity: Major
          Found in src/qinfer/distributions.py and 2 other locations - About 1 hr to fix
          src/qinfer/distributions.py on lines 1263..1263
          src/qinfer/distributions.py on lines 1265..1265

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 44.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                  z = np.real(np.dot(psi.conj(),np.dot(np.array([[1,0],[0,-1]]),psi)))
          Severity: Major
          Found in src/qinfer/distributions.py and 2 other locations - About 1 hr to fix
          src/qinfer/distributions.py on lines 1264..1264
          src/qinfer/distributions.py on lines 1265..1265

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 44.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                      self.var = alpha * beta / ((alpha + beta) ** 2 * (alpha + beta + 1))
          Severity: Major
          Found in src/qinfer/distributions.py and 1 other location - About 1 hr to fix
          src/qinfer/tests/test_distributions.py on lines 297..297

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 43.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  z = np.random.randn(self.dim,self.dim) + 1j*np.random.randn(self.dim,self.dim)
          Severity: Major
          Found in src/qinfer/distributions.py and 1 other location - About 1 hr to fix
          src/qinfer/distributions.py on lines 1292..1292

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 43.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  z = np.random.randn(self.dim,self.k) + 1j*np.random.randn(self.dim,self.k)
          Severity: Major
          Found in src/qinfer/distributions.py and 1 other location - About 1 hr to fix
          src/qinfer/distributions.py on lines 1202..1202

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 43.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  if not np.all(la.eig(cov)[0] >= 0):
                      warnings.warn('Numerical error in covariance estimation causing positive semidefinite violation.', ApproximationWarning)
          Severity: Major
          Found in src/qinfer/distributions.py and 1 other location - About 1 hr to fix
          src/qinfer/utils.py on lines 284..285

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 42.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                  z = np.real(np.trace(np.dot(rho,np.array([[1,0],[0,-1]]))))
          Severity: Major
          Found in src/qinfer/distributions.py and 2 other locations - About 1 hr to fix
          src/qinfer/distributions.py on lines 1298..1298
          src/qinfer/distributions.py on lines 1299..1299

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 39.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                  y = np.real(np.trace(np.dot(rho,np.array([[0,-1j],[1j,0]]))))
          Severity: Major
          Found in src/qinfer/distributions.py and 2 other locations - About 1 hr to fix
          src/qinfer/distributions.py on lines 1297..1297
          src/qinfer/distributions.py on lines 1299..1299

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 39.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                  x = np.real(np.trace(np.dot(rho,np.array([[0,1],[1,0]]))))
          Severity: Major
          Found in src/qinfer/distributions.py and 2 other locations - About 1 hr to fix
          src/qinfer/distributions.py on lines 1297..1297
          src/qinfer/distributions.py on lines 1298..1298

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 39.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

              def sample(self, n=1):
                  return self.dist().rvs(size=n)[:, np.newaxis]
          Severity: Minor
          Found in src/qinfer/distributions.py and 1 other location - About 45 mins to fix
          src/qinfer/distributions.py on lines 876..877

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 35.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

              def sample(self, n=1):
                  return self.dist().rvs(size=n)[:, np.newaxis]
          Severity: Minor
          Found in src/qinfer/distributions.py and 1 other location - About 45 mins to fix
          src/qinfer/distributions.py on lines 969..970

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 35.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  if len(ranges.shape) == 1:
                      ranges = ranges[np.newaxis, ...]
          Severity: Minor
          Found in src/qinfer/distributions.py and 1 other location - About 30 mins to fix
          src/qinfer/distributions.py on lines 931..932

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 32.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  if len(ranges.shape) == 1:
                      ranges = ranges[np.newaxis, ...]
          Severity: Minor
          Found in src/qinfer/distributions.py and 1 other location - About 30 mins to fix
          src/qinfer/distributions.py on lines 805..806

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 32.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Closing bracket does not match visual indentation
          Open

                  )
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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)

          Ambiguous variable name 'l'
          Open

                      l = self.particle_locations[cluster_particles]
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          Never use the characters 'l', 'O', or 'I' as variable names.

          In some fonts, these characters are indistinguishable from the
          numerals one and zero. When tempted to use 'l', use 'L' instead.
          
          Okay: L = 0
          Okay: o = 123
          Okay: i = 42
          E741: l = 0
          E741: O = 123
          E741: I = 42
          
          Variables can be bound in several other contexts, including class
          and function definitions, 'global' and 'nonlocal' statements,
          exception handlers, and 'with' and 'for' statements.
          In addition, we have a special handling for function parameters.
          
          Okay: except AttributeError as o:
          Okay: with lock as L:
          Okay: foo(l=12)
          Okay: for a in foo(l=12):
          E741: except AttributeError as O:
          E741: with lock as l:
          E741: global I
          E741: nonlocal l
          E741: def foo(l):
          E741: def foo(l=12):
          E741: l = foo(l=12)
          E741: for l in range(10):
          E742: class I(object):
          E743: def l(x):

          Line too long (89 > 79 characters)
          Open

                      self.particle_weights = self.particle_weights / np.sum(self.particle_weights)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                          key:self._dist_kw_args[key][k,:]
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 ParticleDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (80 > 79 characters)
          Open

                  the arguments of the k'th distribution. Use ``None`` if the distribution
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (87 > 79 characters)
          Open

              def __init__(self, weights, dist, dist_args=None, dist_kw_args=None, shuffle=True):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Invalid escape sequence '\s'
          Open

                  :return: The effective sample size, given by :math:`1/\sum_i w_i^2`.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          Invalid escape sequences are deprecated in Python 3.6.

          Okay: regex = r'\.png$'
          W605: regex = '\.png$'

          At least two spaces before inline comment
          Open

                              axis=1 # Sum over the particles of ``other``.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Continuation line with same indent as next logical line
          Open

                      ):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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)

          Expected 2 blank lines, found 1
          Open

          class Distribution(with_metaclass(abc.ABCMeta, object)):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Do not use bare 'except'
          Open

                  except:
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          When catching exceptions, mention specific exceptions when possible.

          Okay: except Exception:
          Okay: except BaseException:
          E722: except:

          Line too long (83 > 79 characters)
          Open

              def __init__(self, n_mps=None, particle_locations=None, particle_weights=None):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (87 > 79 characters)
          Open

              :param bool shuffle: Whether or not to shuffle result after sampling. Not shuffling
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (132 > 79 characters)
          Open

                      warnings.warn('Numerical error in covariance estimation causing positive semidefinite violation.', ApproximationWarning)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (86 > 79 characters)
          Open

                      by the outer product of the square root diagonal of the covariance matrix,
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Continuation line under-indented for visual indent
          Open

                      self.particle_weights, fn(self.particle_locations)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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)

          Expected 2 blank lines, found 1
          Open

          def scipy_dist(name, *args, **kwargs):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                          key:self._dist_kw_args[key][k,:]
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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'}]

          At least two spaces before inline comment
          Open

                          sum(w), # The zeroth moment is very useful here!
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Expected 2 blank lines, found 1
          Open

          class SingleSampleMixin(with_metaclass(abc.ABCMeta, object)):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                      return self._dist_args[k,:]
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (162 > 79 characters)
          Open

                      raise ValueError('Either the dimension of parameter space, `n_mps`, or the particles, `particle_locations` and `particle_weights` must be specified.')
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (81 > 79 characters)
          Open

              def _kl_divergence(self, other_locs, other_weights, kernel=None, delta=1e-2):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (80 > 79 characters)
          Open

                      if ``return_outside`` is ``True``, both the particles inside and the
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (80 > 79 characters)
          Open

                  is the number of random variables, specifying the upper and lower limits
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Invalid escape sequence '\p'
          Open

                  :math:`\Pr(X) = \delta(X - X_0)`.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          Invalid escape sequences are deprecated in Python 3.6.

          Okay: regex = r'\.png$'
          W605: regex = '\.png$'

          Line too long (101 > 79 characters)
          Open

                  return np.einsum("ij,nj->ni", la.sqrtm(self.cov), np.random.randn(n, self.n_rvs)) + self.mean
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (86 > 79 characters)
          Open

                          temp[idx,:] = np.kron(paulis[np.trunc(idx/d)], self.paulis1Q[idx % 4])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  return np.array([x,y,z])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (82 > 79 characters)
          Open

                  :return: The tuple ``(faces, vertices)`` where ``faces`` describes all the
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (86 > 79 characters)
          Open

                      ``(n_face, n_mps, n_mps)`` and indeces ``(idx_face, idx_vertex, idx_mps)``
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (83 > 79 characters)
          Open

                      ``vertices`` is an  ``numpy.ndarray`` of shape ``(n_vertices, n_mps)``.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                          np.random.rand(n, self._n_rvs)*self._delta[np.newaxis,:]
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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'}]

          At least two spaces before inline comment
          Open

                  self.mu = mu # lognormal location parameter
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Blank line contains whitespace
          Open

                  
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Expected 2 blank lines, found 1
          Open

          class MVUniformDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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'}]

          Block comment should start with '# '
          Open

                  #Generate random unitary (see e.g. http://arxiv.org/abs/math-ph/0609050v2)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  g = (np.random.randn(self.dim,self.dim) + 1j*np.random.randn(self.dim,self.dim))/np.sqrt(2.0)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = np.random.randn(self.dim,self.dim) + 1j*np.random.randn(self.dim,self.dim)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                      return self.make_Paulis(temp,d*2)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  y = np.real(np.dot(psi.conj(),np.dot(np.array([[0,-1j],[1j,0]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (80 > 79 characters)
          Open

                      self.var = alpha * beta / ((alpha + beta) ** 2 * (alpha + beta + 1))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Unexpected spaces around keyword / parameter equals
          Open

              def sample(self, n = 1):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          Don't use spaces around the '=' sign in function arguments.

          Don't use spaces around the '=' sign when used to indicate a
          keyword argument or a default parameter value, except when
          using a type annotation.
          
          Okay: def complex(real, imag=0.0):
          Okay: return magic(r=real, i=imag)
          Okay: boolean(a == b)
          Okay: boolean(a != b)
          Okay: boolean(a <= b)
          Okay: boolean(a >= b)
          Okay: def foo(arg: int = 42):
          Okay: async def foo(arg: int = 42):
          
          E251: def complex(real, imag = 0.0):
          E251: return magic(r = real, i = imag)
          E252: def complex(real, image: float=0.0):

          Missing whitespace after ','
          Open

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  g = (np.random.randn(self.dim,self.dim) + 1j*np.random.randn(self.dim,self.dim))/np.sqrt(2.0)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  rho = np.dot(np.dot(np.identity(self.dim)+U,np.dot(z,z.conj().transpose())),np.identity(self.dim)+U.conj().transpose())
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  rho = np.dot(np.dot(np.identity(self.dim)+U,np.dot(z,z.conj().transpose())),np.identity(self.dim)+U.conj().transpose())
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = np.real(np.dot(psi.conj(),np.dot(np.array([[1,0],[0,-1]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  y = np.real(np.dot(psi.conj(),np.dot(np.array([[0,-1j],[1j,0]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  return np.array([x,y,z])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (92 > 79 characters)
          Open

                       described above, and ``outside`` has shape ``(n_particles-n_credible, n_mps)``.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (107 > 79 characters)
          Open

              def in_credible_region(self, points, level=0.95, modelparam_slice=None, method='hpd-hull', tol=0.0001):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (101 > 79 characters)
          Open

                      A, c = self.region_est_ellipsoid(level=level, tol=tol, modelparam_slice=modelparam_slice)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  q,r = la.qr(z)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = np.real(np.dot(psi.conj(),np.dot(np.array([[1,0],[0,-1]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

              def __init__(self,dim=2, k=2):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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'}]

          Multiple spaces before operator
          Open

                  self._xs  = u.compactspace(compactification_scale, n_interp_points)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          Avoid extraneous whitespace around an operator.

          Okay: a = 12 + 3
          E221: a = 4  + 5
          E222: a = 4 +  5
          E223: a = 4\t+ 5
          E224: a = 4 +\t5

          Line too long (80 > 79 characters)
          Open

                  Returns an estimate of how much of the variance in the current posterior
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (91 > 79 characters)
          Open

              def est_credible_region(self, level=0.95, return_outside=False, modelparam_slice=None):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Expected 2 blank lines, found 1
          Open

          class BetaBinomialDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (94 > 79 characters)
          Open

                      self.alpha = - mean * (var + mean **2 - n * mean) / (mean ** 2 + n * (var - mean))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  return np.random.mtrand.dirichlet(np.ones(self._dim),n)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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'}]

          At least two spaces before inline comment
          Open

                  shape = (n, self._n_rvs)# if n == 1 else (self._n_rvs, n)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Continuation line over-indented for visual indent
          Open

                          np.random.rand(n, self._n_rvs)*self._delta[np.newaxis,:]
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                      temp = np.zeros([d**2,d,d],dtype='complex128')
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 LogNormalDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Too many blank lines (2)
          Open

              @property
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (80 > 79 characters)
          Open

              :param float mean: The desired mean value of the beta-binomial distribution.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (81 > 79 characters)
          Open

                      region and ``n_mps`` corresponds to the size of ``modelparam_slice``.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  psi = np.dot(U,np.array([1,0]))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (101 > 79 characters)
          Open

                      raise ValueError("GammaDistribution requires either (alpha and beta) or (mean and var).")
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (80 > 79 characters)
          Open

                      remaining parameters. By default, all model parameters are included.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = np.real(np.dot(psi.conj(),np.dot(np.array([[1,0],[0,-1]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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'}]

          Do not use bare 'except'
          Open

                      except:
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          When catching exceptions, mention specific exceptions when possible.

          Okay: except Exception:
          Okay: except BaseException:
          E722: except:

          Missing whitespace after ','
          Open

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (82 > 79 characters)
          Open

                  z = np.random.randn(self.dim,self.k) + 1j*np.random.randn(self.dim,self.k)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Expected 2 blank lines, found 1
          Open

          class ConstantDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  x = np.real(np.dot(psi.conj(),np.dot(np.array([[0,1],[1,0]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  y = np.real(np.trace(np.dot(rho,np.array([[0,-1j],[1j,0]]))))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = np.real(np.trace(np.dot(rho,np.array([[1,0],[0,-1]]))))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (86 > 79 characters)
          Open

                  z = np.random.randn(self.dim,self.dim) + 1j*np.random.randn(self.dim,self.dim)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = np.real(np.trace(np.dot(rho,np.array([[1,0],[0,-1]]))))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (127 > 79 characters)
          Open

                  rho = np.dot(np.dot(np.identity(self.dim)+U,np.dot(z,z.conj().transpose())),np.identity(self.dim)+U.conj().transpose())
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  x = np.real(np.trace(np.dot(rho,np.array([[0,1],[1,0]]))))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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'}]

          Block comment should start with '# '
          Open

                  #Generate random unitary (see e.g. http://arxiv.org/abs/math-ph/0609050v2)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = np.random.randn(self.dim,self.k) + 1j*np.random.randn(self.dim,self.k)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                      # any of the simplices. (http://stackoverflow.com/a/16898636/1082565)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Unexpected spaces around keyword / parameter equals
          Open

              def __init__(self, dim = 6):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          Don't use spaces around the '=' sign in function arguments.

          Don't use spaces around the '=' sign when used to indicate a
          keyword argument or a default parameter value, except when
          using a type annotation.
          
          Okay: def complex(real, imag=0.0):
          Okay: return magic(r=real, i=imag)
          Okay: boolean(a == b)
          Okay: boolean(a != b)
          Okay: boolean(a <= b)
          Okay: boolean(a >= b)
          Okay: def foo(arg: int = 42):
          Okay: async def foo(arg: int = 42):
          
          E251: def complex(real, imag = 0.0):
          E251: return magic(r = real, i = imag)
          E252: def complex(real, image: float=0.0):

          Missing whitespace after ','
          Open

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (80 > 79 characters)
          Open

                      vertices of all of the faces on the exterior of the convex hull, and
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  x = np.real(np.dot(psi.conj(),np.dot(np.array([[0,1],[1,0]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (80 > 79 characters)
          Open

                      use. One of ``'pce'``, ``'hpd-hull'`` or ``'hpd-mvee'`` (see below).
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Expected 2 blank lines, found 1
          Open

          class ConstrainedSumDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Expected 1 blank line, found 0
          Open

              def sample(self, n=1):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (98 > 79 characters)
          Open

                  self.dist = partial(scipy_dist, 'lognorm', 1, mu, sigma) # scipy distribution location = 0
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (94 > 79 characters)
          Open

                      raise ValueError('The input alpha must be a 1D list of concentration parameters.')
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Unexpected spaces around keyword / parameter equals
          Open

              def __init__(self, dim = 6):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          Don't use spaces around the '=' sign in function arguments.

          Don't use spaces around the '=' sign when used to indicate a
          keyword argument or a default parameter value, except when
          using a type annotation.
          
          Okay: def complex(real, imag=0.0):
          Okay: return magic(r=real, i=imag)
          Okay: boolean(a == b)
          Okay: boolean(a != b)
          Okay: boolean(a <= b)
          Okay: boolean(a >= b)
          Okay: def foo(arg: int = 42):
          Okay: async def foo(arg: int = 42):
          
          E251: def complex(real, imag = 0.0):
          E251: return magic(r = real, i = imag)
          E252: def complex(real, image: float=0.0):

          Missing whitespace after ','
          Open

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (82 > 79 characters)
          Open

                  #Generate random unitary (see e.g. http://arxiv.org/abs/math-ph/0609050v2)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (101 > 79 characters)
          Open

                  g = (np.random.randn(self.dim,self.dim) + 1j*np.random.randn(self.dim,self.dim))/np.sqrt(2.0)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  y = np.real(np.dot(psi.conj(),np.dot(np.array([[0,-1j],[1j,0]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  y = np.real(np.dot(psi.conj(),np.dot(np.array([[0,-1j],[1j,0]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = np.random.randn(self.dim,self.k) + 1j*np.random.randn(self.dim,self.k)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 InterpolatedUnivariateDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (82 > 79 characters)
          Open

              def region_est_ellipsoid(self, level=0.95, tol=0.0001, modelparam_slice=None):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (80 > 79 characters)
          Open

                  :param slice modelparam_slice: A slice describing which model parameters
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (92 > 79 characters)
          Open

                      self.dist = partial(scipy_dist, 'truncnorm', a, b, loc=mean, scale=np.sqrt(var))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  self.dist = partial(scipy_dist, 'lognorm', 1, mu, sigma) # scipy distribution location = 0
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Blank line contains whitespace
          Open

                  
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (82 > 79 characters)
          Open

              :param float beta: The beta shape parameter of the beta-binomial distribution.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (97 > 79 characters)
          Open

                      self.beta = (n - mean) * (var + mean ** 2 - n * mean) / ((n - mean) * mean - n * var)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  psi = np.dot(U,np.array([1,0]))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = np.real(np.dot(psi.conj(),np.dot(np.array([[1,0],[0,-1]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  x = np.real(np.dot(psi.conj(),np.dot(np.array([[0,1],[1,0]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  x = np.real(np.trace(np.dot(rho,np.array([[0,1],[1,0]]))))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (85 > 79 characters)
          Open

              :param Distribution underlying_distribution: Underlying probability distribution.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Invalid escape sequence '\d'
          Open

                  :math:`\Pr(X) = \delta(X - X_0)`.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          Invalid escape sequences are deprecated in Python 3.6.

          Okay: regex = r'\.png$'
          W605: regex = '\.png$'

          Continuation line over-indented for visual indent
          Open

                          self._weight*z + \
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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)

          Expected 2 blank lines, found 1
          Open

          class BetaDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (95 > 79 characters)
          Open

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                      x[idx] = np.real(np.trace(np.dot(rho,self.paulis[idx+1])))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (82 > 79 characters)
          Open

                  #Generate random unitary (see e.g. http://arxiv.org/abs/math-ph/0609050v2)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = np.real(np.dot(psi.conj(),np.dot(np.array([[1,0],[0,-1]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  return np.array([x,y,z])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  y = np.real(np.trace(np.dot(rho,np.array([[0,-1j],[1j,0]]))))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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'}]

          At least two spaces before inline comment
          Open

          _DEFAULT_RANGES.flags.writeable = False # Prevent anyone from modifying the
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Line too long (80 > 79 characters)
          Open

                  is the number of random variables, specifying the upper and lower limits
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Blank line contains whitespace
          Open

              
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (105 > 79 characters)
          Open

                      self.var = n * alpha * beta * (alpha + beta + n) / ((alpha + beta) ** 2 * (alpha + beta + 1))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  U = np.dot(q,ph)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  rho = np.dot(np.dot(np.identity(self.dim)+U,np.dot(z,z.conj().transpose())),np.identity(self.dim)+U.conj().transpose())
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  x = np.real(np.dot(psi.conj(),np.dot(np.array([[0,1],[1,0]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  x = np.real(np.trace(np.dot(rho,np.array([[0,1],[1,0]]))))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (82 > 79 characters)
          Open

                  s_ = np.s_[modelparam_slice] if modelparam_slice is not None else np.s_[:]
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (82 > 79 characters)
          Open

                      a single point, or of shape ``(n_points, n_mps)`` for multiple points,
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (86 > 79 characters)
          Open

                      where ``n_mps`` corresponds to the same dimensionality as ``param_slice``.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (86 > 79 characters)
          Open

                      s_ = np.s_[modelparam_slice] if modelparam_slice is not None else np.s_[:]
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Expected 2 blank lines, found 1
          Open

          class DirichletDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Expected 2 blank lines, found 1
          Open

          class DiscreteUniformDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Expected 2 blank lines, found 1
          Open

          class HilbertSchmidtUniform(SingleSampleMixin, Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = np.random.randn(self.dim,self.dim) + 1j*np.random.randn(self.dim,self.dim)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

              def make_Paulis(self,paulis,d):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                      temp = np.zeros([d**2,d,d],dtype='complex128')
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = (np.random.randn(self.dim,self.dim) + 1j*np.random.randn(self.dim,self.dim))/np.sqrt(2.0)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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'}]

          Block comment should start with '# '
          Open

                  #Generate random matrix
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  y = np.real(np.trace(np.dot(rho,np.array([[0,-1j],[1j,0]]))))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  return np.array([x,y,z])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (80 > 79 characters)
          Open

                  :return: An array of particles inside the estimated credible region. Or,
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (82 > 79 characters)
          Open

                  return points[hull.simplices], points[u.uniquify(hull.vertices.flatten())]
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (81 > 79 characters)
          Open

                  :param str method: A string specifying which credible region estimator to
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (84 > 79 characters)
          Open

                  - ``'hpd-mvee'``: High Posterior Density Minimum Volume Enclosing Ellipsoid.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Invalid escape sequence '\c'
          Open

                      slices and uses the :math:`\chi^2` distribution to determine
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          Invalid escape sequences are deprecated in Python 3.6.

          Okay: regex = r'\.png$'
          W605: regex = '\.png$'

          Expected 2 blank lines, found 1
          Open

          class ProductDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Unexpected indentation (comment)
          Open

                                                  # default ranges.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          Use indent_size (PEP8 says 4) spaces per indentation level.

          For really old code that you don't want to mess up, you can continue
          to use 8-space tabs.
          
          Okay: a = 1
          Okay: if a == 0:\n    a = 1
          E111:   a = 1
          E114:   # a = 1
          
          Okay: for item in items:\n    pass
          E112: for item in items:\npass
          E115: for item in items:\n# Hi\n    pass
          
          Okay: a = 1\nb = 2
          E113: a = 1\n    b = 2
          E116: a = 1\n    # b = 2

          At least two spaces before inline comment
          Open

                  shape = (n, self._n_rvs)# if n == 1 else (self._n_rvs, n)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Line too long (84 > 79 characters)
          Open

              :param float alpha: The alpha shape parameter of the beta-binomial distribution.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (108 > 79 characters)
          Open

                      raise ValueError("BetaBinomialDistribution requires either (alpha and beta) or (mean and var).")
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (83 > 79 characters)
          Open

              Creates a new Hilber-Schmidt uniform prior on state space of dimension ``dim``.
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  q,r = la.qr(g)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                          temp[idx,:] = np.kron(paulis[np.trunc(idx/d)], self.paulis1Q[idx % 4])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (101 > 79 characters)
          Open

                  z = (np.random.randn(self.dim,self.dim) + 1j*np.random.randn(self.dim,self.dim))/np.sqrt(2.0)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Expected 2 blank lines, found 1
          Open

          class GinibreUniform(SingleSampleMixin, Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  rho = np.dot(z,z.conj().transpose())
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  y = np.real(np.trace(np.dot(rho,np.array([[0,-1j],[1j,0]]))))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 (101 > 79 characters)
          Open

                      hull = Delaunay(self.est_credible_region(level=level, modelparam_slice=modelparam_slice))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Expected 2 blank lines, found 1
          Open

          class NormalDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          At least two spaces before inline comment
          Open

                  self.sigma = sigma # lognormal scale parameter
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                      temp = np.zeros([d**2,d,d],dtype='complex128')
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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'}]

          Block comment should start with '# '
          Open

                  #Apply Haar random unitary to |0> state to get random pure state
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Line too long (110 > 79 characters)
          Open

                      raise RuntimeError("Did not successfully postselect within {} iterations.".format(self._maxiters))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Line too long (90 > 79 characters)
          Open

                  _, vertices = self.region_est_hull(level=level, modelparam_slice=modelparam_slice)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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.

          Expected 2 blank lines, found 1
          Open

          class MultivariateNormalDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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 around operator
          Open

                      self.alpha = - mean * (var + mean **2 - n * mean) / (mean ** 2 + n * (var - mean))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          Surround operators with a single space on either side.

          - Always surround these binary operators with a single space on
            either side: assignment (=), augmented assignment (+=, -= etc.),
            comparisons (==, <, >, !=, <=, >=, in, not in, is, is not),
            Booleans (and, or, not).
          
          - If operators with different priorities are used, consider adding
            whitespace around the operators with the lowest priorities.
          
          Okay: i = i + 1
          Okay: submitted += 1
          Okay: x = x * 2 - 1
          Okay: hypot2 = x * x + y * y
          Okay: c = (a + b) * (a - b)
          Okay: foo(bar, key='word', *args, **kwargs)
          Okay: alpha[:-i]
          
          E225: i=i+1
          E225: submitted +=1
          E225: x = x /2 - 1
          E225: z = x **y
          E225: z = 1and 1
          E226: c = (a+b) * (a-b)
          E226: hypot2 = x*x + y*y
          E227: c = a|b
          E228: msg = fmt%(errno, errmsg)

          Expected 2 blank lines, found 1
          Open

          class GammaDistribution(Distribution):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

          Unexpected spaces around keyword / parameter equals
          Open

              def sample(self, n = 1):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          Don't use spaces around the '=' sign in function arguments.

          Don't use spaces around the '=' sign when used to indicate a
          keyword argument or a default parameter value, except when
          using a type annotation.
          
          Okay: def complex(real, imag=0.0):
          Okay: return magic(r=real, i=imag)
          Okay: boolean(a == b)
          Okay: boolean(a != b)
          Okay: boolean(a <= b)
          Okay: boolean(a >= b)
          Okay: def foo(arg: int = 42):
          Okay: async def foo(arg: int = 42):
          
          E251: def complex(real, imag = 0.0):
          E251: return magic(r = real, i = imag)
          E252: def complex(real, image: float=0.0):

          Missing whitespace after ','
          Open

                  z = np.random.randint(2**self._num_bits,size=n)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  self.paulis1Q = np.array([[[1,0],[0,1]],[[1,0],[0,-1]],[[0,-1j],[1j,0]],[[0,1],[1,0]]])
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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'}]

          Block comment should start with '# '
          Open

                  #Generate random matrix
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

              def make_Paulis(self,paulis,d):
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = (np.random.randn(self.dim,self.dim) + 1j*np.random.randn(self.dim,self.dim))/np.sqrt(2.0)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  U = np.dot(q,ph)
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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'}]

          Block comment should start with '# '
          Open

                  #TODO: generalize this to general dimensions
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  y = np.real(np.dot(psi.conj(),np.dot(np.array([[0,-1j],[1j,0]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  x = np.real(np.dot(psi.conj(),np.dot(np.array([[0,1],[1,0]]),psi)))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = np.real(np.trace(np.dot(rho,np.array([[1,0],[0,-1]]))))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  totals = np.sum(s, axis=1)[:,np.newaxis]
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  z = np.real(np.trace(np.dot(rho,np.array([[1,0],[0,-1]]))))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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

                  x = np.real(np.trace(np.dot(rho,np.array([[0,1],[1,0]]))))
          Severity: Minor
          Found in src/qinfer/distributions.py by pep8

          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