Skip to content

Fix MaskedColumn performance issue for mask=None - #7422

Merged
bsipocz merged 2 commits into
astropy:masterfrom
taldcroft:table-mask-slow
May 3, 2018
Merged

bsipocz merged 2 commits into
astropy:masterfrom
taldcroft:table-mask-slow

Conversation

@taldcroft

Copy link
Copy Markdown
Member

Fixes #7399

I think this could be backported to 2.0.x. As far as I can tell there is no API change, just a performance fix. It could even be called a bug since it is apparently not expected to use None instead of False for the mask in MaskedArray (though it gives the same final result, just very slowly).

I think we can keep the astropy API for MaskedColumn where mask=None is the default and implies MaskedArray(data, mask=False). One point is we do not use a default of np.ma.nomask, which has the effect of giving a scalar mask, which generally breaks things later.

@mhvk - this should be an easy review!
cc @adrn

@astropy-bot

astropy-bot Bot commented May 3, 2018 •

Copy link
Copy Markdown

Hi there @taldcroft 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃.

Everything looks good from my point of view! 👍

If there are any issues with this message, please report them here.

@saimn

saimn commented May 3, 2018

Copy link
Copy Markdown
Contributor

Good catch!

@pllim

pllim commented May 3, 2018

Copy link
Copy Markdown
Member

Please move change log to make bot happy.

p.s. Do we need a benchmark? Obviously we can't benchmark with the actual 1.6 GB of data but is it possible to use a smaller dataset? (Just curious.)

@pllim

pllim commented May 3, 2018

Copy link
Copy Markdown
Member

@aaryapatil , dare I say that this naturally put your hack pitch to no. 1 place in pyastro 2018 for being the first one completed? 😉

@bsipocz

bsipocz commented May 3, 2018

Copy link
Copy Markdown
Member

@pllim @aaryapatil - In addition you also unlocked an extra hackday achievement, made someone else work on your hack idea ;)

@pllim

pllim commented May 3, 2018

Copy link
Copy Markdown
Member

@bsipocz , I shall call it "mind hack" 😂

@taldcroft

Copy link
Copy Markdown
Member Author

Do we need a benchmark? Obviously we can't benchmark with the actual 1.6 GB of data but is it possible to use a smaller dataset? (Just curious.)

@pllim - good idea, see #7423

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@bsipocz
bsipocz merged commit 2029fec into astropy:master May 3, 2018
@bsipocz

bsipocz commented May 3, 2018

Copy link
Copy Markdown
Member

Thank you all!

@pllim

pllim commented May 4, 2018

Copy link
Copy Markdown
Member

xref astropy/astropy-benchmarks#48

bsipocz added a commit that referenced this pull request May 21, 2018
Fix MaskedColumn performance issue for mask=None
bsipocz added a commit that referenced this pull request May 21, 2018
Fix MaskedColumn performance issue for mask=None
bsipocz added a commit that referenced this pull request May 22, 2018
Fix MaskedColumn performance issue for mask=None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Table.read(filename) is 10 times slower than Table(fits.getdata(filename))

6 participants