Skip to content
Snippets Groups Projects
Commit 498a6751 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Correct for flake8.

parent bf85f9eb
Branches
No related tags found
No related merge requests found
Pipeline #43421 passed
......@@ -22,23 +22,14 @@
# Author: Eric Kooistra
# Date: may 2021
# Purpose:
# Simulate linearity of rounding
# Description:
# Usage:
# > python3 try_round.py -N 1024 -ampl 12 --useplot
import argparse
import numpy as np
import matplotlib
matplotlib.use('tkagg') # to make X11 forwarding work
import matplotlib.pylab as plt
"""Try rounding
Simulate linearity of rounding.
Usage:
> python try_round.py -h
> python3 try_round.py -N 1024 -w 8 -f 3 --useplot
Note:
. For values exactly halfway between rounded decimal values, NumPy rounds to
......@@ -47,8 +38,11 @@ Note:
"""
import argparse
import numpy as np
import matplotlib.pylab as plt
import matplotlib
matplotlib.use('tkagg') # to make X11 forwarding work
import matplotlib.pyplot as plt
import common as cm
figNr = 1
......@@ -57,7 +51,7 @@ figNr = 1
_parser = argparse.ArgumentParser('try_round')
_parser.add_argument('-N', default=1024, type=int, help='Number of points of FFT')
_parser.add_argument('-w', default=8, type=int, help='Total number of bits')
_parser.add_argument('-f', default=0, type=int, help='Number of bits of fraction that gets rounded')
_parser.add_argument('-f', default=1, type=int, help='Number of bits of fraction that gets rounded')
_parser.add_argument('--useplot', action='store_true', dest='useplot', default=False, help='Default without plotting, else with plotting')
args = _parser.parse_args()
......
......@@ -62,8 +62,6 @@ import matplotlib
matplotlib.use('tkagg') # to make X11 forwarding work
import matplotlib.pyplot as plt
import common as cm
# Parse arguments to derive user parameters
_parser = argparse.ArgumentParser(
description="".join(textwrap.dedent("""\
......
......@@ -31,11 +31,6 @@
import argparse
import textwrap
import numpy as np
import matplotlib
matplotlib.use('tkagg') # to make X11 forwarding work
import matplotlib.pyplot as plt
import random
import common as cm
......@@ -86,4 +81,3 @@ else:
print('Error:')
print(x_wrap_sum_wrap)
print(x_wrap_sum)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment