Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor built-in plans to use contingency_wrapper #1288

Closed
danielballan opened this issue Feb 4, 2020 · 10 comments · Fixed by #1729
Closed

Refactor built-in plans to use contingency_wrapper #1288

danielballan opened this issue Feb 4, 2020 · 10 comments · Fixed by #1729
Assignees
Labels
good first issue hackathon Good issues for the upcoming bluesky hackathon

Comments

@danielballan
Copy link
Member

danielballan commented Feb 4, 2020

The contingency_wrapper is better than the finalize_wrapper because the "final plan" takes in the exception that was raised as the argument, which allows the clean up to target specific failure modes if desired.

Even where that capability isn't used, it would be an improvement I think to model using contingency_wrapper in our code so that users can easily discover it and find examples of its use.

@callumforrester
Copy link
Contributor

Reviewers: @danielballan @tacaswell

@stan-dot
Copy link
Contributor

should mark finalize_plan as deprecated?

docs/tutorial.rst tells the user to use finalize_wrapper, should that be changed?

@danielballan

@stan-dot
Copy link
Contributor

files that mention finalize_wrapper

  • preprocessors.py
  • /tests/test_generators.py - testing specifically the function itself
  • /tests/test_new_examples.py - also in test_finalize
  • /tests/test_run_engine.py - the most clear location where it might be replaced

When I'm looking atthe plan_patterns.py I do not see any wrappers.
OTOH, plan_stubs.py contains references to wrappers, and those used there are: rewindable, contingency and relative_set.

I am not sure where the change is to be made.

@tacaswell
Copy link
Contributor

I'm weakly against deprecating it. In cases where you only want to do cleanup the simpler signature is nice.

I'm also sure we have some usage on the floor at facilities who have already deployed bluesky and the disruption of deprecating this does not seem worth the marginal gain of getting rid of name in the namespace.

On the other hand "pause for debug" was a bad idea (I think I wrote it).

Maybe we should only purge it from the narrative docs?

@prjemian
Copy link
Contributor

Not seeing any current use of finalize_wrapper, finalize_plan, or contingency_wrapper in our standard kit. An APS beam line might be using any of these, but not likely.

@stan-dot
Copy link
Contributor

should the issue be closed as not needed then?
@danielballan @prjemian

@prjemian
Copy link
Contributor

The action for this issue might be to ensure the documentation for the various affected code contains the recommendation in the initial statement here:

The contingency_wrapper is better than the finalize_wrapper ...

@prjemian
Copy link
Contributor

@stan-dot -- Thanks for picking this one up!

@stan-dot
Copy link
Contributor

stan-dot commented Apr 18, 2024

no worries! doing a PR for the recommedation for the edit now

@stan-dot
Copy link
Contributor

image
so far only the tutorial.rst got modified with the menion, I'm happy to merge as is unless more places need the change

@stan-dot stan-dot linked a pull request Apr 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue hackathon Good issues for the upcoming bluesky hackathon
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants