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

Docs Instrument small cleanup to formatting and links #4282

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions qcodes/instrument/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(self, name: str, metadata: Optional[Mapping[Any, Any]] = None) -> N
"""
self.instrument_modules: Dict[str, "InstrumentModule"] = {}
"""
All the instrument_modules of this instrument
All the :class:`InstrumentModule` of this instrument
Usually populated via :py:meth:`add_submodule`.
"""

Expand Down Expand Up @@ -106,11 +106,11 @@ def add_parameter(

Args:
name: How the parameter will be stored within
``instrument.parameters`` and also how you address it using the
:attr:`.parameters` and also how you address it using the
shortcut methods: ``instrument.set(param_name, value)`` etc.

parameter_class: You can construct the parameter
out of any class. Default :class:`.parameter.Parameter`.
out of any class. Default :class:`.parameters.Parameter`.

**kwargs: Constructor arguments for ``parameter_class``.

Expand Down
28 changes: 14 additions & 14 deletions qcodes/instrument/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class ChannelTuple(Metadatable, Sequence[InstrumentModuleType]):
all channels, as well as addressing of individual channels.

This behaves like a python tuple i.e. it implements the
``collections.abc.Sequence`` interface.
:class:`collections.abc.Sequence` interface.

Args:
parent: The instrument to which this ChannelTuple
Expand All @@ -127,15 +127,15 @@ class ChannelTuple(Metadatable, Sequence[InstrumentModuleType]):
ways and should not be repeated in an instrument snapshot.

multichan_paramclass: The class of
the object to be returned by the ``__getattr__``
the object to be returned by the :meth:`__getattr__`
method of :class:`ChannelTuple`.
Should be a subclass of :class:`MultiChannelInstrumentParameter`.
Should be a subclass of :class:`.MultiChannelInstrumentParameter`.

Raises:
ValueError: If ``chan_type`` is not a subclass of
:class:`InstrumentChannel`
ValueError: If ``multichan_paramclass`` is not a subclass of
:class:`MultiChannelInstrumentParameter` (note that a class is a
:class:`.MultiChannelInstrumentParameter` (note that a class is a
subclass of itself).

"""
Expand Down Expand Up @@ -375,9 +375,9 @@ def __getattr__(
set all items in a channel list simultaneously. If this is the
name of a channel, return that channel.

Params:
Args:
name: The name of the parameter, function or channel that we want to
operate on.
operate on.
"""
# Check if this is a valid parameter
if len(self) > 0:
Expand Down Expand Up @@ -490,18 +490,18 @@ class ChannelList(ChannelTuple, MutableSequence[InstrumentModuleType]): # type:
all channels, as well as addressing of individual channels.

This behaves like a python list i.e. it implements the
``collections.abc.MutableSequence`` interface.
:class:`collections.abc.MutableSequence` interface.

Note it may be useful to use the mutable ChannelList while constructing it.
E.g. adding channels as they are created, but in most use cases it is recommended
to convert this to a ``ChannelTuple`` before adding it to an instrument.
This can be done using the ``to_channel_tuple`` method.
to convert this to a :class:`ChannelTuple` before adding it to an instrument.
This can be done using the :meth:`to_channel_tuple` method.

Args:
parent: The instrument to which this ChannelList
parent: The instrument to which this :class:`ChannelList`
should be attached.

name: The name of the ChannelList.
name: The name of the :class:`ChannelList`.

chan_type: The type of channel contained
within this list.
Expand All @@ -516,15 +516,15 @@ class ChannelList(ChannelTuple, MutableSequence[InstrumentModuleType]): # type:
ways and should not be repeated in an instrument snapshot.

multichan_paramclass: The class of
the object to be returned by the ``__getattr__``
the object to be returned by the :meth:`__getattr__`
method of :class:`ChannelList`.
Should be a subclass of :class:`MultiChannelInstrumentParameter`.
Should be a subclass of :class:`.MultiChannelInstrumentParameter`.

Raises:
ValueError: If ``chan_type`` is not a subclass of
:class:`InstrumentChannel`
ValueError: If ``multichan_paramclass`` is not a subclass of
:class:`MultiChannelInstrumentParameter` (note that a class is a
:class:`.MultiChannelInstrumentParameter` (note that a class is a
subclass of itself).

"""
Expand Down