Skip to content

Commit 336f855

Browse files
committed
Add nbins optional argument to histofromcsv.py programs
1 parent 35a3c31 commit 336f855

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

baseline/plots/histofromcsv.py

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
action="store_true")
2727
parser.add_argument("--width", help="Pixel width of the image", type=int)
2828
parser.add_argument("--height", help="Pixel height of the image", type=int)
29+
parser.add_argument("--nbins", help="Number of histogram bins.", type=int)
2930
args = parser.parse_args()
3031

3132
# Create RDataFrame from .csv file

tfileprefetch/plots/histofromcsv.py

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
action="store_true")
2727
parser.add_argument("--width", help="Pixel width of the image", type=int)
2828
parser.add_argument("--height", help="Pixel height of the image", type=int)
29+
parser.add_argument("--nbins", help="Number of histogram bins.", type=int)
2930
args = parser.parse_args()
3031

3132
# Create RDataFrame from .csv file

xrootd/plots/histofromcsv.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
action="store_true")
2727
parser.add_argument("--width", help="Pixel width of the image", type=int)
2828
parser.add_argument("--height", help="Pixel height of the image", type=int)
29+
parser.add_argument("--nbins", help="Number of histogram bins.", type=int)
2930
args = parser.parse_args()
3031

3132
# Create RDataFrame from .csv file
@@ -40,7 +41,7 @@
4041
median = numpy.median(timearray)
4142

4243
# Decide Histo1D arguments
43-
nbins = 100
44+
nbins = args.nbins if args.nbins else 100
4445
xmin = args.xmin if args.xmin else numpy.min(timearray) - 1
4546
xmax = args.xmax if args.xmax else numpy.quantile(timearray, .95)
4647
hname = args.name if args.name else "Stats"

0 commit comments

Comments
 (0)