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

Alazar: refactor AcquisitionInterface out of AcquisitionController #1694

Merged

Conversation

Dominik-Vogel
Copy link
Contributor

The Alazar AcquistionController is an interface for the alazar ats instrument, that takes care of handling the buffer data. In the current implementation this interface is a qcodes instrument.

In my opinion this is an unnecessary coupling between pure number crunching code and qcodes instruments. I therefore suggest to refactor an AcquisitionInterface out of the AcquisitionController, which only contains the interface methods.
By letting the AcquistionController inherit from AcquistionInterface and Instrument the original functionality should stay untouched.

Additionally I removed the NotImplementedErrors from some of the methods, which don't need to be implemented.

@codecov
Copy link

codecov bot commented Sep 4, 2019

Codecov Report

Merging #1694 into master will increase coverage by 0.02%.
The diff coverage is 45.45%.

@@            Coverage Diff             @@
##           master    #1694      +/-   ##
==========================================
+ Coverage   67.23%   67.25%   +0.02%     
==========================================
  Files         145      145              
  Lines       17939    17949      +10     
==========================================
+ Hits        12061    12072      +11     
+ Misses       5878     5877       -1

super().__init__(name, **kwargs)
self._alazar = self.find_instrument(alazar_name,
instrument_class=AlazarTech_ATS)
def __init__(self, *args, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not needed, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it might be, when using the interface as a mixin.

qcodes/instrument_drivers/AlazarTech/ATS.py Show resolved Hide resolved
@@ -889,38 +889,23 @@ class AcquisitionController(Instrument):
_alazar: a reference to the alazar instrument driver
Copy link
Contributor

Choose a reason for hiding this comment

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

should be removed as the interface doesn't have this attribute

Copy link
Collaborator

Choose a reason for hiding this comment

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

One should not document private attributes anyway

@Dominik-Vogel Dominik-Vogel merged commit 33e1791 into microsoft:master Sep 10, 2019
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.

None yet

3 participants