Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

GDYendell
Copy link
Contributor

@GDYendell GDYendell commented Apr 16, 2024

Add a keyword argument title="" to LiveGrid.__init__ that allows overriding the default title generated from the scan number.

Motivation and Context

Fixes #1396

How Has This Been Tested?

from ophyd.sim import det4, motor1, motor2

from bluesky import RunEngine
from bluesky.callbacks.mpl_plotting import LiveGrid
from bluesky.plans import grid_scan

RE = RunEngine()
RE(
    grid_scan([det4], motor1, -3, 3, 6, motor2, -5, 5, 10, False),
    LiveGrid((6, 10), "det4"),
)

notitle

from ophyd.sim import det4, motor1, motor2

from bluesky import RunEngine
from bluesky.callbacks.mpl_plotting import LiveGrid
from bluesky.plans import grid_scan

RE = RunEngine()
RE(
    grid_scan([det4], motor1, -3, 3, 6, motor2, -5, 5, 10, False),
    LiveGrid((6, 10), "det4", title="MY PLOT"),
)

title

from ophyd.sim import det4, motor1, motor2

from bluesky import RunEngine
from bluesky.callbacks.mpl_plotting import LiveGrid
from bluesky.plans import grid_scan

RE = RunEngine()
RE(
    grid_scan([det4], motor1, -3, 3, 6, motor2, -5, 5, 10, False),
    LiveGrid((6, 10), "det4", title=""),
)

emptytitle

@GDYendell
Copy link
Contributor Author

GDYendell commented Apr 16, 2024

Does this need any docs to be updated? The example in callbacks.rst does not show usage of any of the kwargs, so I guess this is OK.

Would you like a test to cover the new branch? I think it doesn't reduce coverage because the if else is on one line, but it isn't actually tested.

@tacaswell
Copy link
Contributor

A test would be good.

@GDYendell GDYendell force-pushed the live-grid-title branch 2 times, most recently from 6a4fdea to 509f4b6 Compare April 17, 2024 10:22
@GDYendell
Copy link
Contributor Author

The extra commit should address the review comments and adds a test for setting the title.

I am not sure why the docs build is failing.

@tacaswell tacaswell merged commit a054fab into bluesky:main Apr 17, 2024
@GDYendell GDYendell deleted the live-grid-title branch April 17, 2024 14:45
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.

LiveGrid needs to accept a title kwarg
2 participants