clean up comments and remove py2 parts
This commit is contained in:
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
.. moduleauthor:: Daniel Weschke <daniel.weschke@directbox.de>
|
.. moduleauthor:: Daniel Weschke <daniel.weschke@directbox.de>
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function
|
|
||||||
import math
|
import math
|
||||||
import pickle
|
import pickle
|
||||||
|
|
||||||
@@ -44,7 +43,6 @@ def read(file_name, x_column, y_column, default=None, verbose=False):
|
|||||||
y = []
|
y = []
|
||||||
for row in file:
|
for row in file:
|
||||||
fields = re.split(r'\s+', row.strip())
|
fields = re.split(r'\s+', row.strip())
|
||||||
#print(filds)
|
|
||||||
x.append(float(fields[x_column]))
|
x.append(float(fields[x_column]))
|
||||||
y.append(float(fields[y_column]))
|
y.append(float(fields[y_column]))
|
||||||
file.close()
|
file.close()
|
||||||
@@ -157,7 +155,6 @@ def seq(start, stop=None, step=1):
|
|||||||
exponent = max(start_exp, step_exp) # no stop because it is an open bound
|
exponent = max(start_exp, step_exp) # no stop because it is an open bound
|
||||||
|
|
||||||
n = int(math.ceil((stop - start)/float(step)))
|
n = int(math.ceil((stop - start)/float(step)))
|
||||||
#n = int((stop - start)/float(step)) # in py3 math.ceil returns int
|
|
||||||
lst = []
|
lst = []
|
||||||
if n > 0:
|
if n > 0:
|
||||||
lst = [round(start + step*i, exponent) for i in range(n)]
|
lst = [round(start + step*i, exponent) for i in range(n)]
|
||||||
@@ -192,5 +189,5 @@ def get_id(ids, uide):
|
|||||||
:returns: full id
|
:returns: full id
|
||||||
:rtype: str or int
|
:rtype: str or int
|
||||||
"""
|
"""
|
||||||
# we know it is a unique ending
|
# take first element, because we know it is a unique ending
|
||||||
return [idi for idi in ids if idi.endswith(uide)][0]
|
return [idi for idi in ids if idi.endswith(uide)][0]
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
.. moduleauthor:: Daniel Weschke <daniel.weschke@directbox.de>
|
.. moduleauthor:: Daniel Weschke <daniel.weschke@directbox.de>
|
||||||
"""
|
"""
|
||||||
from __future__ import division, print_function, unicode_literals
|
|
||||||
|
|
||||||
def gaußsche_osterformel(year):
|
def gaußsche_osterformel(year):
|
||||||
"""Gaußsche Osterformel.
|
"""Gaußsche Osterformel.
|
||||||
|
|||||||
@@ -10,10 +10,8 @@
|
|||||||
|
|
||||||
.. moduleauthor:: Daniel Weschke <daniel.weschke@directbox.de>
|
.. moduleauthor:: Daniel Weschke <daniel.weschke@directbox.de>
|
||||||
"""
|
"""
|
||||||
from __future__ import division, print_function, unicode_literals
|
|
||||||
from time import struct_time, mktime
|
from time import struct_time, mktime
|
||||||
|
|
||||||
|
|
||||||
def in_seconds(time):
|
def in_seconds(time):
|
||||||
"""If time is `time.struct_time` convert to float seconds.
|
"""If time is `time.struct_time` convert to float seconds.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user