Skip to content

Commit 2931d92

Browse files
committed
Update more outdated docs
1 parent bb268ad commit 2931d92

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

docs/index.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ flexibility to perform complex tasks with relative ease. It also makes it easy t
1313
instruments in the shell. For example, to list the available instruments and open one of them::
1414

1515
>>> from instrumental import instrument, list_instruments
16-
>>> insts = list_instruments()
17-
>>> insts
18-
[<TEKTRONIX 'DPO4034'>, <TEKTRONIX 'MSO4034'>, <NIDAQ 'Dev1'>]
19-
>>> daq = instrument(insts[2])
16+
>>> paramsets = list_instruments()
17+
>>> paramsets
18+
[<ParamSet[TSI_Camera] serial='05478' number=0>,
19+
<ParamSet[K10CR1] serial='55000247'>
20+
<ParamSet[NIDAQ] model='USB-6221 (BNC)' name='Dev1'>]
21+
>>> daq = instrument(paramsets[2])
2022
>>> daq
2123
<instrumental.drivers.daq.ni.NIDAQ at 0xb61...>
2224

docs/instruments.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,32 @@ Then you can simply open it by name::
3434
An Even Quicker Way
3535
~~~~~~~~~~~~~~~~~~~
3636

37-
Here's a shortcut for opening an instrument that means you don't have to assign the instrument list
38-
to a variable, or even know how to count--just use part of the instrument's string::
37+
Here's a shortcut for opening an instrument that means you don't have to assign the instrument list to a variable, or even know how to count---just use part of the instrument's string::
3938

4039
>>> list_instruments()
41-
[<TEKTRONIX 'DPO4034'>, <TEKTRONIX 'MSO4034'>, <NIDAQ 'Dev1'>]
42-
>>> instrument('DPO') # Opens the <TEKTRONIX 'DPO4034'>
43-
>>> instrument('NIDAQ') # Opens the <NIDAQ 'Dev1'>
40+
[<ParamSet[TSI_Camera] serial='05478' number=0>,
41+
<ParamSet[K10CR1] serial='55000247'>
42+
<ParamSet[NIDAQ] model='USB-6221 (BNC)' name='Dev1'>]
43+
>>> instrument('TSI') # Opens the TSI_Camera
44+
>>> instrument('NIDAQ') # Opens the NIDAQ
4445

4546
This will work as long as the string you use isn't saved as an instrument alias. If you use a
4647
string that matches multiple instruments, it just picks the first in the list.
4748

4849

50+
Filtering Results
51+
~~~~~~~~~~~~~~~~~
52+
53+
If you're only interested in a specific driver or category of instrument, you can use the `module` argument to filter your results. This will also speed up the search for the instruments::
54+
55+
>>> list_instruments(module='cameras')
56+
[<ParamSet[TSI_Camera] serial='05478' number=0>]
57+
>>> list_instruments(module='cameras.tsi')
58+
[<ParamSet[TSI_Camera] serial='05478' number=0>]
59+
60+
`list_instruments()` checks if ``module`` is a substring of each driver module's name. Only modules whose names match are queried for available instruments.
61+
62+
4963
Remote Instruments
5064
~~~~~~~~~~~~~~~~~~
5165

0 commit comments

Comments
 (0)