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

DM-11620: Numerical problem with Gaussian test in meas_base with pytest #94

Merged
merged 10 commits into from Aug 31, 2017

Conversation

laurenam
Copy link
Contributor

No description provided.

@@ -126,20 +129,21 @@ def testMonteCarlo(self):
fluxSigmas = []
nSamples = 1000
for repeat in range(nSamples):
exposure, catalog = self.dataset.realize(noise*flux, schema)
exposure, catalog = self.dataset.realize(noise*flux, schema, repeat)
Copy link
Member

Choose a reason for hiding this comment

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

maybe this should have the same comment that is found in the similar code in test_GaussianFlux.py? Also say randomSeed=repeat to make it obvious.

@@ -96,7 +95,7 @@ def testMonteCarlo(self):
ySigmaList = []
nSamples = 1000
for repeat in range(nSamples):
exposure, catalog = self.dataset.realize(noise*flux, schema)
exposure, catalog = self.dataset.realize(noise*flux, schema, randomSeed=repeat)
Copy link
Member

Choose a reason for hiding this comment

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

Add a comment as for the other two times?

jdswinbank and others added 10 commits August 31, 2017 16:25
Rather than relying on the state of the RNG, we always use a local random
state and seed it explicitly. This should make us robust against test failures
due to "polluted" randomness.
pytest looks for classes starting with "Test" and will complain
about being unable to find any tests. Renaming the class on
import avoids this problem.
Some tests here depend on the noise realization in the test data
or from the numpy random number generator, so we seed all dataset
realizations explicitly.  For the current test data and seed value
of the random number seed (chosen solely based on the "test passes"
criterion), they pass.  This may no longer be true if the test data
is regenerated or the seed value is changed.
Random seeding is now done explicitly in the unittests, so this is
no longer used.
@laurenam laurenam merged commit f1da33d into master Aug 31, 2017
@ktlim ktlim deleted the tickets/DM-11620 branch August 25, 2018 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants