Closed prjemian closed 9 months ago
Is the root cause on lines such as these? https://github.com/BCDA-APS/apstools/blob/d47c55a029d2a4e9e69db2d2034849fce083767b/apstools/devices/labjack.py#L393
where: kind=(Kind.config | Kind.normal)
note the number of occurrences:
(bluesky_2024_1) prjemian@arf:~/.../BCDA-APS/apstools$ git grep config | grep normal
apstools/devices/labjack.py: analog_outputs = DCpt(make_analog_outputs(2), kind=(Kind.config | Kind.normal))
apstools/devices/labjack.py: analog_inputs = DCpt(make_analog_inputs(12), kind=(Kind.config | Kind.normal))
apstools/devices/labjack.py: digital_ios = DCpt(make_digital_ios(16), kind=(Kind.config | Kind.normal))
apstools/devices/labjack.py: analog_inputs = DCpt(make_analog_inputs(14), kind=(Kind.config | Kind.normal))
apstools/devices/labjack.py: digital_ios = DCpt(make_digital_ios(23), kind=(Kind.config | Kind.normal))
apstools/devices/labjack.py: analog_inputs = DCpt(make_analog_inputs(14), kind=(Kind.config | Kind.normal))
apstools/devices/labjack.py: digital_ios = DCpt(make_digital_ios(23), kind=(Kind.config | Kind.normal))
apstools/devices/labjack.py: analog_inputs = DCpt(make_analog_inputs(8), kind=(Kind.config | Kind.normal))
apstools/devices/labjack.py: digital_ios = DCpt(make_digital_ios(20), kind=(Kind.config | Kind.normal))
A suggested workaround is in one of the example notebooks (docs/source/examples/de_0_adsim_hdf5_basic.ipynb
):
"**Note**: Here, we assign the `kind` attribute by number `3`, a shorthand which is interpreted by ophyd as `ophyd.Kind.config | ophyd.Kind.normal`."
"adsimdet.hdf1.kind = 3 # config | normal"
One more Sphinx problem:
/home/prjemian/Documents/projects/BCDA-APS/apstools/apstools/devices/labjack.py:docstring of apstools.devices.labjack:22: ERROR: Unknown directive type "see".
This error is odd now, given this ophyd source code usage:
ophyd/mca.py: preset_real_time = Cpt(EpicsSignal, ".PRTM", kind=Kind.config | Kind.normal)
ophyd/tests/test_kind.py: # Notice that it tacks 'config' on when you set the kind to 'normal'.
ophyd/tests/test_kind.py: assert (Kind.normal | Kind.config) == B(name="b", kind=Kind.normal).kind
ophyd/tests/test_kind.py: assert b.a_default.kind == (Kind.normal | Kind.config)
ophyd/tests/test_kind.py: # kind value with Kind.config if said vlaue includes Kind.normal.
Note, the problem now is with Sphinx:
In [1]: from ophyd import Kind
In [2]: Kind.config
Out[2]: <Kind.config: 2>
In [3]: Kind.normal
Out[3]: <Kind.normal: 1>
In [4]: Kind.config or Kind.normal
Out[4]: <Kind.config: 2>
In [5]: Kind.config + Kind.normal
Out[5]: 3
In [6]: f"{Kind.config or Kind.normal=}"
Out[6]: 'Kind.config or Kind.normal=<Kind.config: 2>'
In [7]: Kind.config | Kind.normal
Out[7]: <Kind.normal|config: 3>
This alternative form does not raise a TypeError
in Sphinx: 3
-- Make a symbol for it.
CI workflow did not fail for this Sphinx build error: