Consider using Python 3 style super() without arguments Open
super(Derivative, self).__init__(step=step, **options)
- Read upRead up
- Exclude checks
Emitted when calling the super() builtin with the current class and instance. On Python 3 these arguments are the default and they can be omitted.
Consider using '{derivative
: 'Gradient', extra_parameter
: n order : int, optionaln defines the order of the error term in the Taylor approximation used.n For 'central' and 'complex' methods, it must be an even number.
, ... }' instead of a call to 'dict'. Open
__doc__ = _CMN_DOC % dict(
- Read upRead up
- Exclude checks
Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.
Consider using '{derivative
: 'Hessian diagonal', extra_parameter
: order : int, optionaln defines the order of the error term in the Taylor approximation used.n For 'central' and 'complex' methods, it must be an even number.
, ... }' instead of a call to 'dict'. Open
__doc__ = _CMN_DOC % dict(
- Read upRead up
- Exclude checks
Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.
Consider using '{derivative
: 'n-th derivative', extra_parameter
: n order : int, optionaln defines the order of the error term in the Taylor approximation used.n For 'central' and 'complex' methods, it must be an even number.n n : int, optionaln Order of the derivative.
, ... }' instead of a call to 'dict'. Open
__doc__ = _CMN_DOC % dict(
- Read upRead up
- Exclude checks
Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.
Consider using Python 3 style super() without arguments Open
super(Hessdiag, self).__init__(f, step=step, method=method, n=2, order=order, **options)
- Read upRead up
- Exclude checks
Emitted when calling the super() builtin with the current class and instance. On Python 3 these arguments are the default and they can be omitted.
Too many arguments (6/5) Open
def __init__(self, fun, step=None, method='central', order=2, n=1, **options):
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
Consider using Python 3 style super() without arguments Open
return super(Jacobian, self).__call__(np.atleast_1d(x), *args, **kwds)
- Read upRead up
- Exclude checks
Emitted when calling the super() builtin with the current class and instance. On Python 3 these arguments are the default and they can be omitted.
Consider using '{derivative
: 'Hessian', extra_parameter
: '', returns
: 'n Returnsn -------n hess : ndarrayn array of partial second derivatives, Hessiann ', ... }' instead of a call to 'dict'. Open
__doc__ = _CMN_DOC % dict(
- Read upRead up
- Exclude checks
Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.
Consider using Python 3 style super() without arguments Open
result = super(Gradient, self).__call__(np.atleast_1d(x).ravel(), *args, **kwds)
- Read upRead up
- Exclude checks
Emitted when calling the super() builtin with the current class and instance. On Python 3 these arguments are the default and they can be omitted.
Consider using Python 3 style super() without arguments Open
return super(Hessdiag, self).__call__(np.atleast_1d(x), *args, **kwds)
- Read upRead up
- Exclude checks
Emitted when calling the super() builtin with the current class and instance. On Python 3 these arguments are the default and they can be omitted.
Consider using '{derivative
: 'Jacobian', extra_parameter
: n order : int, optionaln defines the order of the error term in the Taylor approximation used.n For 'central' and 'complex' methods, it must be an even number.
, ... }' instead of a call to 'dict'. Open
__doc__ = _CMN_DOC % dict(
- Read upRead up
- Exclude checks
Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.
Consider using '{backward
: 1, forward
: 1}' instead of a call to 'dict'. Open
order = dict(backward=1, forward=1).get(method, 2)
- Read upRead up
- Exclude checks
Emitted when using dict() to create a dictionary instead of a literal '{ ... }'. The literal is faster as it avoids an additional function call.
Consider using Python 3 style super() without arguments Open
super(Hessian, self).__init__(f, step=step, method=method, order=order, **options)
- Read upRead up
- Exclude checks
Emitted when calling the super() builtin with the current class and instance. On Python 3 these arguments are the default and they can be omitted.
Number of parameters was 2 in '_Limit._step_generator' and is now 3 in overriding 'Derivative._step_generator' method Open
def _step_generator(self, step, options):
- Read upRead up
- Exclude checks
Used when a method has a different number of arguments than in the implemented interface or in an overridden method. Extra arguments with default values are ignored.
Unable to import 'numpy' Open
import numpy as np
- Read upRead up
- Exclude checks
Used when pylint has been unable to import a module.
Identical blocks of code found in 2 locations. Consider refactoring. Open
return Derivative(lambda t: f(x0 + t * vec), **options)(0)
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
vec = np.reshape(vec / np.linalg.norm(vec.ravel()), x0.shape)
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 10 locations. Consider refactoring. Open
__doc__ = _CMN_DOC % dict(
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 10 locations. Consider refactoring. Open
__doc__ = _CMN_DOC % dict(
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 10 locations. Consider refactoring. Open
__doc__ = _CMN_DOC % dict(
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 10 locations. Consider refactoring. Open
__doc__ = _CMN_DOC % dict(
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 10 locations. Consider refactoring. Open
__doc__ = _CMN_DOC % dict(
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Multiple spaces after ',' Open
super(Derivative, self).__init__(step=step, **options)
- Read upRead up
- Exclude checks
Avoid extraneous whitespace after a comma or a colon.
Note: these checks are disabled by default
Okay: a = (1, 2)
E241: a = (1, 2)
E242: a = (1,\t2)
Argument name x0
doesn't conform to '[a-z_][a-z0-9_]{2,30}$' pattern ('[a-z_][a-z0-9_]{2,30}$' pattern) Open
def directionaldiff(f, x0, vec, **options):
- Read upRead up
- Exclude checks
Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).
Formatting a regular string which could be a f-string Open
msg = ('The {} step derivative method does only work on a real valued analytic '
- Read upRead up
- Exclude checks
Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and py-version >= 3.6
.