Function check_dimension
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def check_dimension(dimension, transform=None):
"""Turn a provided dimension description into a dimension object. Checks that the provided
dimension falls into one of the supported types, listed below in the description of `dimension`
Parameters
- Read upRead up
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
Function normalize_dimensions
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def normalize_dimensions(dimensions):
"""Create a `Space` where all dimensions are instructed to be normalized to unit range. Note
that this doesn't *really* return normalized `dimensions`. It just returns the given
`dimensions`, with each one's `transform` set to the appropriate value, so that when each
dimension's :meth:`transform` is called, the dimensions are actually normalized
- Read upRead up
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
Function rvs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def rvs(self, n_samples=1, random_state=None):
"""Draw random samples. Samples are in the original (untransformed) space. They must be
transformed before being passed to a model or minimizer via :meth:`transform`
Parameters
- Read upRead up
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
Function inverse_transform
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def inverse_transform(self, data_t):
"""Inverse transform samples from the warped space back to the original space
Parameters
----------
- Read upRead up
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
Avoid too many return
statements within this function. Open
return Categorical(dimension, **kwargs)
Avoid too many return
statements within this function. Open
return Real(*dimension, **kwargs)
Avoid too many return
statements within this function. Open
return Real(*dimension, **kwargs)
Avoid too many return
statements within this function. Open
return Categorical(dimension, **kwargs)