Closed bdorney closed 5 years ago
Feature Updated ana_scans.py #225
and Files changed: 30
really don't belong in the same sentence...
rebase
d
A few comments on some common blocks, nothing obviously major, but overall a bit difficult to separate the refactored parts from the new parts (refactor here means code that was moved, and
OptParse
->ArgParse
. This could be alleviated at review time by squashing (and reordering) commits related to specific changes, as code can be reviewed on a per-commit basis), will probably make a stronger recommendation in the future for this, since I'm also guilty of this.
I did not know it was possible to reorder commits; I have made many squash
es throughout the development process. I think I squashed at least 20 commits here; perhaps I should have been more vigorous use of squash
.
Second point, and probably more visible only due to the refactor, is the inconsistent usage of string formatting. While I don't expect all old formatting to be updated, I would expect a consistent implementation for any new code (with the expectation that at some point all old code will be cleaned up)
In all new cases I have tried to use exclusively str::format()
method for string formatting/concatenation. I agree 100% that we should remove and reduce inconsistency. I think you are seeing a lot of formatting cases with the %
operator because of the refactoring. If we want to open a new issue to address inconsistencies in string formatting.
@bdorney please bump when ready for re-review
@bdorney please bump when ready for re-review
Yes I will do so; I have not implemented the proposed change here though.
@bdorney please bump when ready for re-review
Ready for re-review @jsturdy and @mexanick
rebase
d
Assumption is that this is working Don't do a plain merge if this is approved, if merging, do a squash merge
I defaulted this repo to "squash and merge"
Description
Addresses issues:
This has been a significant update to the package. Summary of changes is presented below:
optparse.OptionParser
has been abandoned in favor ofargparse.ArgumentParser
; this follows from past discussions with @jsturdy.scandate
from filename:getScandateFromFilename()
inutils/anautilities.py
.GEBType
from filename:getGEBTypeFromFilename()
inutils/anautilities.py
getChamberNameFromFilename()
inutils/anautilities.py
utils/
so that the analysis routine isimport
able (with in mind of enabling more automation in QC7):anaUltraLatency()
defined inutils/latAlgos.py
fill2DScurveSummaryPlots()
,anaUltraScurve()
,plotAllSCurvesOnCanvas()
toutils/scurveAlgos.py
anaUltraThreshold()
andcalibrateThrDAC()
toutils/threshAlgos.py
sbitRateAnalysis
routine has been moved fromutils/anautilities.py
toutils/threshAlgos.py
except Exception as e
) have been changed to specific exception types for more appropriate error handling.mapping/amcInfo.py
with hard coded uTCA shelf layout has been deleted.ana_config
andtree_names
have had newer analysis routines added to them and now use templated strings where appropriate.ana_scans.py
for new tools with v3 electronics in mind; additionally all processes launched use importable analysis routines so additional process are owned by the parent process. Killing the parent process will kill all child processes (this was not happening in previous implementation and child processes needed to be killed manually).getNumCores2Use()
inutils/anautilities.py
for determining the CPU loadana_scans.py
should take when running parallel processes.init_worker()
function to allow child processes to haveKeyboardInterrupt
's handled by the parent process.stdout
andstderr
will be redirected to a dedicated log file if the calling process is not the parent process.*.rst
files to help expand existing documentation.--calFile
argument is not provided toanaUltraScurve.py
at runtime the script will use the data in thevfatID
TBranch
of the inputTTree
to query the DB to retrieve the calibration coefficients. This partially addresses: https://github.com/cms-gem-daq-project/gem-plotting-tools/issues/188.Types of changes
The usage of the following files has changed:
anaSBitMonitor.py
andanaUltraLatency.py
theinfilename
argument is now a positional argument.anaUltraScurve.py
andanaUltraThreshold.py
theinfilename
andGEBtype
arguments are now positional arguments.Additionally significant changes to
ana_scans.py
have been made which are described in depth below.Motivation and Context
QC8 shifters where either:
For efficient usage of time and computing resources I've provided an update to
ana_scans.py
to address these concerns.Also, with the goal to automate further QC7 and reduce mistakes we need the ability to
import
analysis of several scans (e.g. scurve, tracking data threshold, and sbit threshold) into the QC7 routine. These changes allow for that.Finally, since
run_scans.py
provides (with the exception of calibration ofCFG_THR_ARM_DAC
) a single entry point to the calibration measurement program we should have a similar tool for analysis data for QOL improvements.Updates to
ana_scans.py
The script has been re-designed to make use of sub command parsers. The script now features multiple subcommands and where possible these sub commands use the same keyword as the
run_scan.py
equivalent to provide easy recognition to the shifter.The following analysis are not implemented (no change from past behavior) for the equivalent call of the following tools:
anaSBITMonitor.py
,anaSBitReadout.py
,anaXDAQLatency.py
,However these tools can't really generate data that can be analyzed in parallel (or a tool already exists to do so, e.g.
LDQM
foranaXDAQLatency.py
).Master help menu
The
armDacCal
commandThe
dacScanV3
commandThe
lat
CommandThe
sbitThresh
CommandThe
scurve
CommandThe
thrDac
CommandThe
trim
CommandHow Has This Been Tested?
Extensive testing on 904 DAQ machines using old data.
Screenshots (if appropriate):
Checklist: