{"action":"created","issue":{"url":"https://api.github.com/repos/NSLS-II/bluesky/issues/677","repository_url":"https://api.github.com/repos/NSLS-II/bluesky","labels_url":"https://api.github.com/repos/NSLS-II/bluesky/issues/677/labels{/name}","comments_url":"https://api.github.com/repos/NSLS-II/bluesky/issues/677/comments","events_url":"https://api.github.com/repos/NSLS-II/bluesky/issues/677/events","html_url":"https://github.com/NSLS-II/bluesky/issues/677","id":218616243,"number":677,"title":"Plans for future of \"spec-like\" API","user":{"login":"danielballan","id":2279598,"avatar_url":"https://avatars3.githubusercontent.com/u/2279598?v=4","gravatar_id":"","url":"https://api.github.com/users/danielballan","html_url":"https://github.com/danielballan","followers_url":"https://api.github.com/users/danielballan/followers","following_url":"https://api.github.com/users/danielballan/following{/other_user}","gists_url":"https://api.github.com/users/danielballan/gists{/gist_id}","starred_url":"https://api.github.com/users/danielballan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielballan/subscriptions","organizations_url":"https://api.github.com/users/danielballan/orgs","repos_url":"https://api.github.com/users/danielballan/repos","events_url":"https://api.github.com/users/danielballan/events{/privacy}","received_events_url":"https://api.github.com/users/danielballan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"danielballan","id":2279598,"avatar_url":"https://avatars3.githubusercontent.com/u/2279598?v=4","gravatar_id":"","url":"https://api.github.com/users/danielballan","html_url":"https://github.com/danielballan","followers_url":"https://api.github.com/users/danielballan/followers","following_url":"https://api.github.com/users/danielballan/following{/other_user}","gists_url":"https://api.github.com/users/danielballan/gists{/gist_id}","starred_url":"https://api.github.com/users/danielballan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielballan/subscriptions","organizations_url":"https://api.github.com/users/danielballan/orgs","repos_url":"https://api.github.com/users/danielballan/repos","events_url":"https://api.github.com/users/danielballan/events{/privacy}","received_events_url":"https://api.github.com/users/danielballan/received_events","type":"User","site_admin":false},"assignees":[{"login":"danielballan","id":2279598,"avatar_url":"https://avatars3.githubusercontent.com/u/2279598?v=4","gravatar_id":"","url":"https://api.github.com/users/danielballan","html_url":"https://github.com/danielballan","followers_url":"https://api.github.com/users/danielballan/followers","following_url":"https://api.github.com/users/danielballan/following{/other_user}","gists_url":"https://api.github.com/users/danielballan/gists{/gist_id}","starred_url":"https://api.github.com/users/danielballan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielballan/subscriptions","organizations_url":"https://api.github.com/users/danielballan/orgs","repos_url":"https://api.github.com/users/danielballan/repos","events_url":"https://api.github.com/users/danielballan/events{/privacy}","received_events_url":"https://api.github.com/users/danielballan/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/NSLS-II/bluesky/milestones/9","html_url":"https://github.com/NSLS-II/bluesky/milestone/9","labels_url":"https://api.github.com/repos/NSLS-II/bluesky/milestones/9/labels","id":2480441,"number":9,"title":"0.10","description":"","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars3.githubusercontent.com/u/199813?v=4","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":8,"state":"open","created_at":"2017-04-25T14:37:59Z","updated_at":"2017-07-23T20:55:39Z","due_on":null,"closed_at":null},"comments":14,"created_at":"2017-03-31T21:01:48Z","updated_at":"2017-07-23T21:39:35Z","closed_at":null,"body":"This issue documents our intentions for unifying some features of the \"spec-like\" API with the \"standard\" built-in plans and any user-defined plans. The motivation of this change is to avoid two disjoint forks of plans development.\r\n\r\nFor background, see [differences from non-spec-like plans](http://nsls-ii.github.io/bluesky/plans.html#differences-from-non-spec-like-plans).\r\n\r\n## 1. Smarter Dispatcher\r\n\r\nMotivation: Make it easier to apply nice subscriptions (e.g. plots) to all plans where they apply\r\n\r\nEnhancement: Refactor the dependency-injection scheme in `bluesky.plans.spec_api` into a  \"smart\" Dispatcher-like object that can apply to *all* plans (including built-in standard plans, user-defined plans, and spec-like plans) auto-subscribing relevant subscriptions based on the contents of the RunStart document and/or EventDescriptors.\r\n\r\nPlanned Release: v0.9.0 (next release)\r\n\r\n```python\r\n# Currrent\r\nRE(bluesky.spec_api.ct(...))  # provides table\r\nRE(bluesky.plans.count(...))  # provides nothing\r\n\r\n# Planned\r\nRE(bluesky.spec_api.ct(...))  # provides table\r\nRE(bluesky.plans.count(...))  # provides nothing\r\nD = bluesky.default_dispatcher()\r\nRE.subscribe('all', D)\r\nRE(bluesky.plans.count(...))  # now provides table\r\n```\r\n\r\n`D` will contain logic for mapping metadata to appropriate subscriptions, such as 1D plots for 1D scans and various 2D plots for various types of 2D scans. It will provide methods to configure its behavior interactively, including an 'off' switch. It will absorb many of the attributes that we currently hang off of `gs`, such as `PLOT_Y` and `TABLE_COLS` (maybe). It does _not_ include `gs.DETS`. See below for the fate of `gs.DETS`.\r\n\r\n## 2. Consistent Signature and Deprecating Global State Detectors\r\n\r\nMotivation: In an early version, we introduced the global detectors list `gs.DETS` as a way to synchronize plans and automatic subscriptions. Now that plans report richer metadata, it's not necessary, and the role of `gs.DETS` can be replaced by a normal user-defined variable. This simplifies the bluesky codebase and the usage, and it allows users to switch between multiple different lists easily.\r\n\r\nAPI break: Require the detector argument for spec-like plans.\r\n\r\nPlanned Release: v0.10.0\r\n\r\n```python\r\n# Current\r\ngs.DETS = [detector1, detector2]\r\nct()  # implicitly uses gs.DETS for detectors\r\n\r\n# Planned\r\nd = [detector1, detector2]\r\nct(d)  # where `d` is a list of detectors, akin to how some users use `gs.DETS` now\r\n# The old usage, `ct()` with no arguments, is an error!\r\n```"},"comment":{"url":"https://api.github.com/repos/NSLS-II/bluesky/issues/comments/317284092","html_url":"https://github.com/NSLS-II/bluesky/issues/677#issuecomment-317284092","issue_url":"https://api.github.com/repos/NSLS-II/bluesky/issues/677","id":317284092,"user":{"login":"danielballan","id":2279598,"avatar_url":"https://avatars3.githubusercontent.com/u/2279598?v=4","gravatar_id":"","url":"https://api.github.com/users/danielballan","html_url":"https://github.com/danielballan","followers_url":"https://api.github.com/users/danielballan/followers","following_url":"https://api.github.com/users/danielballan/following{/other_user}","gists_url":"https://api.github.com/users/danielballan/gists{/gist_id}","starred_url":"https://api.github.com/users/danielballan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielballan/subscriptions","organizations_url":"https://api.github.com/users/danielballan/orgs","repos_url":"https://api.github.com/users/danielballan/repos","events_url":"https://api.github.com/users/danielballan/events{/privacy}","received_events_url":"https://api.github.com/users/danielballan/received_events","type":"User","site_admin":false},"created_at":"2017-07-23T21:39:35Z","updated_at":"2017-07-23T21:39:35Z","body":"There a couple discussions we could spin off of this issue. Some might go more quickly in person, working with the \"small group of stakeholders\" you suggest -- and which @stuartcampbell has also raised.\r\n\r\nI propose this way forward.\r\n\r\nIn the next release:\r\n\r\n* **All plans get access to automatic plots and monitoring.** The addition of the DiagnosticPreprocessor and BestEffortCallback will make all the special aspects of `spec_api.py` plans unneeded. Users will be able to get automatic plotting, printing, monitoring, etc., for *all* plans without special-casing the SPEC-like ones.\r\n* **The SPEC-like plans are maintained for now to minimal API disruption.** The plans in `spec_api.py` will become shims that merely alias the 'standard' plans or at most rearrange parameters. Thus, `a2scan` will still work (modulo the addition of the `detectors` arg).\r\n* **Nudge users toward the standard plans.** The plans in `spec_api.py` will issue deprecation warnings, nudging users of to use the standard plans to reduce the number of names floating around.\r\n\r\nIn the next + 1 release:\r\n\r\n* A group of stakeholders will revisit the names of the 'standard' plans. I don't think any API breakage will be needed here -- we can maintain old names forever to avoid breaking user code -- but we can change our minds about what names we choose to document and teach.\r\n\r\nKeep in mind that the fundamental unit is the `Msg`, not the plan. Beamlines may want to build custom variants of things like `count` in order to cope with their specific needs. Of course, the more interoperable we can make these things, the better!"}}
{"actor":{"display_login":"danielballan"}}