Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: test itemsize changes in views of 1d fortran arrays #6759

Closed
wants to merge 1 commit into from

Conversation

ahaldane
Copy link
Member

@ahaldane ahaldane commented Dec 2, 2015

As @charris suggested in #6684, here are some tests of views of 1d arrays using different dtype sizes, checking for the 1.9.3 behavior.

Also, this adds a boolean np.is_relaxed_strides describing whether relaxed strides is enabled.

I'm not sure if you want to merge, but here it is just in case.

Also, introduce a boolean `np.is_relaxed_strides` describing
whether relaxed strides is enabled.
@@ -5457,6 +5457,47 @@ def test_relaxed_strides(self):
shape, strides = get_buffer_info(arr, ['C_CONTIGUOUS'])
assert_(strides[-1] == 8)

# test views of different dtype sizes. These tests will break when
# relaxed strides are enabled
@dec.skipif(np.ones(1).strides[0] == np.iinfo(np.intp).max)
Copy link
Member

Choose a reason for hiding this comment

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

This is probably unsafe as the strides are reset to the usual for release. Safer would be to check if ones((2,1), order='F') is c_contiguous (as well as f_contiguous).

@charris
Copy link
Member

charris commented Dec 2, 2015

Thanks for doing this.

@njsmith
Copy link
Member

njsmith commented Dec 2, 2015

-1 to adding a public top-level attribute np.is_relaxed_strides. Underscored or hidden in some internal module is fine, but the top level namespaxe is crowded enough already and we don't want to get stuck supporting and documenting this thing for years to come.

@homu
Copy link
Contributor

homu commented Aug 20, 2016

☔ The latest upstream changes (presumably #7941) made this pull request unmergeable. Please resolve the merge conflicts.

@ahaldane ahaldane closed this Jan 17, 2018
@ahaldane ahaldane deleted the 1dfortranview_tests branch January 17, 2018 23:40
@ahaldane
Copy link
Member Author

Oops, deleted a branch that was still open. I'll leave it like this though, this is mostly historical.

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.

None yet

4 participants