mirror of
https://github.com/echemdata/galvani.git
synced 2025-12-14 01:15:34 +00:00
Remove maketrans compatibility code
This commit is contained in:
@@ -17,10 +17,8 @@ import numpy as np
|
||||
|
||||
if sys.version_info.major <= 2:
|
||||
str3 = str
|
||||
from string import maketrans
|
||||
else:
|
||||
str3 = functools.partial(str, encoding='ascii')
|
||||
maketrans = bytes.maketrans
|
||||
|
||||
|
||||
def fieldname_to_dtype(fieldname):
|
||||
@@ -49,10 +47,10 @@ def fieldname_to_dtype(fieldname):
|
||||
raise ValueError("Invalid column header: %s" % fieldname)
|
||||
|
||||
|
||||
def comma_converter(float_string):
|
||||
"""Convert numbers to floats whether the decimal point is '.' or ','"""
|
||||
trans_table = maketrans(b',', b'.')
|
||||
return float(float_string.translate(trans_table))
|
||||
def comma_converter(float_text):
|
||||
"""Convert text to float whether the decimal point is '.' or ','"""
|
||||
trans_table = bytes.maketrans(b',', b'.')
|
||||
return float(float_text.translate(trans_table))
|
||||
|
||||
|
||||
def MPTfile(file_or_path):
|
||||
|
||||
Reference in New Issue
Block a user