Skip to content

Hard-code dtype_numpy for CMS Pilatus detectors - #35

Closed
swu4bnl with Copilot wants to merge 2 commits into
mainfrom
copilot/port-hard-code-numpy-dtype
Closed

Hard-code dtype_numpy for CMS Pilatus detectors#35
swu4bnl with Copilot wants to merge 2 commits into
mainfrom
copilot/port-hard-code-numpy-dtype

Conversation

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

This ports the Pilatus metadata workaround from the OPLS profile into cms-profile-collection. The change ensures CMS Pilatus detectors always report the expected NumPy dtype in their Bluesky data keys.

  • What changed

    • Added a shared CMSPilatusDetector base class in startup/20-area-detectors.py.
    • Overrode make_data_key() to force dtype_numpy to "<i4" for Pilatus detector documents.
  • Where it applies

    • Updated all local Pilatus detector variants to inherit from the shared base:
      • PilatusV33
      • Pilatus800V33
      • Pilatus2MV33
      • PilatusV33_h5
      • Pilatus800V33_h5
  • Why this shape

    • Keeps the workaround centralized in one place instead of duplicating the override across each detector class.
    • Covers both TIFF- and HDF5-backed Pilatus configurations used by this profile.
class CMSPilatusDetector(PilatusDetector):
    def make_data_key(self):
        ret = super().make_data_key()
        ret["dtype_numpy"] = "<i4"
        return ret

Copilot AI changed the title [WIP] Port hard-code of numpy_dtype for Pilatus detectors Hard-code dtype_numpy for CMS Pilatus detectors Jun 4, 2026
Copilot AI requested a review from swu4bnl June 4, 2026 19:43
@swu4bnl swu4bnl closed this Jun 5, 2026
@swu4bnl
swu4bnl deleted the copilot/port-hard-code-numpy-dtype branch June 22, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HACK: hard-code the numpy_dtype of Pilatus detectors (port from opls-profile-collection#24)

2 participants