Skip to content

Commit 97a4f70

Browse files
author
Andrew Yang
committed
Use existing isfloat() function
1 parent 5681d9d commit 97a4f70

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/diffpy/utils/parsers/loaddata.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,9 @@ def countcolumnsvalues(line):
103103
if flag:
104104
name = hpair[0]
105105
value = hpair[1]
106-
# can be stored as float if only one decimal
107-
if hpair[1].replace(".", "", 1).isnumeric():
108-
value = float(hpair[1])
109106
# check if data value should be stored as float
107+
if isfloat(hpair[1]):
108+
value = float(hpair[1])
110109
hdata.update({name: value})
111110
# continue search for the start of datablock
112111
fpos = (fpos[1], fpos[1] + len(line))

0 commit comments

Comments
 (0)