Showing 195 of 195 total issues
File visuals.py
has 3428 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""General plotting functions for the deepof package."""
# @author lucasmiranda42
# encoding: utf-8
# module deepof
File data.py
has 2178 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Data structures for preprocessing and wrangling of motion tracking output data. This is the main module handled by the user.
There are three main data structures to pay attention to:
- :class:`~deepof.data.Project`, which serves as a configuration hub for the whole pipeline
- :class:`~deepof.data.Coordinates`, which acts as an intermediary between project configuration and data, and contains
File utils.py
has 2050 lines of code (exceeds 250 allowed). Consider refactoring. Open
# @author lucasmiranda42
# encoding: utf-8
# module deepof
"""Functions and general utilities for the deepof package."""
File models.py
has 1650 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""deep autoencoder models for unsupervised pose detection.
- VQ-VAE: a variational autoencoder with a vector quantization latent-space (https://arxiv.org/abs/1711.00937).
- VaDE: a variational autoencoder with a Gaussian mixture latent-space.
- Contrastive: an embedding model consisting of a single encoder, trained using a contrastive loss.
File model_utils.py
has 1355 lines of code (exceeds 250 allowed). Consider refactoring. Open
# @author lucasmiranda42
# encoding: utf-8
# module deepof
"""Utility functions for both training autoencoder models in deepof.models and tuning hyperparameters with deepof.hypermodels."""
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."""
File annotation_utils.py
has 763 lines of code (exceeds 250 allowed). Consider refactoring. Open
# @author lucasmiranda42
# encoding: utf-8
# module deepof
"""Functions and general utilities for supervised pose estimation. See documentation for details."""
Function plot_embeddings
has a Cognitive Complexity of 72 (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 get_coords
has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring. Open
def get_coords(
self,
center: str = False,
polar: bool = False,
speed: int = 0,
- 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 preprocess
has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring. Open
def preprocess(
self,
automatic_changepoints=False,
handle_ids: str = "concat",
window_size: 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 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_enrichment
has a Cognitive Complexity of 59 (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 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 retrieve_corners_from_image
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def retrieve_corners_from_image(
frame: np.ndarray, arena_type: str, cur_vid: int, videos: list
): # pragma: no cover
"""Open a window and waits for the user to click on all corners of the polygonal 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_gantt
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def plot_gantt(
coordinates: project,
experiment_id: str,
# Time selection parameters
bin_index: Union[int, 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 _preprocess_time_bins
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def _preprocess_time_bins(
coordinates: coordinates,
bin_size: Union[int, str],
bin_index: Union[int, str],
precomputed_bins: np.ndarray = 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
File deepof_train_embeddings.py
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
# @author lucasmiranda42
# encoding: utf-8
# module deepof
"""
Function get_arenas
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def get_arenas(
coordinates: coordinates,
tables: table_dict,
arena: str,
arena_dims: 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 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 load_tables
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def load_tables(self, verbose: bool = True) -> Tuple:
"""Load videos and tables into dictionaries.
Args:
verbose (bool): If True, prints the progress of data loading.
- 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"