Skip to content

Allow blocking execution of plot_alignment() and stc.plot() #10221

Open

Description

@hoechenberger

The alignment and the Brain plots are both used in interactive exploration and in non-interactive scripts.

A common annoying issue that I and other users regularly run into is that we write a short script that displays the sensor alignment or a SourceEstimate, run it (e.g. via the Run button in VS Code), the window pops up – and immediately disappears. So one then needs to run the script again -- this time, with python -i or after inserting some blocking call like input().

It would be great if there was an easier way to ensure a blocking behavior.

cc @GuillaumeFavelier

Activity

  1. GuillaumeFavelier commented on Jan 19, 2022

    @GuillaumeFavelier
    Contributor

    In the coreg app, we have a standalone parameter which control that. We could add the same to Brain? But adding yet another one to plot_alignment might be too much.

  2. hoechenberger commented on Jan 19, 2022

    @hoechenberger
    MemberAuthor

    I was more thinking of something like block, which we have for our matplotlib plotting functions too

  3. GuillaumeFavelier commented on Jan 19, 2022

    @GuillaumeFavelier
    Contributor

    I do not mind changing the name if it does the same thing.

  4. hoechenberger commented on Jan 19, 2022

    @hoechenberger
    MemberAuthor

    standalone is fine for Coreg, I think. Just for the others – if we add this functionality, I think it should be block. :)

  5. GuillaumeFavelier commented on Jan 19, 2022

    @GuillaumeFavelier
    Contributor

    Why keeping coreg as the only exception?

  6. hoechenberger commented on Jan 19, 2022

    @hoechenberger
    MemberAuthor

    Why keeping coreg as the only exception?

    To avoid discussions about backward-compat ;) I don't care enough about this one to discuss 😅😅😅😅😅

  7. GuillaumeFavelier commented on Jan 19, 2022

    @GuillaumeFavelier
    Contributor

    backward-compat... Honestly, the new version of coreg has not been around for so long, I don't know if people had really the time to play around with the standalone parameter. I still think the change is worth it for consistency (just a rename in practice). But I understand your point.

  8. hoechenberger commented on Jan 19, 2022

    @hoechenberger
    MemberAuthor

    Ah ok! Thought we'd always had this param. In that case – let's block it 😁👌

  9. GuillaumeFavelier commented on Jan 20, 2022

    @GuillaumeFavelier
    Contributor

    #10222 is merged but the case of plot_alignment is still open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions