Skip to content

BUG: 3D functions return non-public members #9961

Closed

Description

@larsoner

@GuillaumeFavelier we need a public equivalent to mayavi.core.api.Scene for whatever we currently return for create_3d_figure that users can pass around to 3D functions as fig=fig etc. Can you work on this separately? Then we can git grep "PyVista renderer" and know all the places we need to put in a reference that links properly.

adapted from #9945 (comment)

Activity

  1. added this to the 1.0 milestone on Nov 4, 2021
  2. larsoner commented on Feb 11, 2022

    @larsoner
    MemberAuthor

    @GuillaumeFavelier this is marked for 1.0, can you take a look?

  3. GuillaumeFavelier commented on Feb 11, 2022

    @GuillaumeFavelier
    Contributor

    I'll work on it next week 👍

  4. GuillaumeFavelier commented on Feb 14, 2022

    @GuillaumeFavelier
    Contributor

    I think the best candidate is the private _Figure:

    https://github.com/mne-tools/mne-python/blob/main/mne/viz/backends/_pyvista.py#L46

    I want to open a small PR to refactor _PyVistaRenderer first (mainly moving atrributes into _Figure).

    Then we can think about the contract that this fig should fulfill. I believe it works as intended already ('saved figure' passed between the 3d functions) but it could be the time to make things right before making it public.

  5. larsoner commented on Feb 14, 2022

    @larsoner
    MemberAuthor

    Then we can think about the contract that this fig should fulfill.

    I think the smallest API as possible is best. So maybe just that:

    1. It can be passed as a fig to MNE-Python functions, and probably also that
    2. The .plotter attribute is accessible, and is a PyVista plotter instance

    WDYT?

  6. GuillaumeFavelier commented on Feb 15, 2022

    @GuillaumeFavelier
    Contributor

    WDYT?

    Perfect, that's exactly the purpose of _Figure.

  7. larsoner commented on Feb 15, 2022

    @larsoner
    MemberAuthor

    Perfect, that's exactly the purpose of _Figure.

    Okay cool, I can make a PR to make this public unless you're working on it @GuillaumeFavelier

  8. GuillaumeFavelier commented on Feb 15, 2022

    @GuillaumeFavelier
    Contributor

    You can go for it @larsoner, it's always possible to refactor things around later on

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions