-
Notifications
You must be signed in to change notification settings - Fork 73
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
Tests for Yokogawa 7651 and tests + BF for Yokogawa 6370 #251
Conversation
- Full test suite for Yokogawa 7651 - Extended test suite for Yokogawa 6370 for complete coverage - Found two small bugs in Yokogawa 6370: - Routines `data` and `wavelength`, both return the data for the active trace, returned the method itself instead of the data. - These were also the two untested routines.
|
||
def wavelength(self): | ||
""" | ||
Query the wavelength axis of the active trace. | ||
""" | ||
return self.channel[self.active_trace].wavelength | ||
return self.channel[self.active_trace].wavelength() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a TODO brewing here. I'd say out of scope for this PR, but we should think about if we want to make wavelength
a property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two methods for data
and wavelength
are simply a shortcut to access the currently active channel. The channels themselves in fact also have the additional arguments for bin_format
:
def data(self, bin_format=True):
For oscilloscopes for example, getting data is also always defined as methods to allow for a bin_format
argument. If we want to turn it into a method there is the question on how to implement the bin_format
, maybe with a separate property on the data transfer format? If it is left as a method, it would be good to pass the bin_format
through in these methods. What do you think? That latter could easily be included here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is something we will have to think about by taking a look at the manual and seeing how we might expect the user to use the wavelength data here. I'm not super familiar with the instrument so I would need to check that first.
This is def a later-thing though, and I'm okay with how it is right now!
# METHODS # | ||
|
||
|
||
@given(values=st.lists(st.decimals(allow_infinity=False, allow_nan=False), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great use of hypothesis 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally stolen from further up in the test suite. But that's one way to start. More to come 😃
Tests
Bug fixes
data
andwavelength
, both return the data for theactive trace, returned the method itself instead of the data.