Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert measurement_uncertainty.shape == measurements.shape
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert X_design.ndim == 2, "You must provide a two-dimensional numpy array"
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert isinstance(X_design, np.ndarray), "You must provide a two-dimensional numpy array"
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert measurements.shape[1] == self.ndim
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert len(indices) == len(measurements)
- Exclude checks
File pal_base.py
has 607 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# pylint:disable=anomalous-backslash-in-string
# Copyright 2020 PyePAL authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
PALBase
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
class PALBase: # pylint:disable=too-many-instance-attributes, too-many-public-methods
"""PAL base class"""
def __init__( # pylint:disable=too-many-arguments
self,
Function __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__( # pylint:disable=too-many-arguments
Function __init__
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__( # pylint:disable=too-many-arguments
self,
X_design: np.array,
models: list,
ndim: int,
Function run_one_step
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def run_one_step( # pylint:disable=too-many-arguments
Function run_one_step
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run_one_step( # pylint:disable=too-many-arguments
self,
batch_size: int = 1,
pooling_method: str = "fro",
sample_discarded: bool = False,
- 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 sample
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sample(
self,
exclude_idx: Union[np.array, None] = None,
pooling_method: str = "fro",
sample_discarded: bool = False,
- 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 augment_design_space
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def augment_design_space( # pylint: disable=invalid-name
self, X_design: np.ndarray, classify: bool = False, clean_classify: bool = True
) -> None:
"""Add new design points to PAL instance
- 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 _crossvalidate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _crossvalidate(self):
sampled_original = deepcopy(self.sampled)
sampled_idx_original = self.sampled_indices
errors = []
# this step is to make the code not to complicate
- 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"