Skip to content

Allowing .X to be None #467

Closed

Description

@ivirshup

Tracking issue for allowing X to be None.

When parts get ticked off they should be marked with the PR that fixed them.

TODO:

All of these need tests, some of them may already work.


There is a bit of ordering to do here.

  • Getting the property and initializer working will be required for most everything else.
  • IO should happen before backed mode.
  • Backed mode and concatenation are pretty independent.

Activity

  1. added this to the 0.8 milestone on Nov 27, 2020
  2. flying-sheep commented on Dec 1, 2020

    @flying-sheep
    Member

    @rcannood which of the above points have been adressed by your PR?

  3. rcannood commented on Dec 1, 2020

    @rcannood
    Member

    To begin:

    • Getter, setter, deleter
    • Initializer
    • Transpose

    There are also some basic checks for 'Views', but not everything mentioned above has been taken care of so it's still WIP.

  4. ivirshup commented on Jan 11, 2022

    @ivirshup
    MemberAuthor

    I've fixed up many of these cases in #677.

    I think .X is None is now in a fairly useable state, and think we're in an alright place to push the rest to the next release.

  5. modified the milestones: 0.8, 0.9 on Jan 11, 2022
  6. ivirshup commented on Jan 24, 2022

    @ivirshup
    MemberAuthor

    Adding a point to the checklist:

    Gotta figure out what the shape of the object is when X is None. Currently we figure out the shape of an AnnData by checking the shapes of X, obs, and var and asserting everything else fits that. What we should probably start doing is resolving the shape from all elements, so an AnnData with just obsm/ varm can be created.


    An interesting question is what happens if you only provide elements aligned to one axis. E.g. just obsm or obs. Is n_vars unknown or zero?

    Is this allowed?

    adata = AnnData(obs=obs)

    Then what is n_vars. Would this be allowed after?

    adata.varm["x"] = np.ones((20, 10))
  7. modified the milestones: 0.9, 0.10.0 on Feb 20, 2023
  8. modified the milestones: 0.10.0, 0.11.0 on Sep 7, 2023
  9. ivirshup commented on Aug 8, 2024

    @ivirshup
    MemberAuthor

    We think this is probably closable but we need to verify

  10. modified the milestones: 0.11.0, 0.12.0 on Sep 2, 2024
  11. modified the milestones: 0.12.0, 0.13.0 on Jul 16, 2025
  12. AlbertoFabbri93 commented on Jul 7, 2026

    @AlbertoFabbri93

    Is this todo list updated? Can we use anndata with X being None or is it better to wait for 0.13?

  13. flying-sheep commented on Jul 7, 2026

    @flying-sheep
    Member

    It has been working quite well for a while, good point!

  14. modified the milestones: 0.13.0, 0.14.0 on Jul 8, 2026
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

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions