Skip to content

Commit

Permalink
Merge pull request #8 from tkphd/fix-closing-paren
Browse files Browse the repository at this point in the history
Fix closing paren
  • Loading branch information
ocaisa authored Aug 8, 2022
2 parents f3cd2a6 + 46f91f2 commit 67280f6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions amdahl/amdahl.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,16 @@ def random_jitter(x, sigma=0.2):
Apply a random offset of ±20% to a value
"""
# Make sure sigma is between 0 and 1
if sigma < 0 or sigma > 1 :
if sigma < 0 or sigma > 1:
sys.stdout.write(
"Illegal value for sigma (%f), should be a float between 0 and 1!\n" % sigma
"Using 0.2 instead..."
"Illegal value for sigma ({}), "
"should be a float between 0 and 1!\n"
"Using 0.2 instead...".format(sigma)
)
sigma = 0.2
# random() returns a float between 0 and 1, map between -sigma and +sigma
jitter_percent = sigma * ((random.random() * 2) - 1)
return (1 + jitter_percent) * x
jitter_proportion = sigma * ((random.random() * 2) - 1)
return (1 + jitter_proportion) * x


def parse_command_line():
Expand Down

0 comments on commit 67280f6

Please sign in to comment.