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

ENH/MAINT: qmc.LatinHypercube: deprecate centered with scramble #17152

Merged
merged 5 commits into from
Oct 13, 2022

Conversation

tupui
Copy link
Member

@tupui tupui commented Oct 5, 2022

We can simplify the interface of qmc.LatinHypercube and make it consistent with other engines by removing the centered parameter and adding scramble. Not centering, the default, can be seen as scrambling. Which is the default for other engines. Hence there is an easy deprecation path with added consistency.

In this PR:

  1. Deprecate centered in favour of scramble. Scrambling is about "adding some randomness" to a sample. As not scrambling might be interpreted as having a constant output, I added a note explaining that it's not the case.
  2. Add a check for d<0 in QMCEngine. We were only testing for integers
  3. Add a test to specifically check centering. This was missing.

@tupui tupui added scipy.stats enhancement A new feature or improvement maintenance Items related to regular maintenance tasks deprecated Items related to behavior that has been deprecated labels Oct 5, 2022
@tupui tupui added this to the 1.10.0 milestone Oct 5, 2022
@tupui tupui requested a review from mdhaber October 5, 2022 11:35
scipy/stats/_qmc.py Outdated Show resolved Hide resolved
scipy/stats/_qmc.py Show resolved Hide resolved
scipy/stats/_qmc.py Outdated Show resolved Hide resolved
scipy/stats/_qmc.py Outdated Show resolved Hide resolved
scipy/stats/_qmc.py Outdated Show resolved Hide resolved
scipy/stats/_qmc.py Outdated Show resolved Hide resolved
scipy/stats/tests/test_qmc.py Outdated Show resolved Hide resolved
Co-authored-by: Matt Haberland <mhaberla@calpoly.edu>
Copy link
Member Author

@tupui tupui left a comment

Choose a reason for hiding this comment

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

Thanks Matt! I did the updates.

scipy/stats/_qmc.py Show resolved Hide resolved
scipy/stats/_qmc.py Outdated Show resolved Hide resolved
Copy link
Member

@j-bowhay j-bowhay left a comment

Choose a reason for hiding this comment

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

This looks good on the deprecation side of things now

@mdhaber
Copy link
Contributor

mdhaber commented Oct 6, 2022

Looks like it's time for a mailing list post. I'll merge a week after that.

Copy link
Contributor

@mdhaber mdhaber left a comment

Choose a reason for hiding this comment

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

Last round of suggestions.

scipy/stats/_qmc.py Outdated Show resolved Hide resolved
scipy/stats/_qmc.py Outdated Show resolved Hide resolved
scipy/stats/_qmc.py Outdated Show resolved Hide resolved
scipy/stats/tests/test_qmc.py Show resolved Hide resolved
Co-authored-by: Matt Haberland <mhaberla@calpoly.edu>
@tupui
Copy link
Member Author

tupui commented Oct 6, 2022

Thanks Matt, just sent an email: https://mail.python.org/archives/list/scipy-dev@python.org/thread/PGUHB7L3ZKCLAG2PQ2MAOEFAOTJR36IK/

And thanks @j-bowhay for the review 👍

scipy/stats/_qmc.py Outdated Show resolved Hide resolved
Co-authored-by: Matt Haberland <mhaberla@calpoly.edu>
Copy link
Contributor

@mdhaber mdhaber left a comment

Choose a reason for hiding this comment

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

The email went out about a week ago. I'll merge shortly if we don't hear otherwise. Oops I got mixed up on when it was sent. I'll merge later this week, though.

@mdhaber mdhaber merged commit f83bd6a into scipy:main Oct 13, 2022
@j-bowhay
Copy link
Member

j-bowhay commented Oct 13, 2022

@h-vetinari another for #15765

@mdhaber mdhaber mentioned this pull request Oct 13, 2022
29 tasks
@mdhaber
Copy link
Contributor

mdhaber commented Oct 13, 2022

@j-bowhay Thanks for the heads up. Hopefully I added it correctly.

ev-br pushed a commit to ev-br/scipy that referenced this pull request Oct 14, 2022
…scramble` (scipy#17152)

* ENH/MAINT: `qmc.LatinHypercube`: deprecate `centered`; replace with `scramble`
@tupui tupui deleted the qmc_lhs_enh branch October 19, 2022 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated Items related to behavior that has been deprecated enhancement A new feature or improvement maintenance Items related to regular maintenance tasks scipy.stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants