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

Driver / signalhound use standard logging #1154

Conversation

WilliamHPNielsen
Copy link
Contributor

@WilliamHPNielsen WilliamHPNielsen commented Jun 20, 2018

Fixes #415 and fixes #292

Changes proposed in this pull request:

  • Make the signalhound driver use standard logging like other drivers.
  • Dust off a few strings.

@QCoDeS/core @AdriaanRol

Copy link
Collaborator

@jenshnielsen jenshnielsen left a comment

Choose a reason for hiding this comment

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

Looks fine to me

@codecov
Copy link

codecov bot commented Jun 20, 2018

Codecov Report

Merging #1154 into master will increase coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1154      +/-   ##
==========================================
+ Coverage   79.78%   79.78%   +<.01%     
==========================================
  Files          48       48              
  Lines        6657     6663       +6     
==========================================
+ Hits         5311     5316       +5     
- Misses       1346     1347       +1

This is a direct port of the signal hound QTLab driver by Ramiro
Edited by Adriaan Rol
Edited by Adriaan Rol and others (use git blame for details)
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this comment useful for? i'd remove it since "git blame" is supposedly a known feature of git :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was trying to humorously point out that information about who wrote what does not really belong in a driver... From your comment I guess that I failed :) You can remove the whole shebang if you'd like.

Copy link
Contributor

Choose a reason for hiding this comment

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

😸 ok, i get it. well, I think that such a note is good fun for github comments, but should not be part of the code. So, I suggest to remove this line.

This is a direct port of the signal hound QTLab driver by Ramiro
Edited by Adriaan Rol
Edited by Adriaan Rol and others (use git blame for details)

Status: Beta version.
This driver is functional but not all features have been implemented.

TODO:
Add tracking generator mode
Copy link
Contributor

@astafan8 astafan8 Jun 20, 2018

Choose a reason for hiding this comment

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

can this line be reformulate from "TODO" to smth like : "Note that this driver does not support tracking generator mode". and then perhaps make a separate low-prio issue for "enabling tracking generator mode for ??? driver"? This will make the code distraction-free and potential-ambiguity-free

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I think it's better kept as it is. Missing driver features are non-issues until they become issues, if you know what I mean.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, agree. still, when I see "TODO", I understand it as developer-related thing, or a notion of a bug or deficiency. When the statement is formulated as smth like "Note that this driver does not support tracking generator mode", as a user I know that it hasn't been an issue so far and I do not expect the feature to be implemented UNLESS as a user I make an issue out of it on github.

@@ -141,14 +141,16 @@ def __init__(self, name, dll_path=None, **kwargs):
self.device_type()

t1 = time()
# poor-man's connect_message. We could overwrite get_idn
# instead and use connect_message.
Copy link
Contributor

Choose a reason for hiding this comment

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

does this supposed to be an issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nah.

Copy link
Contributor

Choose a reason for hiding this comment

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

then why making the comment? :)

self.log.info('Closing Device with handle num: ',
self.deviceHandle.value)
log.info('Closing Device with handle num: '
f'self.deviceHandle.value')
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't it be f'{self.deviceHandle.value}' (with { and })?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Good one.

@jenshnielsen
Copy link
Collaborator

@WilliamHPNielsen Would be good to get this merged

@WilliamHPNielsen
Copy link
Contributor Author

Once CI passes, let's merge.

@WilliamHPNielsen WilliamHPNielsen merged commit cfc97ec into microsoft:master Jul 20, 2018
@WilliamHPNielsen WilliamHPNielsen deleted the fix/driver/signalhound_logging branch July 20, 2018 11:55
giulioungaretti pushed a commit that referenced this pull request Jul 20, 2018
Merge: 8274239 880a751
Author: William H.P. Nielsen <whpn@mailbox.org>

    Merge pull request #1154 from WilliamHPNielsen/fix/driver/signalhound_logging
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.

SignalHound_USB_SA124B print statement. Signal Hound closedevice command is broken by recent change
3 participants