-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
31 lines (23 loc) · 950 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Main function
# (c) 2023 aczo
from plots import plotPrimeCount
import argparse
from time import time
from datetime import timedelta
def parse_range(astr):
result = set()
for part in astr.split(','):
x = part.split('-')
result.update(range(int(x[0]), int(x[-1]) + 1))
return sorted(result)
parser = argparse.ArgumentParser(description = "Generates plots of Riemann R(x) with specified number of zeta zeroes corrections")
parser.add_argument('zeroes', type=parse_range, help='List of plots with given numbers of zeta zeroes, e.g. 1,2,4-8')
args = parser.parse_args()
print(args.zeroes)
for z in args.zeroes:
print("Generating plot for " + str(z) + " non-trivial zeroes...", end="", flush=True)
start = time()
plt = plotPrimeCount(z)
print("done. Time elapsed: " + str(timedelta(seconds=time()-start)))
plt.savefig("R_x_{:03d}".format(z) + ".png")
plt.close()