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-29271: PTC task: Refactoring/simplification of code ported from Pierre Astier's repository. #76
Conversation
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.
I think I have too many questions to approve directly. This definitely helps squash some of the unused code/odd single-call functions, but I'm still a bit confused on whether more could be done.
|
||
return mu, varDiff, covDiffAstier | ||
|
||
def fillPtcDatasetAmp(self, ptcDataset, ampName, rawExpTime=[np.nan], rawMean=[np.nan], rawVar=[np.nan], |
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 method makes me think there maybe should be a method (or set of methods) on the PTC object to assist in construction. This sets everything to single-element lists for each amplifier property, correct? I think my idea is an initAmp
method that accepts lists like this is doing, but that then checks that all the lengths for supplied values match. This could then be used here as well as in CpSolvePtcTask
when the dataset is filled with the collated results, and also even in the PtcDataset.__init__
. Maybe on the next pass at refactoring.
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.
I have placed the amp-filling function as part of the ptcDataset code inip_isr
.
|
||
|
||
def parseData(dataset, params): | ||
def parseData(dataset): |
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 function just creates the CovFit
objects that are later fit, correct? I'm unhappy with it returning a dict but calling the variable name a list, but that's a side point. I'm not entirely sure I see the point of generating a dictionary of CovFit
objects, then iterating over the items in that dict instead of just doing a normal loop over amplifiers stored in the dataset, instantiating a CovFit
object, running the fit, storing the useful fit values in the dataset. Are the CovFit
objects used downstream in a way that I'm just not thinking about correctly?
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.
Yes, the dictionary with the CovFit
objects is then used in cpSolvePtcTask
by getOutputPtcDataCovAstier
when getting the output dataset
.
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.
i'll change the suffixes from List
to Dict
.
49d9c60
to
eedf3a3
Compare
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.
I think this answers all of my concerns, thanks!
No description provided.