Skip to content
19 changes: 19 additions & 0 deletions RodTracker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## [v0.6.7]

### Added
- a couple of warnings (data is loaded only from one camera) added which were missing in the last release
- added a warning when no particles are detected in a given frame
- new flake8 version warnings (F824) suppressed (will be addressed in the new releases)

### Fixed
- updated paths in documentation

### Note
- intended reference version for JOSS publication


## [v0.6.6]

### Skipped release due to a versioning conflict (version tag was assigned twice)


## [v0.6.5]

### Added
Expand Down
10 changes: 9 additions & 1 deletion RodTracker/src/RodTracker/backend/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"""

import logging
import warnings
from pathlib import Path
from typing import Dict, List

Expand Down Expand Up @@ -251,7 +252,7 @@ def run(self):
- :attr:`DetectorSignals.progress`
- :attr:`DetectorSignals.finished`
"""
global abort_requested
global abort_requested # noqa: F824
cols = [
col.format(id1=self.cam_id, id2=self.cam_id)
for col in ds.DEFAULT_COLUMNS
Expand All @@ -274,6 +275,13 @@ def run(self):
outputs, self.classes, expected_particles=self.expected
)
tmp_data = ds.add_points(points, data, self.cam_id, frame)
else:
warnings.warn(
f"No particles detected on frame number {i}.",
UserWarning,
)
_logger.warning(f"No particles detected on frame number {i}.")
continue
self.signals.progress.emit(1 / num_frames, tmp_data, self.cam_id)
data.reset_index(drop=True, inplace=True)
self.signals.finished.emit(self.cam_id)
4 changes: 2 additions & 2 deletions RodTracker/src/RodTracker/backend/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ def run(self):
- :attr:`TrackerSignals.progress`
- :attr:`TrackerSignals.result`
"""
global abort_reconstruction, lock
global abort_reconstruction, lock # noqa: F824
try:
# Derive projection matrices from the calibration
r1 = np.eye(3)
Expand Down Expand Up @@ -759,7 +759,7 @@ def run(self):
- :attr:`TrackerSignals.progress`
- :attr:`TrackerSignals.result`
"""
global abort_reconstruction, lock
global abort_reconstruction, lock # noqa: F824
try:
# Derive projection matrices from the calibration
r1 = np.eye(3)
Expand Down
28 changes: 14 additions & 14 deletions RodTracker/src/RodTracker/backend/rod_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def open_rod_folder(self, chosen_folder: Path) -> bool:
return False

# Load data
global rod_data
global rod_data # noqa: F824
lock.lockForWrite()
rod_data, found_colors = self.get_color_data(self.folder)
frame_min = rod_data.frame.min()
Expand Down Expand Up @@ -497,7 +497,7 @@ def save_changes(self, temp_only: bool = False):
- :attr:`saved`
"""
# TODO: move saving to different Thread(, if it still takes too long)
global rod_data
global rod_data # noqa: F824
if rod_data is None:
return
# Clean up data from unused rods before permanent saving
Expand Down Expand Up @@ -693,7 +693,7 @@ def provide_data(self, data_2d: bool = True, data_3d: bool = True):
- :attr:`data_2d`
- :attr:`data_3d`
"""
global rod_data
global rod_data # noqa: F824
if self.frame is None or rod_data is None:
return

Expand Down Expand Up @@ -764,7 +764,7 @@ def get_data(
- :attr:`requested_data`
"""
# Provide data as requested, will return the requested data
global rod_data
global rod_data # noqa: F824
lock.lockForRead()
out_data = rod_data
lock.unlock()
Expand Down Expand Up @@ -797,7 +797,7 @@ def receive_updated_data(self, data: pd.DataFrame):
data : DataFrame
Updated/New rod position data
"""
global rod_data
global rod_data # noqa: F824
with QtCore.QWriteLocker(lock):
rod_data.set_index(["color", "frame", "particle"], inplace=True)
try:
Expand Down Expand Up @@ -842,7 +842,7 @@ def add_data(self, data: pd.DataFrame):
--------
:meth:`catch_data`, :meth:`catch_number_switch`
"""
global rod_data
global rod_data # noqa: F824
if rod_data is None:
with QtCore.QWriteLocker(lock):
rod_data = data.copy()
Expand Down Expand Up @@ -1170,7 +1170,7 @@ def extract_seen_information(
``out_list = ["gp1_seen", "gp2_seen"]``
"""
if data is None:
global rod_data
global rod_data # noqa: F824
else:
rod_data = data
lock.lockForRead()
Expand Down Expand Up @@ -1230,7 +1230,7 @@ def delete_data(
Flag whether to delete all currently loaded data.
By default ``False``.
"""
global rod_data
global rod_data # noqa: F824
if all is True:
# delete all data contained in the current dataset
lock.lockForWrite()
Expand Down Expand Up @@ -1272,7 +1272,7 @@ def undo_action(self, action: lg.Action) -> None:
An :class:`.Action` that was logged previously. It will only be
reverted, if it associated with this object.
"""
global rod_data
global rod_data # noqa: F824
lock.lockForWrite()
if isinstance(action, lg.DeleteData):
rod_data = pd.concat([rod_data, action.del_data])
Expand All @@ -1295,7 +1295,7 @@ def clean_data(self):
-------
None
"""
global rod_data
global rod_data # noqa: F824
if rod_data is None:
# No position data loaded
return
Expand Down Expand Up @@ -1361,7 +1361,7 @@ def find_unused_rods() -> pd.DataFrame:
The rows from the given dataset that were identified as not being
used.
"""
global rod_data
global rod_data # noqa: F824
lock.lockForRead()
to_include = []
for col in rod_data.columns:
Expand Down Expand Up @@ -1392,7 +1392,7 @@ def update_settings(self, settings: dict):
-------
None
"""
global POSITION_SCALING
global POSITION_SCALING # noqa: F824
settings_changed = False
if (
"position_scaling" in settings
Expand Down Expand Up @@ -1431,7 +1431,7 @@ def change_data(new_data: dict) -> None:
Dictionary describing the new/changed rod data. Must contain the fields
``"frame"``, ``"cam_id"``, ``"color"``, ``"position"``, ``"rod_id"``.
"""
global rod_data
global rod_data # noqa: F824
lock.lockForWrite()
frame = new_data["frame"]
cam_id = new_data["cam_id"]
Expand Down Expand Up @@ -1521,7 +1521,7 @@ def rod_number_swap(
cam_id : str, optional
Default is ``None``.
"""
global rod_data
global rod_data # noqa: F824
lock.lockForWrite()
tmp_set = rod_data.copy()
if mode == lg.NumberChangeActions.ALL:
Expand Down
2 changes: 1 addition & 1 deletion RodTracker/src/RodTracker/ui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023 Adrian Niemann Dmitry Puzyrev
# Copyright (c) 2023-2024 Adrian Niemann, Dmitry Puzyrev
#
# This file is part of RodTracker.
# RodTracker is free software: you can redistribute it and/or modify
Expand Down
Loading