Skip to content

Commit 91f5662

Browse files
authored
Merge pull request #3 from ckrening/panond_2
stickler comments v3
2 parents ea36317 + 4e434b2 commit 91f5662

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

pvlib/iotools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
from pvlib.iotools.sodapro import get_cams # noqa: F401
2323
from pvlib.iotools.sodapro import read_cams # noqa: F401
2424
from pvlib.iotools.sodapro import parse_cams # noqa: F401
25-
from pvlib.iotools.panond import read_panond, parse_panond
25+
from pvlib.iotools.panond import read_panond, parse_panond # noqa: F401

pvlib/iotools/panond.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
import io
66

7-
def num_type(value):
8-
97

10-
# Determine if a value is float, int or leave as string
8+
def num_type(value):
9+
"""
10+
Determine if a value is float, int or a string
11+
"""
1112
if '.' in value:
1213
try: # Detect float
1314
value_out = float(value)
@@ -26,11 +27,12 @@ def num_type(value):
2627
except ValueError: # Otherwise leave as string
2728
value_out = value
2829
return value_out
29-
30+
3031

3132
def element_type(element):
32-
# Determine if an element is a list then pass to num_type()
33-
33+
"""
34+
Determine if an element is a list then pass to num_type()
35+
"""
3436
if ',' in element: # Detect a list
3537
values = element.split(',')
3638
element_out = []
@@ -86,11 +88,10 @@ def parse_panond(fbuf):
8688
indent_lvl_2 = (len(lines[i + 1]) - len(lines[i + 1].lstrip(' '))) // 2
8789
line_data = lines[i].split('=')
8890
key = line_data[0].strip()
89-
# value = element_type(line_data[1].strip()) if len(line_data) > 1 else None
9091
if len(line_data) > 1:
9192
value = element_type(line_data[1].strip())
9293
else:
93-
value = element_type = None
94+
value = None
9495
# add a level to the dict. The key here will be ignored.
9596
# Not vital to file function.
9697
if indent_lvl_2 > indent_lvl_1:

0 commit comments

Comments
 (0)