Skip to content

Commit

Permalink
Merge pull request #4282 from jenshnielsen/docs/instrument_small_cleanup
Browse files Browse the repository at this point in the history
Docs Instrument small cleanup to formatting and links
  • Loading branch information
jenshnielsen authored Jun 17, 2022
2 parents 30eb591 + 9535462 commit f4450f6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
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

0 comments on commit f4450f6

Please sign in to comment.