Giter Club home page Giter Club logo

Comments (2)

stuwilkins avatar stuwilkins commented on June 15, 2024

Hi Garth,

I agree that the user_detectors, default_detectors is very counterintuative. I am struggling for a good way to configure this? Any thoughts on what we can do to clean this all up?

Best wishes,
Stuart

From: gjwillms <[email protected]mailto:[email protected]>
Reply-To: NSLS-II/ophyd <[email protected]mailto:[email protected]>
Date: Tuesday, March 17, 2015 at 6:29 AM
To: NSLS-II/ophyd <[email protected]mailto:[email protected]>
Subject: [ophyd] Scan.detectors is not what a naive user thinks it is (#83)

I think that there's a semantic problem with the detectors property in that it is intrinsically read-only. A user will be likely to attempt to add a new detector with, e.g., Count.detectors.append([my_detector)], rather than adding it to the user_detectors list. I offer up a few possible changes (in order of reversed personal preference):

  1. move this property name to _detectors so that a user has some warning that you don't intend to have this changed outside of the class methods,
  2. provide a setter that raises "AttributeError", indicating that appending to this list is not supported, or
  3. provide a setter that transparently adds the provided detector list to the user_detectors list.


Reply to this email directly or view it on GitHubhttps://github.com//issues/83.

from ophyd.

gjwillms avatar gjwillms commented on June 15, 2024

It's probably not helpful, but I'm actually glad to hear this. I'm thinking about the issue. If I'm honest, I'm tempted to say that we should eliminate the pair and return to just having a detector list. I'm not sure that I have a detector that is so useful that I expect to find it in every scan I perform, so default_detectors is a little strange to me. One of the things I may try tomorrow is creating a dict in the start-up files that represents a standard set of detectors for scans in each hutch and standard experiment configuration. That, in conjunction with a helper function to set/unset detectors and summarize known configurations, might work.

from ophyd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.