File post_hoc.py
has 973 lines of code (exceeds 250 allowed). Consider refactoring. Open
# @author lucasmiranda42
# encoding: utf-8
# module deepof
"""Data structures and functions for analyzing supervised and unsupervised model results."""
Function align_deepof_kinematics_with_unsupervised_labels
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def align_deepof_kinematics_with_unsupervised_labels(
deepof_project: coordinates,
kin_derivative: int = 1,
center: str = "Center",
align: str = "Spine_1",
- 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 select_time_bin
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def select_time_bin(
embedding: table_dict = None,
soft_counts: table_dict = None,
breaks: table_dict = None,
supervised_annotations: table_dict = None,
- 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 compute_transition_matrix_per_condition
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def compute_transition_matrix_per_condition(
embedding: table_dict,
soft_counts: table_dict,
breaks: table_dict,
exp_conditions: dict,
- 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 recluster
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def recluster(
coordinates: coordinates,
embeddings: table_dict,
soft_counts: table_dict = None,
min_confidence: float = 0.75,
- 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 annotate_time_chunks
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def annotate_time_chunks(
Function condition_distance_binning
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def condition_distance_binning(
Function compute_transition_matrix_per_condition
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def compute_transition_matrix_per_condition(
Function enrichment_across_conditions
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def enrichment_across_conditions(
Function recluster
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def recluster(
Function align_deepof_kinematics_with_unsupervised_labels
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def align_deepof_kinematics_with_unsupervised_labels(
Function enrichment_across_conditions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def enrichment_across_conditions(
embedding: table_dict = None,
soft_counts: table_dict = None,
breaks: table_dict = None,
supervised_annotations: table_dict = None,
- 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 select_time_bin
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def select_time_bin(
Function separation_between_conditions
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def separation_between_conditions(
Function _fit_hmm_range
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _fit_hmm_range(concat_embeddings, states, min_states, max_states):
"""Auxiliary function for fitting a range of HMMs with different number of states.
Args:
concat_embeddings (np.ndarray): Concatenated embeddings across all animal experiments.
- 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 explain_clusters
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def explain_clusters(
Function train_supervised_cluster_detectors
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def train_supervised_cluster_detectors(
Function condition_distance_binning
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def condition_distance_binning(
embedding: table_dict,
soft_counts: table_dict,
breaks: table_dict,
exp_conditions: dict,
- 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 annotate_time_chunks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def annotate_time_chunks(
deepof_project: coordinates,
soft_counts: table_dict,
breaks: table_dict,
supervised_annotations: table_dict = None,
- 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 separation_between_conditions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def separation_between_conditions(
cur_embedding: table_dict,
cur_soft_counts: table_dict,
cur_breaks: table_dict,
exp_conditions: dict,
- 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"