From 124c179009be5f768a109eff9f707929fb06bc6b Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Sat, 24 Aug 2024 16:26:10 -0500 Subject: [PATCH] MNT #984 switch bases and plugins to kwargs --- apstools/devices/area_detector_factory.py | 4 +++- apstools/devices/tests/test_issue984_ad_factory.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apstools/devices/area_detector_factory.py b/apstools/devices/area_detector_factory.py index 4d3fdd19..e669b618 100644 --- a/apstools/devices/area_detector_factory.py +++ b/apstools/devices/area_detector_factory.py @@ -159,7 +159,7 @@ """Default plugin configuration dictionary.""" -def ad_class_factory(name, bases, plugins, plugin_defaults=None): +def ad_class_factory(name, bases=None, plugins=None, plugin_defaults=None): """ Build an Area Detector class with specified plugins. @@ -175,12 +175,14 @@ def ad_class_factory(name, bases, plugins, plugin_defaults=None): plugins *list* : Description of the plugins used. + (default: ``["cam"]`` -- Just the camera plugin.) plugin_defaults *object*: Plugin configuration dictionary. (default: ``None``, PLUGIN_DEFAULTS will be used.) """ bases = bases or (SingleTrigger_V34, DetectorBase) + plugins = plugins or ["cam"] plugin_defaults = plugin_defaults or PLUGIN_DEFAULTS attributes = {} diff --git a/apstools/devices/tests/test_issue984_ad_factory.py b/apstools/devices/tests/test_issue984_ad_factory.py index 85d7db9e..64ff0548 100644 --- a/apstools/devices/tests/test_issue984_ad_factory.py +++ b/apstools/devices/tests/test_issue984_ad_factory.py @@ -9,7 +9,7 @@ def test_my_fake_area_detector(): - ad_class = ad_class_factory("FakeAD", None, ["cam"]) + ad_class = ad_class_factory("FakeAD") fake_ad = make_fake(ad_class, prefix="Fake:AD", name="fake_ad") assert "cam.acquire_time" not in fake_ad.stage_sigs