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

Signal Generation Restructure and addition of high level methods #183

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

qthompso
Copy link
Contributor

@qthompso qthompso commented Apr 2, 2024

Proposed changes

This PR contains a fundamental change to how the signal generator (previously signal source) class is structured.
Along with this, there is a the introduction of many more high level functions to help with generating functions.
Please view the signal_generators.md documentation file for an in depth view of each of these methods.

Added

  • Added the constraint ranges for all signal generators
  • Added drivers for AWG and AFG channels
  • Added a property named source_channel in AWG's and AFG's.
  • Added drivers for internal AFG in TekScopes.
  • Added a property named internal_afg in TekScope.
  • Added implementation of generate_function for all AWG models.
  • Added two burst functions to SignalGeneratorMixin: one to set up burst and one to generate the burst by forcing trigger.
    • NOTE: Only the AFG's and internal AFG have these functions implemented.
  • Added OutputSignalPath enum attribute in AWG's representing output signal path options.
  • Added two functions for loading waveform set files in the AWG70k's and AWG5200: one for loading a waveform set file and another for loading a specific waveform from a waveform set file.
  • Added sample_waveform_set_file attribute in AWG70k's and AWG5200 to define the default waveform set file.

Changed

  • Changed the term "signal source" to "signal generator".
    • NOTE: BREAKING CHANGE. All uses of this term are changed. Import paths now use signal_generator instead of signal_source.
  • Changed the function name of generate_waveform() to generate_function().
    • NOTE: BREAKING CHANGE. generate_waveform() only exists on AWGs now, however the functionality is entirely changed.
  • Changed the generate_function() function by removing burst functionality.
    • NOTE: BREAKING CHANGE. Any use of burst now must use setup_burst() and generate_burst() instead.
  • Updated AWG's such that the family_base_class is at the model level.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Functionality update (non-breaking change which updates or changes existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • CI/CD update (an update to the CI/CD workflows, scripts, and/or configurations)
  • Documentation update (an update to enhance the user experience when reading through the docs)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have followed the guidelines in the CONTRIBUTING document
  • I have signed the CLA
  • I have checked to ensure there aren't other open Pull Requests for the same update/change
  • I have performed a self-review of my code
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • Basic linting passes locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added necessary documentation (if appropriate)
  • I have updated the Changelog with a brief description of my changes

lekevin678 and others added 5 commits October 25, 2023 14:17
set_if_needed: only sets the value if it is different from the current value
poll_query: poll query until desired value is returned
Added function generation
Added signal_generator doc
Updated structure of signal generators
added burst for AFGs

Signed-off-by: qthompso <quinn.thompson@tektronix.com>
merge master

Signed-off-by: qthompso <quinn.thompson@tektronix.com>
Signed-off-by: qthompso <quinn.thompson@tektronix.com>
@qthompso qthompso requested review from a team as code owners April 2, 2024 17:33
@CLAassistant
Copy link

CLAassistant commented Apr 2, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (47e563f) to head (f1e4330).
Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main      #183    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          170       172     +2     
  Lines         3804      4500   +696     
  Branches       643       761   +118     
==========================================
+ Hits          3804      4500   +696     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/tm_devices/drivers/pi/signal_generators/afgs/afg3k.py Dismissed Show dismissed Hide dismissed
src/tm_devices/drivers/pi/signal_generators/awgs/awg5200.py Dismissed Show dismissed Hide dismissed
src/tm_devices/drivers/pi/signal_generators/awgs/awg5k.py Dismissed Show dismissed Hide dismissed
src/tm_devices/drivers/pi/signal_generators/awgs/awg7k.py Dismissed Show dismissed Hide dismissed
src/tm_devices/drivers/pi/signal_generators/awgs/awg70ka.py Dismissed Show dismissed Hide dismissed
src/tm_devices/drivers/pi/signal_generators/awgs/awg5200.py Dismissed Show dismissed Hide dismissed
.github/workflows/create_temp_html.yml Outdated Show resolved Hide resolved
.github/workflows/upload_artifacts.yml Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
docs/advanced/signal_generators.md Outdated Show resolved Hide resolved
docs/advanced/signal_generators.md Outdated Show resolved Hide resolved
docs/advanced/signal_generators.md Outdated Show resolved Hide resolved
docs/advanced/signal_generators.md Outdated Show resolved Hide resolved
docs/advanced/signal_generators.md Outdated Show resolved Hide resolved
@nfelt14
Copy link
Collaborator

nfelt14 commented Apr 3, 2024

Please also update the pull request title and description. It needs to have all the relevant information anyone might look for in the future.

@qthompso qthompso changed the title Function generation Signal Generation Restructure and addition of high level methods Apr 4, 2024
Signed-off-by: qthompso <quinn.thompson@tektronix.com>
Signed-off-by: qthompso <quinn.thompson@tektronix.com>
docs/basic_usage.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
examples/signal_generators/generate_function.py Outdated Show resolved Hide resolved
src/tm_devices/drivers/pi/scopes/tekscope/tekscope.py Outdated Show resolved Hide resolved
docs/advanced/signal_generators.md Outdated Show resolved Hide resolved
docs/advanced/signal_generators.md Outdated Show resolved Hide resolved
docs/advanced/signal_generators.md Outdated Show resolved Hide resolved
docs/advanced/signal_generators.md Outdated Show resolved Hide resolved
Moved some classes around

