Skip to content
Snippets Groups Projects
Commit ebdb8bfb authored by David Hendriks's avatar David Hendriks
Browse files

changed robs function to prevent overriding internal functions min and max

parent 6411feee
No related branches found
No related tags found
No related merge requests found
......@@ -354,6 +354,7 @@ def datalinedict(line : str,
Note: if the parameter is a floating point number, it will be converted to Python's float type.
"""
return {param:convfloat(value) for param, value in zip(parameters, line.split())}
def pad_output_distribution(dist : dict,
......@@ -361,23 +362,22 @@ def pad_output_distribution(dist : dict,
"""
Given a distribution, dist (a dictionary), which should be binned every binwidth (float), fill the distribution with zeros when there is no data. Note: this changes the data in place.
"""
# sorted list of the keys
skeys = sorted(dist.keys(), key = lambda x: float(x))
# get min and max, offset by the binwidth
min = skeys[ 0] - binwidth
max = skeys[-1] + binwidth
min_val = skeys[ 0] - binwidth
max_val = skeys[-1] + binwidth
# pad with zeros
x = min
while x <= max:
x = min_val
while x <= max_val:
dist[x] = dist.setdefault(x,0.0)
x += binwidth
return dist
class catchtime(object):
"""
Context manager to calculate time spent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment