diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c20799bf..e2bae024 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,12 +37,19 @@ jobs: sudo dpkg -i pandoc-2.18-1-amd64.deb cd docs && make html EXAMPLE_SRC=remote - - name: "Test spelling docs" - run: | - cd docs && sphinx-build -b spelling -q source build/spelling - - name: Store artifacts uses: actions/upload-artifact@v2 with: name: docs path: docs/build/html + + - name: "Test spelling docs" + run: | + cd docs && sphinx-build -b spelling -q -W --keep-going source build/spelling + + - name: Store spelling result artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: docs-spelling-failure-report + path: docs/build/spelling diff --git a/CHANGELOG.md b/CHANGELOG.md index 578ce251..dcafc9b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ ## Version 0.3.2 * Added a helper function ``uhfqa.qas[n].integration.write_integration_weights`` for QAS integration weights configuration -* Bugfix: Adapt nodetree to be able to get daq result data #113 +* Bugfix: Adapt Node Tree to be able to get daq result data #113 * Bugfix: in the ``Waveform`` class to be able to convert a single waveform into a complex waveform. * Bugfix: HF2 PID nodes are available. @@ -30,7 +30,7 @@ * pqsc.check_zsync_connection blocks even if nothing is connected * Create a temporary awg module every time a sequencer code is uploaded (The reason for it is to have de defined state) #104 -* reintroduce uhfqa.qa_deleay function +* reintroduce uhfqa.qa_delay function * uhfli/uhfqa return node object for ``uhfli.awg`` instead of raising an error (necessary for qcodes drivers) #102 * ``hdawg.enable_qccs_mode`` wrong reference clock source fixed @@ -47,9 +47,9 @@ * Improved testing with mocking ## Version 0.2.4 -* Adapt modulation frequence range to +-1GHz +* Adapt modulation frequency range to +-1GHz (shfsg.sgchannels[i].modulation_freq, shfqa.qachannels[i].sweeper.oscillator_freq) -* Bugfix: DAQ module timout exception raises AttributeError +* Bugfix: DAQ module timeout exception raises AttributeError ## Version 0.2.3 * Make the command table validation optional @@ -57,7 +57,7 @@ ## Version 0.2.2 * SHFQA Adapt oscillator_freq to +-500e6 Hz * Initial support for SHFSG -* Make nodetree generation case insensitive +* Make Node Tree generation case insensitive ## Version 0.2.1 * Bugfix #86 @@ -103,6 +103,4 @@ * minor fixes and additions ## Version 0.1.0 -* Intial release - - +* Initial release diff --git a/docs/make.bat b/docs/make.bat index 765438d3..d5c5c189 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -7,17 +7,17 @@ REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) + set SOURCEDIR=source set BUILDDIR=build set EXAMPLE_SRC=%2 -if %2 == "" ( +if "%2" == "" ( set EXAMPLE_SRC=local ) if "%1" == "" goto help - %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( echo. diff --git a/docs/requirements.txt b/docs/requirements.txt index e3cbe8dc..73563bea 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -7,4 +7,5 @@ pydata_sphinx_theme<0.9.0 # TODO: Custom CSS/templates do not work with newest v sphinx_autodoc_typehints jupytext==1.13.7 ipython -requests \ No newline at end of file +requests +sphinxcontrib-spelling \ No newline at end of file diff --git a/docs/source/examples/common_device.rst b/docs/source/examples/common_device.rst index 530cce37..9e1b9414 100644 --- a/docs/source/examples/common_device.rst +++ b/docs/source/examples/common_device.rst @@ -40,8 +40,8 @@ access the node specific information. /dev3036/demods/0/oscselect, ...] -The node tree is automatically generated during the initialisation of the device -in toolkit. It is based on the information provided by the device and therfore +The node tree is automatically generated during the initialization of the device +in toolkit. It is based on the information provided by the device and therefore adapts automatically to a new firmware. Check Compatibility @@ -53,14 +53,14 @@ if not all versions are up to date important feature or fixes by be missing. To ensure that all versions match each device exposes a function called ``check_compatibility`` which only passes if all versions match. -The following criterias are checked: +The following criteria are checked: * minimum required zhinst-deviceutils package is installed * minimum required zhinst-ziPython package is installed * zhinst package matches the LabOne Data Server version * firmware revision matches the LabOne Data Server version¨ -If any of the above criterias is not fullfilled ``check_compatibility`` will +If any of the above criterion is not fulfilled ``check_compatibility`` will raise RuntimeError. Transactional Set @@ -97,7 +97,7 @@ Factory reset ------------- To reset a device to the factory settings LabOne has a default preset. All -toolkit device classes therfor expose a function called ``factory_reset`` which +toolkit device classes therefor expose a function called ``factory_reset`` which loads the default preset. .. code-block:: python @@ -109,5 +109,5 @@ loads the default preset. Not all devices support the factory devices yet. If a device does not support the factory reset it will issue a warning when trying to call it. In that - case a powercycle has the same effect. + case a power cycle has the same effect. diff --git a/docs/source/examples/pqsc.rst b/docs/source/examples/pqsc.rst index 1e893777..e6d67aca 100644 --- a/docs/source/examples/pqsc.rst +++ b/docs/source/examples/pqsc.rst @@ -12,12 +12,12 @@ tune-up and error correction adapted to the specific algorithm and computer architecture in use. Please refer to the `user manual `_ -for an indepth explanation of all features. +for an in-depth explanation of all features. Like every device the device specific settings and data is organized in a path like structure called the node tree. zhinst-toolkit provides a pythonic way of interacting with this node tree. For more information about all functionalities -and usage of the node tree in toolkit refer to the deditacted +and usage of the node tree in toolkit refer to the dedicated :doc:`section <../first_steps/nodetree>`. zhinst-toolkit offers the following helper functions for the PQSC: diff --git a/docs/source/examples/shfqa.rst b/docs/source/examples/shfqa.rst index 57e79b15..7761a603 100644 --- a/docs/source/examples/shfqa.rst +++ b/docs/source/examples/shfqa.rst @@ -7,12 +7,12 @@ to 8.5 GHz, and up to 4 readout channels that can faithfully discriminate up to 16 qubits, 8 qutrits or 5 ququads. Please refer to the `user manual `_ -for an indepth explanation of all features. +for an in-depth explanation of all features. Like every device the device specific settings and data is organized in a path like structure called the node tree. zhinst-toolkit provides a pythonic way of interacting with this node tree. For more information about all functionalities -and usage of the node tree in toolkit refer to the deditacted :doc:`section <../first_steps/nodetree>`. +and usage of the node tree in toolkit refer to the dedicated :doc:`section <../first_steps/nodetree>`. The package ``zhinst-deviceutils`` provided by Zurich Instruments offers a collection of helper functions to ease the use of the SHFQA among other devices. @@ -24,7 +24,7 @@ the equivalent functions in zhinst-toolkit. :widths: 25 25 50 :header-rows: 1 - * - zhinst-devieutils + * - zhinst-deviceutils - zhinst-toolkit - info * - start_continuous_sw_trigger() diff --git a/docs/source/examples/shfsg.rst b/docs/source/examples/shfsg.rst index 9eb8a887..cbe45af8 100644 --- a/docs/source/examples/shfsg.rst +++ b/docs/source/examples/shfsg.rst @@ -9,16 +9,16 @@ system tune-up. Each SHFSG comes with 4 or 8 analog output channels with 14-bit vertical resolution. Please refer to the `user manual `_ -for an indepth explanation of all features. +for an in-depth explanation of all features. Like every device the device specific settings and data is organized in a path like structure called the node tree. zhinst-toolkit provides a pythonic way of interacting with this node tree. For more information about all functionalities -and usage of the node tree in toolkit refer to the deditacted :doc:`section <../first_steps/nodetree>`. +and usage of the node tree in toolkit refer to the dedicated :doc:`section <../first_steps/nodetree>`. The package ``zhinst-deviceutils`` provided by Zurich Instruments offers a collection of helper functions to ease the use of the SHFSG among other devices. -Toolkit embedds these functions inside the nodetree. The follwoing table shows +Toolkit embeds these functions inside the nodetree. The following table shows the equivalent functions in zhinst-toolkit. @@ -26,7 +26,7 @@ the equivalent functions in zhinst-toolkit. :widths: 25 25 50 :header-rows: 1 - * - zhinst-devieutils + * - zhinst-deviceutils - zhinst-toolkit - info * - **sgchannel** diff --git a/docs/source/examples/uhfqa.rst b/docs/source/examples/uhfqa.rst index d873aeef..86290c3c 100644 --- a/docs/source/examples/uhfqa.rst +++ b/docs/source/examples/uhfqa.rst @@ -11,12 +11,12 @@ UHFQA supports the development of ambitious quantum computing projects for 100 qubits and more. Please refer to the `user manual `_ -for an indepth explanation of all features. +for an in-depth explanation of all features. Like every device the device specific settings and data is organized in a path like structure called the node tree. zhinst-toolkit provides a pythonic way of interacting with this node tree. For more information about all functionalities -and usage of the node tree in toolkit refer to the deditacted +and usage of the node tree in toolkit refer to the dedicated :doc:`section <../first_steps/nodetree>`. zhinst-toolkit offers the following helper functions for the UHFQA: diff --git a/docs/source/first_steps/installation.rst b/docs/source/first_steps/installation.rst index 1c051694..21bebc00 100644 --- a/docs/source/first_steps/installation.rst +++ b/docs/source/first_steps/installation.rst @@ -17,10 +17,10 @@ These distributions will be installed automatically when installing zhinst-toolk functions to operate on these arrays. * `jsonschema `_ is an implementation of the JSON Schema specification for Python. -* `zhinst `_ is the low level python api for Zurich +* `zhinst `_ is the low level python API for Zurich Instruments devices. * `zhinst-deviceutils `_ is a collection - of helper functions for the LabOne® python api. + of helper functions for the LabOne® python API. Install zhinst-toolkit ---------------------- diff --git a/docs/source/index.rst b/docs/source/index.rst index cd4e18a6..8f3be77c 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -6,14 +6,14 @@ | Zurich Instruments Toolkit |version| Documentation -=================================================== +================================================== zhinst-toolkit is a high level driver package that allows communication with Zurich Instruments devices from the Python programming language. It is based on top of the native `Python API `_ (``zhinst.ziPython``) of LabOne®, the Zurich Instruments control software. -The central goal of zhinst-toolkit is to provide a pythonic approach to interact +The central goal of zhinst-toolkit is to provide a Pythonic approach to interact with any Zurich Instruments device and is intended as a full replacement for the low level ``zhinst.ziPython`` package. diff --git a/docs/source/spelling_wordlist.txt b/docs/source/spelling_wordlist.txt index fe36e6cb..730a7e0d 100644 --- a/docs/source/spelling_wordlist.txt +++ b/docs/source/spelling_wordlist.txt @@ -96,4 +96,11 @@ autorange Loopback gaussian upconversion -clockbase \ No newline at end of file +clockbase +demodulator +transactional +parsers +sideband +crosstalk +waveforms +Waveforms \ No newline at end of file diff --git a/examples/awg.md b/examples/awg.md index 3e37dee1..8d1b309f 100644 --- a/examples/awg.md +++ b/examples/awg.md @@ -38,7 +38,7 @@ Connect devices and access the ``/awg`` node. from zhinst.toolkit import Session session = Session('localhost') -device = session.connect_device("DEV8541") +device = session.connect_device("DEVXXXX") awg_node = device.awgs[0] ``` @@ -67,10 +67,6 @@ waitWave(); awg_node.load_sequencer_program(SEQUENCER_CODE) ``` -```python -session.daq_server.listNodes("/DEV8541/AWGS/0/WAVEFORM") -``` - ```python awg_node.enable_sequencer(single=True) awg_node.wait_done() @@ -98,7 +94,7 @@ format take a look at the awg section in the zhinst-toolkit itself offers a second, more user friendly approach through the class called ``Waveforms``. -The ``Waveform`` class is a mutuable mapping, meaning it behaves similiar to a +The ``Waveform`` class is a mutable mapping, meaning it behaves similar to a Python dictionary. The key defines the waveform index and the value is the waveform data provided as a tuple. The waveform data consists of the following elements: @@ -132,7 +128,7 @@ awg_node.write_to_waveform_memory(waveforms) > > The waveform data can also be assigned via the helper function > ``assign_waveform`` which converts the data into the same tuple -> as used above. Similiar ``assign_native_awg_waveform`` can be used to +> as used above. Similar ``assign_native_awg_waveform`` can be used to > assign already to a single native AWG format array converted waveform data to > an index. @@ -162,10 +158,10 @@ For more information on the usage and advantages of the command table reference to the [user manuals](https://docs.zhinst.com/hdawg_user_manual/tutorial_command_table.html#umhd.tutorials.ct.introduction). Note that the command table is not supported on all devices that have an AWG. -The command tables is specified in the JSON format and need to comform to a device +The command tables is specified in the JSON format and need to conform to a device specific schema. The user manuals explain in detail how the command table is structured and used. Similar to the Waveforms zhinst-toolkit offers a helper class -for the comman table usage called ``CommandTable``. +for the command table usage called ``CommandTable``. > Note: > diff --git a/examples/daq_module.md b/examples/daq_module.md index a410ad53..9c7c62ed 100644 --- a/examples/daq_module.md +++ b/examples/daq_module.md @@ -13,7 +13,7 @@ jupyter: name: python3 --- -# DAQ Data Aquisition +# DAQ Data Acquisition Example for the Data Acquisition Module. This example demonstrates how to record data from an instrument continuously (without triggering). @@ -36,7 +36,7 @@ from zhinst.toolkit import Session import numpy as np session = Session('localhost') -device = session.connect_device("dev3036") +device = session.connect_device("DEVXXXX") ``` ### General configuration diff --git a/examples/hf2.md b/examples/hf2.md index f9e06131..54e0758c 100644 --- a/examples/hf2.md +++ b/examples/hf2.md @@ -21,10 +21,10 @@ developed by Zurich Instruments. Since the initial release of the HF2 a lot more Instruments have joined the family of Zurich Instrument and the features of LabOne where constantly upgraded. Never the less the HF2LI offers exceptional features and measurement performance and is of course still fully supported by -LabOne and zhinst-toolkit. However it has a few specialities like a seperate +LabOne and zhinst-toolkit. However it has a few specialties like a separate Data Sever or the maximal support of API level 1. -Never the less toolkit offers a similiar handling of the HF2 compared to other +Never the less toolkit offers a similar handling of the HF2 compared to other devices. Since the HF2 uses a different data server one can not share a session with other devices. @@ -63,9 +63,9 @@ device.demods[0].enable() ## Polling DEMOD Samples -To get samples for the device subscribe and poll is the prefered way. +To get samples for the device subscribe and poll is the preferred way. After the subscribe command the data server will the node changes in an -internaly. In case of a sample node the values will be updated by the device in +internally. In case of a sample node the values will be updated by the device in the respective sampling frequency. With the poll command the buffered data can be fetched. @@ -193,7 +193,7 @@ print( ### Plot -#### Bode Diagramm +#### Bode Diagram ```python import matplotlib.pyplot as plt diff --git a/examples/nodetree.md b/examples/nodetree.md index 3343e7ad..f5eb6c8b 100644 --- a/examples/nodetree.md +++ b/examples/nodetree.md @@ -54,7 +54,7 @@ device.root ## Accessing nodes -The nested dictionary is a lazy structure that offers a performant and user-friendly +The nested dictionary is a lazy structure that offers a efficient and user-friendly approach to the LabOne® node tree. It offers full support for Unix wildcards and nodes can either be specified by attribute or by item. @@ -80,7 +80,7 @@ value on every node that matches it (the return type will be a dictionary). > Warning: > > Setting a value to a non leaf node will set the value of all child lead nodes. -> It should therefor be used with great care to avoid unintentionall changes. +> It should therefor be used with great care to avoid unintentional changes. ```python device.demods[0].order() @@ -182,7 +182,7 @@ device.demods[0].enable(parse= False) Setting up an experiment normal requires setting a couple of nodes to the correct value. Since every call operation triggers an individual message to the data server, this can take a noticeable amount of time. To avoid this LabOne® offers -an api functionality called transactional set. This functionality enables the user +an API functionality called transactional set. This functionality enables the user to bundle multiple set commands into a single command/message. In zhinst.toolkit the functionality of a transactional set is wrapped in a context manager (``with`` statement). Every set operation within this context will be buffered @@ -266,7 +266,7 @@ The above described call operator is a synchronous get request. Meaning it will block until it receives the data from the data server or the device (in case of a deep get). LabOne® also provides the interface for a asynchronous get. In toolkit each node has a function called ``get_as_event``. It will add the current -value of that node into the buffer of the dataserver. The next poll command will +value of that node into the buffer of the Data Server. The next poll command will return that value. ```python @@ -276,7 +276,7 @@ session.poll() ### Wait for state change -Sometimes it is necessary to hold the programm until a node has a specific value. +Sometimes it is necessary to hold the until a node has a specific value. One common example is that for some operations the device resets a node value to signal that a measurement is complete. @@ -309,7 +309,7 @@ LabOne® offers a node filter mechanism. In toolkit this filtering is implemente in the ``child_nodes`` function. Without any additional flags it returns all the leaf nodes that belong to that node. -(Leaf nodes will return themself, wildcard and partial nodes will return their +(Leaf nodes will return themselves, wildcard and partial nodes will return their child nodes). Since the list of nodes that will be returned is potentially very large, the diff --git a/examples/scope_module.md b/examples/scope_module.md index e6de93a2..214aef64 100644 --- a/examples/scope_module.md +++ b/examples/scope_module.md @@ -98,7 +98,7 @@ with device.set_transaction(): device.scopes[0].segments.enable(False) ``` -### Initialising the scope module +### Initializing the scope module ```python AVERAGER_WEIGHT = 1 diff --git a/examples/shfqa_qubit_readout_weights.md b/examples/shfqa_qubit_readout_weights.md index b89cb512..938dae01 100644 --- a/examples/shfqa_qubit_readout_weights.md +++ b/examples/shfqa_qubit_readout_weights.md @@ -15,7 +15,7 @@ jupyter: # Measuring qubit readout weights -Measure the integration weights for a qubit readout by using gaussian flat top pulses. +Measure the integration weights for a qubit readout by using Gaussian flat top pulses. Requirements: diff --git a/examples/shfqa_sweeper.md b/examples/shfqa_sweeper.md index 9b8b057c..368ae252 100644 --- a/examples/shfqa_sweeper.md +++ b/examples/shfqa_sweeper.md @@ -45,7 +45,7 @@ All parameters can be accessed through their corresponding node: * device: Device to run the sweeper with * sweep: Frequency range settings for a sweep -* rf: RF in- and ouput settings for a sweep +* rf: RF in- and output settings for a sweep * average: Averaging settings for a sweep * trigger: Settings for the trigger * envelope: Settings for defining a complex envelope for pulsed spectroscopy @@ -59,7 +59,7 @@ used in the same way. ### Configure the sweeper (Besides the measurement specific parameters the device that the sweeper will use -must be specfied as well.) +must be specified as well.) ```python sweeper.device(device) diff --git a/src/zhinst/toolkit/command_table.py b/src/zhinst/toolkit/command_table.py index 7fb4b640..5ccb9ec5 100644 --- a/src/zhinst/toolkit/command_table.py +++ b/src/zhinst/toolkit/command_table.py @@ -52,7 +52,7 @@ def is_empty(self) -> bool: """Check if the Node is empty and has no properties. Returns: - bool: If childs exists. + bool: If children exists. """ return not bool(self._childs) @@ -335,7 +335,7 @@ def update(self, command_table: t.Union[str, dict]) -> None: """Update the existing instance of ``CommandTable`` with command table JSON. If both command tables have the same properties, the existing ones - are overwritted by the new command table. + are overwritten by the new command table. Args: command_table: Existing command table JSON. diff --git a/src/zhinst/toolkit/driver/__init__.py b/src/zhinst/toolkit/driver/__init__.py index 3a1eb02a..90a38d6c 100644 --- a/src/zhinst/toolkit/driver/__init__.py +++ b/src/zhinst/toolkit/driver/__init__.py @@ -2,4 +2,4 @@ # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. -"""Inividual drivers for the devices and modules.""" +"""Individual drivers for the devices and modules.""" diff --git a/src/zhinst/toolkit/driver/devices/base.py b/src/zhinst/toolkit/driver/devices/base.py index dfcc6ee1..3a8fb0c1 100644 --- a/src/zhinst/toolkit/driver/devices/base.py +++ b/src/zhinst/toolkit/driver/devices/base.py @@ -1,6 +1,6 @@ """Base Instrument Driver -Nativly works with all device types and provides the basic functionality like +Natively works with all device types and provides the basic functionality like the device specific nodetree. """ import copy @@ -220,7 +220,7 @@ def check_compatibility(self) -> None: """Check if the software stack is compatible. Only if all versions and revisions of the software stack match stability - can be ensured. The following criterias are checked: + can be ensured. The following criteria are checked: * minimum required zhinst-deviceutils package is installed * minimum required zhinst-ziPython package is installed @@ -229,7 +229,7 @@ def check_compatibility(self) -> None: Raises: ConnectionError: If the device is currently updating - RuntimeError: If one of the above mentioned criterias is not + RuntimeError: If one of the above mentioned criterion is not fulfilled """ self._check_python_versions( @@ -306,7 +306,7 @@ def set_transaction(self) -> t.ContextManager: affected) Warning: - The set is always perfromed as deep set if called on device nodes. + The set is always performed as deep set if called on device nodes. Examples: >>> with device.set_transaction(): diff --git a/src/zhinst/toolkit/driver/devices/pqsc.py b/src/zhinst/toolkit/driver/devices/pqsc.py index bd63d418..bbdf8aa4 100644 --- a/src/zhinst/toolkit/driver/devices/pqsc.py +++ b/src/zhinst/toolkit/driver/devices/pqsc.py @@ -26,7 +26,7 @@ def arm(self, *, deep=True, repetitions: int = None, holdoff: float = None) -> N the feedback arrives. Otherwise, the feedback cannot be processed. Args: - deep: A flag that specifies if a synchronisation + deep: A flag that specifies if a synchronization should be performed between the device and the data server after stopping the PQSC and clearing the register bank (default: True). @@ -54,7 +54,7 @@ def run(self, *, deep: bool = True) -> None: connected instruments over ZSync ports. Args: - deep: A flag that specifies if a synchronisation + deep: A flag that specifies if a synchronization should be performed between the device and the data server after enabling the PQSC (default: True). @@ -64,7 +64,7 @@ def run(self, *, deep: bool = True) -> None: def arm_and_run(self, *, repetitions: int = None, holdoff: float = None) -> None: """Arm the PQSC and start sending out triggers. - Simply combines the methods arm and run. A synchronisation + Simply combines the methods arm and run. A synchronization is performed between the device and the data server after arming and running the PQSC. @@ -84,7 +84,7 @@ def stop(self, *, deep: bool = True) -> None: """Stop the trigger generation. Args: - deep: A flag that specifies if a synchronisation + deep: A flag that specifies if a synchronization should be performed between the device and the data server after disabling the PQSC (default: True). @@ -122,7 +122,7 @@ def check_ref_clock(self, *, timeout: int = 30, sleep_time: int = 1) -> bool: Raises: ToolkitError: If the process of locking to the reference clock - exeeds the specified timeout. + exceeds the specified timeout. """ ref_clock_status = self.system.clocks.referenceclock.in_.status ref_clock = self.system.clocks.referenceclock.in_.source diff --git a/src/zhinst/toolkit/driver/devices/shfqa.py b/src/zhinst/toolkit/driver/devices/shfqa.py index 60178340..7c14fe0f 100644 --- a/src/zhinst/toolkit/driver/devices/shfqa.py +++ b/src/zhinst/toolkit/driver/devices/shfqa.py @@ -23,7 +23,7 @@ class QAChannel(Node): - """Quantum Analyser Channel for the SHFQA. + """Quantum Analyzer Channel for the SHFQA. :class:`QAChannel` implements basic functionality to configure QAChannel settings of the :class:`SHFQA` instrument. @@ -117,7 +117,7 @@ def factory_reset(self, *, deep: bool = True) -> None: """Load the factory default settings. Args: - deep: A flag that specifies if a synchronisation + deep: A flag that specifies if a synchronization should be performed between the device and the data server after loading the factory preset (default: True). """ diff --git a/src/zhinst/toolkit/driver/devices/shfsg.py b/src/zhinst/toolkit/driver/devices/shfsg.py index 2cae276e..57949f3c 100644 --- a/src/zhinst/toolkit/driver/devices/shfsg.py +++ b/src/zhinst/toolkit/driver/devices/shfsg.py @@ -86,7 +86,7 @@ class SGChannel(Node): Args: device: SHFQA device object. session: Underlying session. - tree: Node tree (node path as tuple) of the coresponding node. + tree: Node tree (node path as tuple) of the corresponding node. """ def __init__( @@ -113,7 +113,7 @@ def configure_channel( Args: enable: Flag if the signal output should be enabled. - output_range: Maximal range of the signal output power in dbM + output_range: Maximal range of the signal output power in dBm center_frequency: Center frequency before modulation rf_path: Flag if the RF(True) or LF(False) path should be configured. @@ -240,7 +240,7 @@ def factory_reset(self, *, deep: bool = True) -> None: """Load the factory default settings. Args: - deep: A flag that specifies if a synchronisation + deep: A flag that specifies if a synchronization should be performed between the device and the data server after loading the factory preset (default: True). """ diff --git a/src/zhinst/toolkit/driver/devices/uhfqa.py b/src/zhinst/toolkit/driver/devices/uhfqa.py index 3e9684c3..9c158bc9 100644 --- a/src/zhinst/toolkit/driver/devices/uhfqa.py +++ b/src/zhinst/toolkit/driver/devices/uhfqa.py @@ -21,7 +21,7 @@ class Integration(Node): Args: root: Underlying node tree. - tree: tree (node path as tuple) of the coresponding node. + tree: tree (node path as tuple) of the corresponding node. .. versionadded:: 0.3.2 """ @@ -72,11 +72,11 @@ def write_integration_weights(self, weights: t.Union[Waveforms, dict]) -> None: class QAS(Node): - """Quantum Analyser Channel for the UHFQA. + """Quantum Analyzer Channel for the UHFQA. Args: root: Underlying node tree. - tree: tree (node path as tuple) of the coresponding node. + tree: tree (node path as tuple) of the corresponding node. """ def __init__( diff --git a/src/zhinst/toolkit/driver/modules/daq_module.py b/src/zhinst/toolkit/driver/modules/daq_module.py index cc07ceef..ae1ea6c5 100644 --- a/src/zhinst/toolkit/driver/modules/daq_module.py +++ b/src/zhinst/toolkit/driver/modules/daq_module.py @@ -135,7 +135,7 @@ def read( raw: Flag if the acquired data from the subscribed device device nodes should be converted into the DAQResult format (raw = False) or not. (default = False) - clk_rate: Clockrate [Hz] for converting the timestamps. Only + clk_rate: Clock rate [Hz] for converting the timestamps. Only applies if the raw flag is reset. Returns: diff --git a/src/zhinst/toolkit/driver/modules/shfqa_sweeper.py b/src/zhinst/toolkit/driver/modules/shfqa_sweeper.py index 1d5418f4..8e875f61 100644 --- a/src/zhinst/toolkit/driver/modules/shfqa_sweeper.py +++ b/src/zhinst/toolkit/driver/modules/shfqa_sweeper.py @@ -41,7 +41,7 @@ class SHFQASweeper(Node): All parameters can be accessed through their corresponding node: * device: Device to run the sweeper with * sweep: Frequency range settings for a sweep - * rf: RF in- and ouput settings for a sweep + * rf: RF in- and output settings for a sweep * average: Averaging settings for a sweep * trigger: Settings for the trigger * envelope: Settings for defining a complex envelope for pulsed spectroscopy diff --git a/src/zhinst/toolkit/driver/nodes/awg.py b/src/zhinst/toolkit/driver/nodes/awg.py index 6a7afb79..68cc5a02 100644 --- a/src/zhinst/toolkit/driver/nodes/awg.py +++ b/src/zhinst/toolkit/driver/nodes/awg.py @@ -28,7 +28,7 @@ class AWG(Node): tree: Tree (node path as tuple) of the current node session: Underlying session. serial: Serial of the device. - index: Index of the coresponding awg channel + index: Index of the corresponding awg channel device_type: Device type """ @@ -171,13 +171,13 @@ def write_to_waveform_memory( ) -> None: """Writes waveforms to the waveform memory. - The waveforms must already be assigned in the sequencer programm. + The waveforms must already be assigned in the sequencer program. Args: waveforms: Waveforms that should be uploaded. Raises: - IndexError: The index of a waveform exeeds the one on the device + IndexError: The index of a waveform exceeds the one on the device RuntimeError: One of the waveforms index points to a filler(placeholder) """ waveform_info = json.loads(self.waveform.descriptors()).get("waveforms", []) @@ -214,10 +214,10 @@ def read_from_waveform_memory(self, indexes: t.List[int] = None) -> Waveforms: Args: indexes: List of waveform indexes to read from the device. If not - specfied all assigned waveforms will be downloaded. + specified all assigned waveforms will be downloaded. Returns: - Mutuable mapping of the downloaded waveforms. + Mutable mapping of the downloaded waveforms. """ waveform_info = json.loads(self.waveform.descriptors()).get("waveforms", []) nodes = [] diff --git a/src/zhinst/toolkit/driver/nodes/command_table_node.py b/src/zhinst/toolkit/driver/nodes/command_table_node.py index 47fd9a32..3e9a9c29 100644 --- a/src/zhinst/toolkit/driver/nodes/command_table_node.py +++ b/src/zhinst/toolkit/driver/nodes/command_table_node.py @@ -22,7 +22,7 @@ class CommandTableNode(Node): This class implements the basic functionality of the command table allowing the user to load and upload their own command table. - A dedicated class called ``CommandTable`` exists that is the prefered way + A dedicated class called ``CommandTable`` exists that is the preferred way to create a valid command table. For more information about the ``CommandTable`` refer to the corresponding example or the documentation of that class directly. diff --git a/src/zhinst/toolkit/driver/nodes/generator.py b/src/zhinst/toolkit/driver/nodes/generator.py index 11584cd1..daea3b8f 100644 --- a/src/zhinst/toolkit/driver/nodes/generator.py +++ b/src/zhinst/toolkit/driver/nodes/generator.py @@ -28,7 +28,7 @@ class Generator(Node): tree: Tree (node path as tuple) of the current node daq_server: Instance of the ziDAQServer serial: Serial of the device. - index: Index of the coresponding awg channel + index: Index of the corresponding awg channel max_qubits_per_channel: Max qubits per channel """ @@ -159,7 +159,7 @@ def read_from_waveform_memory(self, slots: t.List[int] = None) -> Waveforms: specified all assigned waveforms will be downloaded. Returns: - Mutuable mapping of the downloaded waveforms. + Mutable mapping of the downloaded waveforms. """ nodes = [] if slots is not None: diff --git a/src/zhinst/toolkit/driver/nodes/readout.py b/src/zhinst/toolkit/driver/nodes/readout.py index dde8503d..00dc0d97 100644 --- a/src/zhinst/toolkit/driver/nodes/readout.py +++ b/src/zhinst/toolkit/driver/nodes/readout.py @@ -24,7 +24,7 @@ class Readout(Node): tree: Tree (node path as tuple) of the current node daq_server: Instance of the ziDAQServer serial: Serial of the device. - index: Index of the coresponding awg channel + index: Index of the corresponding awg channel max_qubits_per_channel: Max qubits per channel """ @@ -188,11 +188,11 @@ def read_integration_weights(self, slots: t.List[int] = None) -> Waveforms: """Read integration weights from the waveform memory. Args: - slots: List of weight slots to read from the device. If not specfied + slots: List of weight slots to read from the device. If not specified all available weights will be downloaded. Returns: - Mutuable mapping of the downloaded weights. + Mutable mapping of the downloaded weights. """ nodes = [] if slots is not None: diff --git a/src/zhinst/toolkit/driver/nodes/spectroscopy.py b/src/zhinst/toolkit/driver/nodes/spectroscopy.py index f31f90d0..c2ba29f1 100644 --- a/src/zhinst/toolkit/driver/nodes/spectroscopy.py +++ b/src/zhinst/toolkit/driver/nodes/spectroscopy.py @@ -22,7 +22,7 @@ class Spectroscopy(Node): tree: Tree (node path as tuple) of the current node daq_server: Instance of the ziDAQServer serial: Serial of the device. - index: Index of the coresponding awg channel + index: Index of the corresponding awg channel """ def __init__( diff --git a/src/zhinst/toolkit/nodetree/__init__.py b/src/zhinst/toolkit/nodetree/__init__.py index 91d35f35..82ae6985 100644 --- a/src/zhinst/toolkit/nodetree/__init__.py +++ b/src/zhinst/toolkit/nodetree/__init__.py @@ -1,7 +1,7 @@ """High-level generic lazy node tree for the ziPython package. All interactions with an Zurich Instruments device or a LabOne -module happends through manipulating nodes. The +module happens through manipulating nodes. The :class:`zhinst.toolkit.nodetree.nodetree.NodeTree` provides a pythonic way for that. diff --git a/src/zhinst/toolkit/nodetree/connection_dict.py b/src/zhinst/toolkit/nodetree/connection_dict.py index c46f3025..bb23fdbe 100644 --- a/src/zhinst/toolkit/nodetree/connection_dict.py +++ b/src/zhinst/toolkit/nodetree/connection_dict.py @@ -40,7 +40,7 @@ def listNodesJSON(self, path: str, *args, **kwargs) -> str: return json.dumps(json_info) def get(self, path: str, *args, **kwargs) -> t.Any: - """mirrors the behaviour of ziPython get command.""" + """mirrors the behavior of ziPython get command.""" nodes_raw = fnmatch.filter(self._values.keys(), path) return_value = OrderedDict() for node in nodes_raw: @@ -48,7 +48,7 @@ def get(self, path: str, *args, **kwargs) -> t.Any: return return_value def getInt(self, path: str) -> int: - """mirrors the behaviour of ziPython getInt command.""" + """mirrors the behavior of ziPython getInt command.""" try: return int(self._values[path]) except TypeError: @@ -57,11 +57,11 @@ def getInt(self, path: str) -> int: raise def getDouble(self, path: str) -> float: - """mirrors the behaviour of ziPython getDouble command.""" + """mirrors the behavior of ziPython getDouble command.""" return float(self._values[path]) def getString(self, path: str) -> str: - """mirrors the behaviour of ziPython getDouble command.""" + """mirrors the behavior of ziPython getDouble command.""" return str(self._values[path]) def _parse_input_value(self, path: str, value: str): @@ -79,7 +79,7 @@ def set( value: t.Any = None, **kwargs, ) -> None: - """mirrors the behaviour of ziPython set command.""" + """mirrors the behavior of ziPython set command.""" if isinstance(path, str): self._values[path] = self._parse_input_value(path, value) else: @@ -87,13 +87,13 @@ def set( self._values[node] = self._parse_input_value(node, node_value) def setVector(self, path: str, value: t.Any = None) -> None: - """mirrors the behaviour of ziPython setVector command.""" + """mirrors the behavior of ziPython setVector command.""" self.set(path, value) def subscribe(self, path: str) -> None: - """mirrors the behaviour of ziPython subscribe command.""" + """mirrors the behavior of ziPython subscribe command.""" raise RuntimeError("Can not subscribe within the SHFQA_Sweeper") def unsubscribe(self, path: str) -> None: - """mirrors the behaviour of ziPython unsubscribe command.""" + """mirrors the behavior of ziPython unsubscribe command.""" raise RuntimeError("Can not subscribe within the SHFQA_Sweeper") diff --git a/src/zhinst/toolkit/nodetree/helper.py b/src/zhinst/toolkit/nodetree/helper.py index ab08c697..96b17d09 100644 --- a/src/zhinst/toolkit/nodetree/helper.py +++ b/src/zhinst/toolkit/nodetree/helper.py @@ -17,7 +17,7 @@ def lazy_property(property_function: t.Callable[..., T]) -> T: property_function (Callable): property function Returns - Any: Retun value of the property function + Return value of the property function """ return property(lru_cache()(property_function)) @@ -36,7 +36,7 @@ def create_or_append_set_transaction(nodetree) -> None: before this function finishes. Warning: - The set is always perfromed as deep set if called on device nodes. + The set is always performed as deep set if called on device nodes. Examples: >>> with nodetree.set_transaction(): diff --git a/src/zhinst/toolkit/nodetree/node.py b/src/zhinst/toolkit/nodetree/node.py index d9e40605..cb6e9067 100644 --- a/src/zhinst/toolkit/nodetree/node.py +++ b/src/zhinst/toolkit/nodetree/node.py @@ -23,7 +23,7 @@ class NodeInfo: """Class that holds the additional information for a single node. - LabOne provides for each leaf node a dictionary of so called node infos + LabOne provides for each leaf node a dictionary of so called node info (In addition toolkit or the user may also add some information for selected nodes). This class wraps around these information and exposes them to a user in a friendly way. @@ -162,7 +162,7 @@ def readable(self) -> t.Optional[bool]: @property def writable(self) -> t.Optional[bool]: - """Flag if the node is writeable. + """Flag if the node is writable. Returns None if the node does not provide the information (e.g. wildcard or partial nodes.) @@ -281,7 +281,7 @@ class Node: Flag if the set operation should be blocking until the data has arrived at the device, respectively if the get operation should return the value from the device or the cached value on the data - server (if there is any). If this flag is set the opperation can + server (if there is any). If this flag is set the operation can take significantly longer. (default = False) For a deep get operation the timestamp from the device is returned @@ -471,7 +471,7 @@ def _get( Args: deep: Flag if the get operation should return the cached value - from the dataserver or get the value from the device, which is + from the Data Server or get the value from the device, which is significantly slower. enum: Flag if enumerated values should return the enum value as string or return the raw number. @@ -556,7 +556,7 @@ def _get_wildcard( Args: deep: Flag if the get operation should return the cached value - from the dataserver or get the value from the device, which is + from the Data Server or get the value from the device, which is significantly slower. The wildcard get is always performed as deep get but the timestamp is only returned if the ``deep``` flag is set. @@ -930,8 +930,8 @@ def child_nodes( within the nodetree. Enabling additional flags how ever require that each node that - matches the wildcard needs to be checked in a seperate request by - the dataserver which can cause a severe latency. Therfore one + matches the wildcard needs to be checked in a separate request by + the Data Server which can cause a severe latency. Therefore one needs to enable the `full_wildcard` flag in order to support the manual generation of the matching child nodes. @@ -1043,11 +1043,11 @@ def root(self) -> "NodeTree": class NodeList(Sequence, Node): """List of nodelike objects - List of preinitialized classes that intherit from the Node class would not + List of preinitialized classes that inherit from the ``Node`` class would not support wildcards since they would be of type list. This class holds the preinitialized objects. But if a the passed item is not - an interger it returns a Node instead. + an integer it returns a Node instead. Warning: Since in case of a passed wildcard symbol the return value is a node, diff --git a/src/zhinst/toolkit/nodetree/nodetree.py b/src/zhinst/toolkit/nodetree/nodetree.py index 598e3e79..7e750ec2 100644 --- a/src/zhinst/toolkit/nodetree/nodetree.py +++ b/src/zhinst/toolkit/nodetree/nodetree.py @@ -29,25 +29,25 @@ def listNodesJSON(self, path: str, *args, **kwargs) -> str: """Returns a list of nodes with description found at the specified path.""" def get(self, path: str, *args, **kwargs) -> object: - """Mirrors the behaviour of ziPython ``get`` command.""" + """Mirrors the behavior of ziPython ``get`` command.""" def getInt(self, path: str) -> int: - """Mirrors the behaviour of ziPython ``getInt`` command.""" + """Mirrors the behavior of ziPython ``getInt`` command.""" def getDouble(self, path: str) -> float: - """Mirrors the behaviour of ziPython ``getDouble`` command.""" + """Mirrors the behavior of ziPython ``getDouble`` command.""" def getString(self, path: str) -> str: - """Mirrors the behaviour of ziPython ``getDouble`` command.""" + """Mirrors the behavior of ziPython ``getDouble`` command.""" def set(self, path: str, value: object, **kwargs) -> None: - """Mirrors the behaviour of ziPython ``set`` command.""" + """Mirrors the behavior of ziPython ``set`` command.""" def subscribe(self, path: str) -> None: - """Mirrors the behaviour of ziPython ``subscribe`` command.""" + """Mirrors the behavior of ziPython ``subscribe`` command.""" def unsubscribe(self, path: str) -> None: - """Mirrors the behaviour of ziPython ``unsubscribe`` command.""" + """Mirrors the behavior of ziPython ``unsubscribe`` command.""" class Transaction: @@ -125,7 +125,7 @@ class NodeTree: >>> nodetree.example.nodes[8].test /example/nodes/8/test - To speed up the initialisation time the node tree is initialised lazy. + To speed up the initialization time the node tree is initialized lazy. Meaning the dictionary is kept as a flat dictionary and is not converted into a nested one. In addition the nested node objects returned by the ``NodeTree`` also are just simple placeholders. Only when performing @@ -174,7 +174,7 @@ def __init__( self._flat_dict = {**self._flat_dict, **json.loads(nodes_json)} self._flat_dict = {key.lower(): value for key, value in self._flat_dict.items()} self._transaction = Transaction(self) - # First Layer must be generate during initialisation to calculate the + # First Layer must be generate during initialization to calculate the # prefixes to keep self._first_layer = [] self._prefixes_keep = [] @@ -241,9 +241,9 @@ def get_node_info(self, node: t.Union[Node, str]) -> t.Dict[Node, t.Dict]: Node(s) information. Raises: - KeyErrror if the node does not match an existing node. + KeyError if the node does not match an existing node. ValueError: If the node is passed as a string in form of a relative - path and no perfix can be added. + path and no prefix can be added. """ key = self.to_raw_path(node) # resolve potential wildcards @@ -421,7 +421,7 @@ def string_to_raw_path(self, node: str) -> str: Raw node path that can be used a key in the internal dictionary. Raises: - ValueError: If the node is a relative path and no perfix can be + ValueError: If the node is a relative path and no prefix can be added. """ if not node.startswith("/"): @@ -443,7 +443,7 @@ def set_transaction(self) -> t.Generator[None, None, None]: and often increases the speed. Within the with block all set commands to a node will be buffered - and bundeld into a single command at the end of the context + and grouped into a single command at the end of the context automatically. (All other operations, e.g. getting the value of a node, will not be affected) diff --git a/src/zhinst/toolkit/waveform.py b/src/zhinst/toolkit/waveform.py index fe1b8fbb..c5f61120 100644 --- a/src/zhinst/toolkit/waveform.py +++ b/src/zhinst/toolkit/waveform.py @@ -38,7 +38,7 @@ class Waveforms(MutableMapping): >>> waveforms[6] = (wave, -wave, markers) >>> waveforms[7] = (wave, None, markers) - The arrays can be provided as arrays of interger, float. The first wave also + The arrays can be provided as arrays of integer, float. The first wave also can be of type complex. In that case the second waveform must be `None`. Depending on the target format the function `get_raw_vector` converts the diff --git a/tests/test_nodetree.py b/tests/test_nodetree.py index 023b9b14..d7aa8d66 100644 --- a/tests/test_nodetree.py +++ b/tests/test_nodetree.py @@ -301,7 +301,7 @@ def test_get_deep(connection): with pytest.raises(TypeError) as e_info: tree.demods[0].rate(deep=True, test=True) - # overwrite internaly used kwarg + # overwrite internally used kwarg with pytest.raises(TypeError) as e_info: tree.demods[0].rate(deep=True, settingsonly=True)