[Git][NTPsec/ntpsec][master] ntpviz: iPython 2.6 does not have dict comprehensions. Fixes issue #16?
Gary E. Miller
gitlab at mg.gitlab.com
Fri Jan 6 00:12:05 UTC 2017
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
d0762e15 by Gary E. Miller at 2017-01-05T16:10:09-08:00
ntpviz: iPython 2.6 does not have dict comprehensions. Fixes issue #16?
A win is combining two for loops into one.
- - - - -
1 changed file:
- ntpclients/ntpviz
Changes:
=====================================
ntpclients/ntpviz
=====================================
--- a/ntpclients/ntpviz
+++ b/ntpclients/ntpviz
@@ -226,11 +226,6 @@ class VizStats(ntp.statfiles.NTPStats):
self.percs["mu"] = mean(values)
self.percs["pstd"] = pstdev(values, mu=self.percs["mu"])
- # range the data
- self.percs.update(
- {k: v * self.multiplier for k, v in list(self.percs.items())}
- )
-
self.title = title
# calculate ranges
@@ -244,6 +239,8 @@ class VizStats(ntp.statfiles.NTPStats):
# pretty print the values
self.percs_f = {}
for k, v in self.percs.items():
+ # range the data
+ v *= self.multiplier
self.percs[k] = round(v, 3)
self.percs_f[k] = format(v, ",.3f")
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/d0762e15adcbda0ebf0562d34a7ade63b82d3001
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170106/fc71dfad/attachment.html>
More information about the vc
mailing list