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

Tests for Yokogawa 7651 and tests + BF for Yokogawa 6370 #251

Merged
merged 1 commit into from
Aug 25, 2020

Conversation

trappitsch
Copy link
Contributor

Tests

  • Full test suite for Yokogawa 7651
  • Extended test suite for Yokogawa 6370 for complete coverage

Bug fixes

  • Found two small bugs in Yokogawa 6370:
    • Methods 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.

- 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()
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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),
Copy link
Contributor

Choose a reason for hiding this comment

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

Great use of hypothesis 👍

Copy link
Contributor Author

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 😃

@scasagrande scasagrande merged commit 4c1a67c into instrumentkit:master Aug 25, 2020
@trappitsch trappitsch deleted the tests_yokogawa branch August 25, 2020 16:49
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.

2 participants