TheDeanLab / navigate

navigate - open source light-sheet microscope controls
https://thedeanlab.github.io/navigate/
Other
18 stars 5 forks source link

Fix for csv data loading error after a multi-position event #900

Closed annie-xd-wang closed 3 months ago

AdvancedImagingUTSW commented 3 months ago

One more problem found @annie-xd-wang - When we right-click on the image display and select mark position.

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\Spectral\.conda\envs\navigate\lib\tkinter\__init__.py", line 1892, in __call__
    return self.func(*args)
  File "C:\Users\Spectral\Documents\GitHub\navigate\src\navigate\controller\sub_controllers\camera_view_controller.py", line 458, in mark_position
    stage_position["x"] += offset_x * (-1 if stage_flip_flags["x"] else 1)
TypeError: can only concatenate str (not "int") to str
Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\Spectral\.conda\envs\navigate\lib\tkinter\__init__.py", line 1892, in __call__
    return self.func(*args)
  File "C:\Users\Spectral\Documents\GitHub\navigate\src\navigate\controller\sub_controllers\camera_view_controller.py", line 458, in mark_position
    stage_position["x"] += offset_x * (-1 if stage_flip_flags["x"] else 1)
TypeError: can only concatenate str (not "int") to str
AdvancedImagingUTSW commented 3 months ago

Another one found...

position is invalid
Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\Spectral\.conda\envs\navigate\lib\site-packages\pandas\core\indexes\base.py", line 3361, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas\_libs\index.pyx", line 76, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 2131, in pandas._libs.hashtable.Int64HashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 2140, in pandas._libs.hashtable.Int64HashTable.get_item
KeyError: 0

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Spectral\.conda\envs\navigate\lib\tkinter\__init__.py", line 1892, in __call__
    return self.func(*args)
  File "C:\Users\Spectral\Documents\GitHub\navigate\src\navigate\controller\sub_controllers\multi_position_controller.py", line 157, in handle_double_click
    temp = list(df.loc[rowclicked])
  File "C:\Users\Spectral\.conda\envs\navigate\lib\site-packages\pandas\core\indexing.py", line 931, in __getitem__
    return self._getitem_axis(maybe_callable, axis=axis)
  File "C:\Users\Spectral\.conda\envs\navigate\lib\site-packages\pandas\core\indexing.py", line 1164, in _getitem_axis
    return self._get_label(key, axis=axis)
  File "C:\Users\Spectral\.conda\envs\navigate\lib\site-packages\pandas\core\indexing.py", line 1113, in _get_label
    return self.obj.xs(label, axis=axis)
  File "C:\Users\Spectral\.conda\envs\navigate\lib\site-packages\pandas\core\generic.py", line 3776, in xs
    loc = index.get_loc(key)
  File "C:\Users\Spectral\.conda\envs\navigate\lib\site-packages\pandas\core\indexes\base.py", line 3363, in get_loc
    raise KeyError(key) from err
KeyError: 0
position is invalid
position is invalid
position is invalid
position is invalid
codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 30.00000% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 51.06%. Comparing base (fb182fe) to head (3302189). Report is 4 commits behind head on develop.

:exclamation: Current head 3302189 differs from pull request most recent head 586c903

Please upload reports for the commit 586c903 to get more accurate results.

Files Patch % Lines
...oller/sub_controllers/multi_position_controller.py 0.00% 4 Missing :warning:
...ntroller/sub_controllers/camera_view_controller.py 0.00% 2 Missing :warning:
...ate/controller/sub_controllers/stage_controller.py 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #900 +/- ## =========================================== + Coverage 51.04% 51.06% +0.01% =========================================== Files 178 178 Lines 19054 19055 +1 =========================================== + Hits 9727 9730 +3 + Misses 9327 9325 -2 ``` | [Flag](https://app.codecov.io/gh/TheDeanLab/navigate/pull/900/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheDeanLab) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/TheDeanLab/navigate/pull/900/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheDeanLab) | `51.06% <30.00%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheDeanLab#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.