Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/close instruments #376

Merged
merged 3 commits into from
Nov 3, 2022

Conversation

Gracecr
Copy link
Contributor

@Gracecr Gracecr commented Oct 7, 2022

Allows for instruments to be used as context managers so you can do things like:

with ik.Instrument.open_test() as instr:
        instr.do_something()

This way you can be confident your connection is being closed properly.

@Gracecr
Copy link
Contributor Author

Gracecr commented Oct 13, 2022

Sort of addresses #215. I can add an actual close method to Instrument if desired.

@scasagrande
Copy link
Contributor

Sorry for the delay

Looks reasonable to me

I need to fix CI but then I'll get your PR merged in: #374

Copy link
Contributor

@scasagrande scasagrande left a comment

Choose a reason for hiding this comment

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

please update branch to bring in the other fixes

just 1 change requested

@@ -8,6 +8,8 @@

import socket
import io
import unittest
from instruments.abstract_instruments import instrument
Copy link
Contributor

Choose a reason for hiding this comment

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

please sort and group imports

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shouldn't have these import there in the first place. Good catch.

@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Merging #376 (398bf1f) into main (26cab7d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #376   +/-   ##
=======================================
  Coverage   99.01%   99.01%           
=======================================
  Files          87       87           
  Lines        8849     8855    +6     
=======================================
+ Hits         8762     8768    +6     
  Misses         87       87           
Flag Coverage Δ
unittests 99.01% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...abstract_instruments/comm/loopback_communicator.py 97.14% <100.00%> (+0.04%) ⬆️
src/instruments/abstract_instruments/instrument.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Gracecr Gracecr force-pushed the feat/close-instruments branch from d021392 to 398bf1f Compare November 3, 2022 21:29
Copy link
Contributor

@scasagrande scasagrande left a comment

Choose a reason for hiding this comment

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

lgtm! thank you for your contribution

@scasagrande scasagrande merged commit bf4e131 into instrumentkit:main Nov 3, 2022
@Gracecr Gracecr deleted the feat/close-instruments branch November 4, 2022 14:27
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