Signed-off-by: qthompso <quinn.thompson@tektronix.com>
Signed-off-by: qthompso <quinn.thompson@tektronix.com>
channel_name: The channel name for the AWG source channel.
"""
super().__init__(awg=awg, channel_name=channel_name)
self._awg = awg

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class Warning

Assignment overwrites attribute _awg, which was previously defined in superclass
AWGSourceChannel
.
channel_name: The channel name for the AWG source channel.
"""
super().__init__(awg=cast(AWG5K, awg), channel_name=channel_name)
self._awg = awg

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class Warning

Assignment overwrites attribute _awg, which was previously defined in superclass
AWGSourceChannel
.
Assignment overwrites attribute _awg, which was previously defined in superclass
AWG5KSourceChannel
.
channel_name: The channel name for the AWG source channel.
"""
super().__init__(awg=awg, channel_name=channel_name)
self._awg = awg

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class Warning

Assignment overwrites attribute _awg, which was previously defined in superclass
AWGSourceChannel
.
Copy link

github-actions bot commented Apr 16, 2024

Test Results (windows)

path passed subtotal
tests\test_afgs.py 2 2
tests\test_alias_dict.py 1 1
tests\test_all_device_drivers.py 1 1
tests\test_alternative_connection_addresses.py 17 17
tests\test_awgs.py 4 4
tests\test_config_parser.py 34 34
tests\test_device_manager.py 18 18
tests\test_devices_legacy_tsp_ieee_cmds.py 3 3
tests\test_generate_waveform.py 6 6
tests\test_helpers.py 68 68
tests\test_ieee_scpi_cmds.py 1 1
tests\test_margin_testers.py 5 5
tests\test_pi_device.py 1 1
tests\test_psu.py 1 1
tests\test_rest_api_device.py 10 10
tests\test_scopes.py 7 7
tests\test_singleton.py 1 1
tests\test_smu.py 4 4
tests\test_ss.py 1 1
tests\test_tm_devices.py 4 4
TOTAL 189 189

Link to workflow run

Copy link

github-actions bot commented Apr 16, 2024

Test Results (macos)

path passed failed subtotal
tests/test_afgs.py 1 1 2
tests/test_alias_dict.py 1 1
tests/test_all_device_drivers.py 1 1
tests/test_alternative_connection_addresses.py 17 17
tests/test_awgs.py 4 4
tests/test_config_parser.py 34 34
tests/test_device_manager.py 18 18
tests/test_devices_legacy_tsp_ieee_cmds.py 3 3
tests/test_generate_waveform.py 6 6
tests/test_helpers.py 68 68
tests/test_ieee_scpi_cmds.py 1 1
tests/test_margin_testers.py 5 5
tests/test_pi_device.py 1 1
tests/test_psu.py 1 1
tests/test_rest_api_device.py 10 10
tests/test_scopes.py 7 7
tests/test_singleton.py 1 1
tests/test_smu.py 4 4
tests/test_ss.py 1 1
tests/test_tm_devices.py 4 4
TOTAL 188 1 189
tests/test_afgs.py
device_manager = <tm_devices.device_manager.DeviceManager object at 0x1163a1760>

    def test_afg3k(device_manager: DeviceManager) -> None:  # noqa: PLR0915  # pylint: disable=too-many-locals
        """Test the AFG3KC driver.
    
        Args:
            device_manager: The DeviceManager object.
        """
        afg3252c = device_manager.add_afg(
            "afg3252c-hostname", alias="afg3252c", connection_type="SOCKET", port=10001
        )
        assert id(device_manager.get_afg(number_or_alias="afg3252c")) == id(afg3252c)
        assert id(device_manager.get_afg(number_or_alias=1)) == id(afg3252c)
        assert afg3252c.visa_timeout == UNIT_TEST_TIMEOUT
        assert afg3252c.default_visa_timeout == UNIT_TEST_TIMEOUT
        assert afg3252c.resource_expression == "TCPIP0::AFG3252C-HOSTNAME::10001::SOCKET"
        assert afg3252c.total_channels == 2
        assert afg3252c.idn_string == "TEKTRONIX,AFG3252C,SERIAL1,SCPI:99.0 FV:3.2.3"
        assert afg3252c.sw_version == Version("3.2.3")
        assert afg3252c.all_channel_names_list == ("SOURCE1", "SOURCE2")
>       assert afg3252c.visa_backend == "PyVISA-sim"
E       AssertionError: assert '' == 'PyVISA-sim'
E         
E         - PyVISA-sim

afg3252c   = <tm_devices.drivers.pi.signal_generators.afgs.afg3kc.AFG3KC object at 0x1160ae330>
device_manager = <tm_devices.device_manager.DeviceManager object at 0x1163a1760>

tests/test_afgs.py:39: AssertionError

Link to workflow run

Copy link

github-actions bot commented Apr 16, 2024

Test Results (ubuntu)

path passed subtotal
tests/test_afgs.py 2 2
tests/test_alias_dict.py 1 1
tests/test_all_device_drivers.py 1 1
tests/test_alternative_connection_addresses.py 17 17
tests/test_awgs.py 4 4
tests/test_config_parser.py 34 34
tests/test_device_manager.py 18 18
tests/test_devices_legacy_tsp_ieee_cmds.py 3 3
tests/test_generate_waveform.py 6 6
tests/test_helpers.py 68 68
tests/test_ieee_scpi_cmds.py 1 1
tests/test_margin_testers.py 5 5
tests/test_pi_device.py 1 1
tests/test_psu.py 1 1
tests/test_rest_api_device.py 10 10
tests/test_scopes.py 7 7
tests/test_singleton.py 1 1
tests/test_smu.py 4 4
tests/test_ss.py 1 1
tests/test_tm_devices.py 4 4
TOTAL 189 189

Link to workflow run

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

4 participants