Repository navigation
Initial ophyd-async support - #1188
Conversation
|
Py 3.10 is close to end of support. It's safe for you to drop it from the test matrix here. |
|
Can you push an empty commit to the branch to run the CI again? Previous failed due to EPICS connections with a motor (not part of your branch). I'm suspecting this might match a problem I encountered when a conflicting |
c562308 to
81c3a5a
Compare
Async support is an optional dependency to not break backwards compatability. Ophyd-async requies python>=3.11 but apstools can make do with python>=3.10.
We might want change this without notice ophyd-async devices without notice, so renaming the package makes it clear that this is not meant to be stable.
|
Investigation of the reproducible CI failure: The failure is caused by the PR's new Evidence:
The likely mechanism is an EPICS Channel Access client-library collision. Recommended CI fix:
The smallest immediate fix is to change the existing matrix installation back to: pip install -e .[dev]That should restore the existing classic test environment; a separate async CI job is still needed to exercise the new tests. Contributed by OpenCode(argo/gpt56luna) |
|
Running the tests locally in a conda env with these versions: (test) jemian@otz .../sandbox/apstools $ conda list epics
# packages in environment at /home/beams/JEMIAN/.conda/envs/test:
#
# Name Version Build Channel
epicscorelibs 7.0.10.99.0.2 pypi_0 pypi
pyepics 3.5.10 pypi_0 pypi
(test) jemian@otz .../sandbox/apstools $ conda list ophyd
# packages in environment at /home/beams/JEMIAN/.conda/envs/test:
#
# Name Version Build Channel
ophyd 1.11.2 pypi_0 pypi
ophyd-async 0.21.3 pypi_0 pypi
ophyd-registry 2.0.0 pypi_0 pypiTest for the failureHere's a test for the code that fails in the CI workflow: (test) jemian@otz .../sandbox/apstools $ pytest ./apstools/ -k test_dict_device
============================================== test session starts ===============================================
platform linux -- Python 3.14.8, pytest-9.1.1, pluggy-1.7.0
rootdir: /tmp/sandbox/apstools
configfile: pytest.ini (WARNING: ignoring pytest config in pyproject.toml!)
plugins: platformdirs-4.13.5, typeguard-4.6.0, anyio-4.15.1, zarr-3.4.1
collected 1230 items / 1222 deselected / 8 selected
apstools/devices/tests/test_dict_device.py ........ [100%]
================================================ warnings summary ================================================
apstools/_devices_async/tests/test_aps_machine.py:6
/tmp/sandbox/apstools/apstools/_devices_async/tests/test_aps_machine.py:6: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
@pytest.mark.asyncio
../../../home/beams/JEMIAN/.conda/envs/test/lib/python3.14/site-packages/_pytest/python.py:124
/home/beams/JEMIAN/.conda/envs/test/lib/python3.14/site-packages/_pytest/python.py:124: PytestRemovedIn10Warning: Passing a non-Collection iterable to parametrize is deprecated.
Test: apstools/callbacks/tests/test_specwriter.py::test_issue_1084_from_catalog, argvalues type: generator
Please convert to a list or tuple.
See https://docs.pytest.org/en/stable/deprecations.html#parametrize-iterators
metafunc.parametrize(*marker.args, **marker.kwargs, _param_mark=marker)
../../../home/beams/JEMIAN/.conda/envs/test/lib/python3.14/site-packages/_pytest/python.py:124
/home/beams/JEMIAN/.conda/envs/test/lib/python3.14/site-packages/_pytest/python.py:124: PytestRemovedIn10Warning: Passing a non-Collection iterable to parametrize is deprecated.
Test: apstools/utils/tests/test_statistics.py::test_xy_statistics, argvalues type: generator
Please convert to a list or tuple.
See https://docs.pytest.org/en/stable/deprecations.html#parametrize-iterators
metafunc.parametrize(*marker.args, **marker.kwargs, _param_mark=marker)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================= 8 passed, 1222 deselected, 3 warnings in 9.55s ================================= |
|
Follow-up/correction to my previous analysis: The package-conflict explanation is plausible but not proven as the direct root cause. The local test reported above passes The confirmed CI facts are:
The next diagnostic should therefore be an explicit motor readiness check immediately before pytest, for example: caget gp:m1.RBV gp:m1.VAL gp:m1.DMOV
python -c "import ophyd; m = ophyd.EpicsMotor('gp:m1', name='m'); m.wait_for_connection(); print(m.read())"If that check fails, the problem is IOC/PV availability or Channel Access setup, independent of pytest. If it passes but pytest fails only with For now, I would describe the package interaction as a leading hypothesis rather than a confirmed root cause. Separating the async tests into their own environment remains a reasonable CI design, but adding a Contributed by OpenCode(argo/gpt56luna) |
|
If |
|
Agreed. My previous follow-up gave the missing-PV/readiness possibility too much weight. Given that The useful distinction is instead:
A better next experiment is to compare the process state with and without the async stack in the same CI environment. In particular, run the unchanged motor test after importing the new async module/package and then without that import, while recording the loaded EPICS CA library paths. That should distinguish an I retract the missing-PV/readiness conjecture as a proposed cause. Contributed by OpenCode(argo/gpt56luna) |
|
Some tests to reproduce this locally. Unfortunately, the tests always passed, so we failed to fail successfully. With Pixi (no conda-forge packages)✓ Passes With Pixi (including conda-forge packages)✓ Passes With mamba$ mamba config list --sources
channels:
- conda-forge # '~/.condarc'
- apsu # '~/.condarc'
changeps1: false # '~/.condarc'
$ mamba env create -n apstools-async python=3.13 pyepics aps-dm-api
$ pip install -e ".[all]"
$ pytest ✓ Passes |
Haven contains a number of ophyd-async devices that could be useful for other beamlines. I am hoping to start moving some of these into apstools since ophyd-async is getting close to its first stable release. Ophyd-async is especially good for fly-scanning detectors, which seems useful to others.
This PR:
I put the ophyd-async devices in a new
_devices_asyncpackage so existing deployments shouldn't be affected. I also addedophyd-asyncas an optional dependency (pip install apstools[async]). My thought was that once ophyd-async is stable, we can rename this package todevices_asyncand make ophyd-async a default dependency to indicate that this support is ready for general use.The current release of ophyd-async depends on python >= 3.11. How important is maintaining python 3.10 support? It is schedule to go end-of-life in October.