[PIPE2D-100] Please address code review issues with PIPE2D-48 Created: 12/Oct/16  Updated: 23/Jun/17  Resolved: 23/Jun/17

Status: Done
Project: DRP 2-D Pipeline
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Story Priority: Major
Reporter: aritter Assignee: aritter
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PIPE2D-166 Remove all remaining trailing spaces Done
relates to PIPE2D-167 Remove all commented out code Done
relates to PIPE2D-168 Check all includes/imports, remove un... Done
relates to PIPE2D-169 Use # not """ ... """ for comments Done
relates to PIPE2D-172 Please remove all if False blocks in ... Done
relates to PIPE2D-165 Replace {{cout <<}} and {{print}} wit... Won't Fix
relates to PIPE2D-173 Use np.empty((N, M)) not np.ndarray(s... Won't Fix
Story Points: 1
Sprint: 2014-16
Reviewers: rhl

 Comments   
Comment by aritter [ 17/Mar/17 ]

These are the original comments in PIPE2D-48:

  1. Please remove personal entries from .gitignore
  2. There should be no config overrides in runPipeline
  3. Please move runPipeline to examples
  4. Please put all white-space only changes into a separate commit, and label it appropriately
  5. Check that the memory is contiguous for all the data in a given fibre. If you need to transpose, please add a note to PIPE2D-35
  6. Please don't comment out templates; remove them
  7. Remove all cout << statements; use logging (including tracing as appropriate)
  8. remove all python print statements to use log
  9. How many info logs should become debug?
  10. Please remove all if False blocks. If they are possibly useful control them with variables (probably set by LsstDebug)
  11. There's no need to specify the wavelength files on the command line.
  12. Please factor the I/O into separate functions, and don't read it for every exposure
  13. Use "not success" not "success == False"
  14. What do comments like "THIS DOESN'T WORK" mean?
  15. Please remove all commented out code
  16. Use np.empty((N, M)) not np.array(shape=(N, M))
  17. Explain shape for wLenTemp
  18. Use k += 1 not k = k + 1
  19. Use # not """ ... """ for comments
  20. Things like getAllFluxes() should not need to make a copy if you get the column/row major right
  21. Split Spectra.py tests into separate tests if you might not want to run them (and then use a skip decorator)
Comment by aritter [ 24/Mar/17 ]

1. Please remove personal entries from .gitignore:
done

2. There should be no config overrides in runPipeline:
already happened

3. Please move runPipeline to examples
already happened

4. Please put all white-space only changes into a separate commit, and label it appropriately:
filed ticket PIPE2D-166 and put white-space change commits there

5. Check that the memory is contiguous for all the data in a given fibre. If you need to transpose, please add a note to PIPE2D-35:
I checked all class variables in FiberTrace and Spectrum visually if the storage order makes sense and could not find any problems

6. Please don't comment out templates; remove them
I filed ticket PIPE2D-167 and moved commits which remove commented out lines there

7. Remove all cout << statements; use logging (including tracing as appropriate):
I filed ticket PIPE2D-165 and moved commits there

8. remove all python print statements to use log:
included in ticket PIPE2D-165

9. How many info logs should become debug?:
included in ticket PIPE2D-165

10. Please remove all if False blocks. If they are possibly useful control them with variables (probably set by LsstDebug):

11. There's no need to specify the wavelength files on the command line.
already happened

12. Please factor the I/O into separate functions, and don't read it for every exposure
Filed ticket PIPE2D-182.

13. Use "not success" not "success == False"
Done as part of this ticket.

14. What do comments like "THIS DOESN'T WORK" mean?
"THIS DOESN'T WORK" was a leftover from a previous code change. It concerned the values of the private class variable _iTrace in the C++ classes FiberTrace and Spectrum. Setting the value for the Spectrum is being taken care of in ExtractSpectraTask. I removed all the lines which set iTrace for the spectra (commit "reduceArcTask: check iTrace for correct values"). Currently the trace IDs have to be set for the FiberTraceSet via assignITrace after tracing the FiberTraces. I filed ticket PIPE2D-180 to include assignITrace in findAndTraceApertures.

15. Please remove all commented out code
I filed ticket PIPE2D-167 to remove all commented out code from all source files

16. Use np.empty((N, M)) not np.array(shape=(N, M))
I filed ticket PIPE2D-173 to replace all appearances of np.array with np.empty

17. Explain shape for wLenTemp
Changed setting of wLenTemp to wLenTemp = wavelengths[np.where(traceIds == traceId)] which should be much clearer

18. Use k += 1 not k = k + 1
Done

19. Use # not """ ... """ for comments
Filed ticket PIPE2D-169

20. Things like getAllFluxes() should not need to make a copy if you get the column/row major right
They need to in this case to create an array of the shape nFiberx x nCCDRows. The FiberTraces and Spectra are still only as long as they appear on the CCD. This is hidden from the end user as they are persisted with the height of nCCDRows. It would be a lot of work to change this...

21. Split Spectra.py tests into separate tests if you might not want to run them (and then use a skip decorator)
Removed all if True: statements

Comment by aritter [ 23/Jun/17 ]

merged into master

Generated at Sat Feb 10 15:48:27 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.