Skip to content

Commit

Permalink
ENH: move the recursive collect_asset_docs up to Device
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed Jun 27, 2022
1 parent 384d1a9 commit e7a25aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion docs/source/reference/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Changes
within ophyd methods.
* Deprecate ``DetectorBase.dispatch`` in favor of newly added
``DetectorBase.generate_datum``

* ``obj.collect_asset_docs`` will now recurse to children by default at the
Device level


1.6.4 (2022-04-08)
Expand Down
6 changes: 0 additions & 6 deletions ophyd/areadetector/detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ def make_data_key(self):
return dict(shape=shape, source=source, dtype='array',
external='FILESTORE:')

def collect_asset_docs(self):
file_plugins = [s for s in self._signals.values() if
hasattr(s, 'collect_asset_docs')]
for p in file_plugins:
yield from p.collect_asset_docs()


class AreaDetector(DetectorBase):
cam = C(cam.AreaDetectorCam, 'cam1:')
Expand Down
5 changes: 5 additions & 0 deletions ophyd/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,11 @@ def read(self):
res.update(component.read())
return res

def collect_asset_docs(self):
for _, component in self._get_components_of_kind(Kind.normal):
if hasattr(component, 'collect_asset_docs'):
yield from component.collect_asset_docs()

def read_configuration(self) -> OrderedDictType[str, Dict[str, Any]]:
"""Dictionary mapping names to value dicts with keys: value, timestamp
Expand Down

0 comments on commit e7a25aa

Please sign in to comment.