File visuals.py
has 2311 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""General plotting functions for the deepof package."""
# @author lucasmiranda42
# encoding: utf-8
# module deepof
Function tag_annotated_frames
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
def tag_annotated_frames(
frame,
font,
frame_speeds,
animal_ids,
- 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 plot_gantt
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def plot_gantt(
coordinates: project,
experiment_id: str,
soft_counts: 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 plot_embeddings
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def plot_embeddings(
coordinates: coordinates,
embeddings: table_dict = None,
soft_counts: table_dict = None,
breaks: 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 animate_skeleton
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def animate_skeleton(
coordinates: coordinates,
experiment_id: str,
animal_id: list = None,
center: str = "arena",
- 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 plot_transitions
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def plot_transitions(
coordinates: coordinates,
embeddings: table_dict,
soft_counts: table_dict,
breaks: 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 plot_embeddings
has 24 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_embeddings(
Function heatmap
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def heatmap(
dframe: pd.DataFrame,
bodyparts: List,
xlim: tuple = None,
ylim: tuple = 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 annotate_video
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def annotate_video(
coordinates: coordinates,
tag_dict: pd.DataFrame,
vid_index: int,
frame_limit: int = np.inf,
- 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 plot_enrichment
has 20 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_enrichment(
Function _process_animation_data
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def _process_animation_data(
coordinates,
experiment_id,
animal_id,
center,
- 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 plot_enrichment
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def plot_enrichment(
coordinates: coordinates,
embeddings: table_dict = None,
soft_counts: table_dict = None,
breaks: 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 plot_heatmaps
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_heatmaps(
Function plot_cluster_detection_performance
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def plot_cluster_detection_performance(
coordinates: coordinates,
chunk_stats: pd.DataFrame,
cluster_gbm_performance: dict,
hard_counts: np.ndarray,
- 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 animate_skeleton
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def animate_skeleton(
Function plot_transitions
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_transitions(
Function plot_heatmaps
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def plot_heatmaps(
coordinates: coordinates,
bodyparts: list,
center: str = "arena",
align: str = 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 _filter_embeddings
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _filter_embeddings(
coordinates,
embeddings,
soft_counts,
breaks,
- 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 tag_annotated_frames
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def tag_annotated_frames(
Function plot_stationary_entropy
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_stationary_entropy(
Function plot_distance_between_conditions
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_distance_between_conditions(
Function plot_arena
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def plot_arena(
coordinates: coordinates, center: str, color: str, ax: Any, i: Union[int, str]
):
"""Plot the arena in the given canvas.
- 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 heatmap
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def heatmap(
Function output_videos_per_cluster
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def output_videos_per_cluster(
Function output_unsupervised_annotated_video
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def output_unsupervised_annotated_video(
video_path: str,
breaks: list,
soft_counts: np.ndarray,
frame_rate: int = 25,
- 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 _process_animation_data
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def _process_animation_data(
Function output_cluster_video
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def output_cluster_video(
cap: Any,
out: Any,
frame_mask: list,
v_width: int,
- 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 _filter_embeddings
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def _filter_embeddings(
Function export_annotated_video
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def export_annotated_video(
Function plot_gantt
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_gantt(
Function output_unsupervised_annotated_video
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def output_unsupervised_annotated_video(
Function plot_cluster_detection_performance
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_cluster_detection_performance(
Function export_annotated_video
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def export_annotated_video(
coordinates: coordinates,
soft_counts: dict = None,
breaks: dict = None,
experiment_id: str = 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 plot_shap_swarm_per_cluster
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_shap_swarm_per_cluster(
Function output_cluster_video
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def output_cluster_video(
Function plot_normative_log_likelihood
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_normative_log_likelihood(
Function annotate_video
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def annotate_video(
Function plot_stationary_entropy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def plot_stationary_entropy(
coordinates: coordinates,
embeddings: table_dict,
soft_counts: table_dict,
breaks: 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 _scatter_embeddings
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _scatter_embeddings(
Function plot_arena
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_arena(