Skip to content

Allow mixing Column and MaskedColumn in Table and use this for Table.read() #3665

Closed

Description

@taldcroft

#3662 is an example of getting sidetracked from doing science because a table column that wasn't actually missing data is still a MaskedColumn when other table columns have missing data. Masked arrays don't always play well with other tools.

Currently a Table uses the masked attribute to not only determine what class to use for creating new columns, but also whether to convert a Column to MaskedColumn or vice-versa.

This issue to explore changing this behavior so that columns are more autonomous. For instance, when creating a new column in an existing table it might make sense to only use MaskedColumn when necessary.

From a feasibility perspective this probably isn't too difficult. The real issue will be ensuring that there isn't massive code breakage. Right now if you do:

t = Table(masked=True)
t['a'] = [1, 2]

then you know that t['a'] has a mask attribute. So where do we draw the line?

Activity

  1. embray commented on Apr 3, 2015

    @embray
    Member

    Don't most software bugs/misbehaviors count as getting sidetracked from doing science? :)

  2. astrofrog commented on Apr 3, 2015

    @astrofrog
    Member

    To me:

    t = Table(masked=True)
    t['a'] = [1, 2]
    

    means that all columns will be masked (and has to, for backward-compatibility). So it's more that if we add a masked column to a non-masked table, it would then work rather than crash.

  3. taldcroft commented on Apr 3, 2015

    @taldcroft
    MemberAuthor

    @astrofrog - I agree with you on keeping back compatibility.

    One idea is to allow masked=None which never does any conversions beyond going to Column or MaskedColumn when necessary. The default now is masked=None but we would change that to masked=False to match the current behavior.

  4. taldcroft commented on Jun 3, 2019

    @taldcroft
    MemberAuthor

    Superceded by #7496

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions