Skip to content

Commit

Permalink
Fix sonarcloud issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sfmig committed Nov 29, 2024
1 parent b5b7046 commit 72a686d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 8 additions & 4 deletions movement/io/load_bboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@

from movement.utils.logging import log_error
from movement.validators.datasets import ValidBboxesDataset
from movement.validators.files import ValidFile, ValidVIATracksCSV
from movement.validators.files import (
DEFAULT_FRAME_REGEXP,
ValidFile,
ValidVIATracksCSV,
)

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -349,7 +353,7 @@ def from_via_tracks_file(


def _numpy_arrays_from_via_tracks_file(
file_path: Path, frame_regexp: str = r"(0\d*)\.\w+$"
file_path: Path, frame_regexp: str = DEFAULT_FRAME_REGEXP
) -> dict:
"""Extract numpy arrays from the input VIA tracks .csv file.
Expand Down Expand Up @@ -427,7 +431,7 @@ def _numpy_arrays_from_via_tracks_file(


def _df_from_via_tracks_file(
file_path: Path, frame_regexp: str = r"(0\d*)\.\w+$"
file_path: Path, frame_regexp: str = DEFAULT_FRAME_REGEXP
) -> pd.DataFrame:
"""Load VIA tracks .csv file as a dataframe.
Expand Down Expand Up @@ -526,7 +530,7 @@ def _extract_confidence_from_via_tracks_df(df: pd.DataFrame) -> np.ndarray:


def _extract_frame_number_from_via_tracks_df(
df: pd.DataFrame, frame_regexp: str = r"(0\d*)\.\w+$"
df: pd.DataFrame, frame_regexp: str = DEFAULT_FRAME_REGEXP
) -> np.ndarray:
"""Extract frame numbers from the VIA tracks input dataframe.
Expand Down
2 changes: 2 additions & 0 deletions movement/validators/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

from movement.utils.logging import log_error

DEFAULT_FRAME_REGEXP = r"(0\d*)\.\w+$"


@define
class ValidFile:
Expand Down

0 comments on commit 72a686d

Please sign in to comment.