Skip to content

TST: Patch table test failures in numpy-dev - #11318

Closed
pllim wants to merge 1 commit into
astropy:masterfrom
pllim:tst-numpydev-table
Closed

pllim wants to merge 1 commit into
astropy:masterfrom
pllim:tst-numpydev-table

Conversation

@pllim

@pllim pllim commented Feb 10, 2021 •

Copy link
Copy Markdown
Member

Description

This pull request is to address dtype "S" and "U" turning into "object" in numpy-dev job. Probably a non-issue due to the moving target of numpy-dev and how Cython didn't compile against it, and we can just deal with it as long as we don't see this behavior in stable numpy?

Fix #11291

NOTE TO REVIEWERS: Make sure tests really pass now in the numpy-dev job!

@pllim
pllim force-pushed the tst-numpydev-table branch from 3d592ab to 047ba0e Compare February 10, 2021 22:15

@pllim pllim left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Less hacky solutions welcome!

Comment thread docs/table/masking.rst
>>> a = [1.0, np.ma.masked]
>>> b = [np.ma.masked, 'val']
>>> Table([a, b], names=('a', 'b'))
>>> b = [np.ma.masked, 'value1']

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have to expand this to 6-char so the table print out is the same whether it reports back str or object.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd rather not corrupt the user documentation like this, namely showing the user a table output that looks different from what they will see (i.e. the ... for the column type).

If need be you can use >>> print(Table([a, b], names=('a', 'b'))) to avoid showing the line with types.

@taldcroft taldcroft left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall I'm not sure about the approach. At least if I understand, eventually numpy-dev will be released and then this problem will occur with the latest numpy release. Then the NUMPY_DEV tag won't be enough.

Or is the assertion that the problem is somehow related to the packaging of numpy-dev in contrast to normal releases?

Comment thread docs/table/masking.rst
>>> a = [1.0, np.ma.masked]
>>> b = [np.ma.masked, 'val']
>>> Table([a, b], names=('a', 'b'))
>>> b = [np.ma.masked, 'value1']

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd rather not corrupt the user documentation like this, namely showing the user a table output that looks different from what they will see (i.e. the ... for the column type).

If need be you can use >>> print(Table([a, b], names=('a', 'b'))) to avoid showing the line with types.

@pllim

pllim commented Feb 15, 2021 •

Copy link
Copy Markdown
Member Author

Yeah, I am not sure about this fix either. I think if possible, we need to understand why the numpy.ndarray size changed is happening for this use case in Table for numpy-dev. Is the tox set up wrong? Is Table making some assumption in Cython that it shouldn't have? Are we somehow building pyx against Numpy that is not the one installed from "nightly" wheel? Is this a weird pytest bug?

@pllim

pllim commented Feb 15, 2021

Copy link
Copy Markdown
Member Author

Like I said in the issue, when I have numpy installed from the nightly wheel in my conda env, the tests actually passes if I move the test code outside of astropy folder. But when I run the test file inside astropy folder (doesn't matter where, even in root dir level), it fails. I still don't understand why that is.

@mhvk

mhvk commented Feb 15, 2021

Copy link
Copy Markdown
Contributor

I do hope to get to this. My sense is that the size change is a red herring. Or perhaps a cython version incompatibility?

@taldcroft

Copy link
Copy Markdown
Member

See numpy/numpy#18425.

@pllim

pllim commented Feb 16, 2021

Copy link
Copy Markdown
Member Author

Wow, thanks for tracking it down, @taldcroft ! I am closing this without merge then.

@pllim pllim closed this Feb 16, 2021
@pllim
pllim deleted the tst-numpydev-table branch February 16, 2021 15:34
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.

TST: Table data type comparison fails with numpy-dev

3 participants