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-23681: Check, in the unit tests, that fitPtcAndNonLinearity returns what it is supposed to return. #27
Conversation
tests/test_ptc.py
Outdated
@@ -95,50 +99,94 @@ def setUp(self): | |||
self.dataset.rawExpTimes[ampName] = timeVec | |||
self.dataset.rawMeans[ampName] = muVec | |||
|
|||
def test_ptcFitQuad(self): | |||
def ptcFitQuadAndCubic(self, order): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have to specify the order, it's not really QuadAndCubic
but QuadOrCubic
, right? :-)
More generally, I think I'd just call this fitAndCheckPtc
or similar, rather than trying to specify the order of fitting in the function name.
tests/test_ptc.py
Outdated
for ampName in self.ampNames: | ||
localDataset.rawVars[ampName] = [self.noiseSq + self.c1*mu + self.c2*mu**2 + self.c3*mu**3 for | ||
mu in localDataset.rawMeans[ampName]] | ||
self.assertAlmostEqual('POLYNOMIAL', returnedDataset.ptcFitType[ampName]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has to be exactly equal, right? I'm not even sure what “almost equal” means for a string.
tests/test_ptc.py
Outdated
self.assertTrue(localDataset.nonLinearityResiduals[ampName].all() == 0) | ||
def test_ptcFitQuadAndCubic(self): | ||
for order in [2, 3]: | ||
self.ptcFitQuadAndCubic(order) | ||
|
||
def test_ptcFitAstier(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost all of the changes in this function are a duplicate of those in ptcFitQuadAndCubic
. Could you take this opportunity to combine them into one? It'd be a lot easier to see what was going on, and to make sure they are updated in sync in future!
40eb018
to
3ad4601
Compare
No description provided.