Skip to content

Conversation

AdvancedImagingUTSW
Copy link
Collaborator

Tried to create a more uniform way for closing tasks so that our console isn't cluttered upon exit.

There remains one traceback from the threading library.

If we replace raise SystemExit() with os._exit(1) in the following code this is eliminated completely:

        if event == "exception":
            if os.getenv("GITHUB_ACTIONS") == "true":
                return

            # Silence traceback to avoid printing to console.
            sys.tracebacklimit = 0
            raise SystemExit()
        return self.localtrace

I was hesitant to make this change because this method apparently does not invoke the normal Python cleanup routines (like flushing I/O buffers, calling finally blocks, etc.).

JinlongL and others added 8 commits October 16, 2024 08:55
I would like to make the __del__ call consistent for all devices, but I will have to go through the stages to do this.

Co-Authored-By: Kevin M. Dean <kevin.dean@utsouthwestern.edu>
I will clean up some of the close calls when I create an abstract base class later on.
Eliminate print statements in thread pool...
Fix the test...
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 45.92593% with 73 lines in your changes missing coverage. Please review.

Project coverage is 54.37%. Comparing base (f9b3532) to head (a8b9d74).
Report is 12 commits behind head on develop.

Files with missing lines Patch % Lines
src/navigate/model/devices/daq/ni.py 0.00% 16 Missing ⚠️
src/navigate/model/microscope.py 16.66% 10 Missing ⚠️
src/navigate/model/devices/filter_wheel/ni.py 0.00% 9 Missing ⚠️
src/navigate/model/devices/shutter/ni.py 14.28% 6 Missing ⚠️
.../model/devices/remote_focus/equipment_solutions.py 0.00% 5 Missing ⚠️
src/navigate/model/devices/lasers/ni.py 66.66% 4 Missing ⚠️
src/navigate/model/devices/zoom/dynamixel.py 0.00% 4 Missing ⚠️
src/navigate/controller/thread_pool.py 0.00% 3 Missing ⚠️
src/navigate/model/devices/filter_wheel/ludl.py 0.00% 3 Missing ⚠️
src/navigate/model/devices/mirrors/imop.py 0.00% 2 Missing ⚠️
... and 7 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1018      +/-   ##
===========================================
+ Coverage    54.32%   54.37%   +0.04%     
===========================================
  Files          180      180              
  Lines        20319    20395      +76     
===========================================
+ Hits         11038    11089      +51     
- Misses        9281     9306      +25     
Flag Coverage Δ
unittests 54.37% <45.92%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

def __del__(self):
"""Delete HamamatsuOrca class."""
pass
self.close_camera()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling close_camera() here causes a DCAM error.

@AdvancedImagingUTSW AdvancedImagingUTSW merged commit bdee78c into develop Nov 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants