[CalendarServer-changes] [15333] CalendarServer/trunk/contrib/performance/stats.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Nov 18 14:08:01 PST 2015
Revision: 15333
http://trac.calendarserver.org//changeset/15333
Author: cdaboo at apple.com
Date: 2015-11-18 14:08:01 -0800 (Wed, 18 Nov 2015)
Log Message:
-----------
Clean-up.
Modified Paths:
--------------
CalendarServer/trunk/contrib/performance/stats.py
Modified: CalendarServer/trunk/contrib/performance/stats.py
===================================================================
--- CalendarServer/trunk/contrib/performance/stats.py 2015-11-18 21:24:01 UTC (rev 15332)
+++ CalendarServer/trunk/contrib/performance/stats.py 2015-11-18 22:08:01 UTC (rev 15333)
@@ -285,13 +285,13 @@
raise ValueError("When mu and sigma are not defined, mode must be defined")
elif median is not None:
scale = mode
- median /= mode
+ median /= float(mode)
mode = 1.0
mu = log(median)
sigma = sqrt(log(median) - log(mode))
elif mean is not None:
scale = mode
- mean /= mode
+ mean /= float(mode)
mode = 1.0
mu = log(mean) + log(mode) / 2.0
sigma = sqrt(log(mean) - log(mode) / 2.0)
@@ -475,9 +475,9 @@
import matplotlib.pyplot as plt
from collections import defaultdict
- mode = 6.0
- median = 8.0
- distribution = LogNormalDistribution(mode=mode, median=median, maximum=60)
+ mode_val = 6.0
+ median_val = 8.0
+ distribution = LogNormalDistribution(mode=mode_val, median=median_val, maximum=60)
result = defaultdict(int)
for i in range(1000000):
s = int(distribution.sample())
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20151118/3f003a89/attachment.html>
More information about the calendarserver-changes
mailing list