Skip to content

TST: Enable NPY_RELAXED_STRIDES_DEBUG environment variable. #8999

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

Merged
merged 1 commit into from
Apr 26, 2017

Conversation

charris
Copy link
Member

@charris charris commented Apr 26, 2017

Setting NPY_RELAXED_STRIDES_DEBUG=1 in the enviroment when relaxed
stride checking is enabled will cause numpy to be compiled with affected
strides set to bogus values in order to help smoke out incorrect usage
of strides in downstream projects.

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

Needs a release note, but otherwise looks good to me.

@eric-wieser eric-wieser added the 56 - Needs Release Note. Needs an entry in doc/release/upcoming_changes label Apr 26, 2017
@charris charris force-pushed the relaxed-strides-debug-option branch from 930b9cd to 19c968e Compare April 26, 2017 19:56
@charris
Copy link
Member Author

charris commented Apr 26, 2017

Heh, fair catch ;) Fixed.

@eric-wieser eric-wieser removed the 56 - Needs Release Note. Needs an entry in doc/release/upcoming_changes label Apr 26, 2017
@@ -385,7 +397,7 @@ offset into the file. This is a behaviour change only for offsets
greater than ``mmap.ALLOCATIONGRANULARITY``.

``np.real`` and ``np.imag`` return scalars for scalar inputs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copy link
Member

Choose a reason for hiding this comment

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

There are now 3 or 4 PRs that make this change...

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, one of them has to go first ;) Easy fix on line if homu complains, but now I'm actually curious if it will cause a merge problem.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, and this one looks the least controversial

Setting NPY_RELAXED_STRIDES_DEBUG=1 in the enviroment when relaxed stride
checking is enabled will cause numpy to be compiled with affected strides set
to bogus values in order to help smoke out incorrect usage of strides in
downstream projects.
Copy link
Member

Choose a reason for hiding this comment

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

Might be worth explaining what a typical "smoke out" looks like, and specifying that "bogus" means "extremely large".

Could do with a comma after "bogus values", too.

Copy link
Member Author

Choose a reason for hiding this comment

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

To be sure. IIRC correctly, the usual is an IndexError but I am not sure.

@charris
Copy link
Member Author

charris commented Apr 26, 2017

@matthew-brett If you are building daily wheels for testing purposed you may want to put NPY_RELAXED_STRIDES_DEBUG=1 in the build environment.

Setting NPY_RELAXED_STRIDES_DEBUG=1 in the enviroment when relaxed
stride checking is enabled will cause numpy to be compiled with affected
strides set to bogus values in order to help smoke out incorrect usage
of strides in downstream projects.
@charris charris force-pushed the relaxed-strides-debug-option branch from 19c968e to 39a21dd Compare April 26, 2017 20:31
---------------------------------------------------------
Setting NPY_RELAXED_STRIDES_DEBUG=1 in the enviroment when relaxed stride
checking is enabled will cause numpy to be compiled with the affected strides
set to the maximum value of npy_intp in order to help detect invalid usage of
Copy link
Member

Choose a reason for hiding this comment

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

Still would like a comma after npy_intp, but not too important

Copy link
Member Author

Choose a reason for hiding this comment

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

When a subordinate clause follows an independent clause, a comma is not needed.

I used a comma in the sentence above because the subordinate clause comes first.

Two examples, two cases. Two sentence fragments ;)

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I agree it's not necessary (thanks for the formal explanation though) - but am I right in saying it would be valid?

@eric-wieser
Copy link
Member

Probably good to wait for a second opinion from someone who's used this before, but I'd be ok with this being merged as is.

@charris
Copy link
Member Author

charris commented Apr 26, 2017

It was discussed on the list. AFAIK, I'm the only one who has made use of the two options and carrying along a patch to apply to releases was getting old. If Matthew enables the option for his nightly wheel build that is used for testing, there will not be much change.

@charris charris merged commit bca7922 into numpy:master Apr 26, 2017
@charris charris deleted the relaxed-strides-debug-option branch April 26, 2017 23:44
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.

2 participants