File tree 2 files changed +10
-9
lines changed 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 22
22
from pvlib .iotools .sodapro import get_cams # noqa: F401
23
23
from pvlib .iotools .sodapro import read_cams # noqa: F401
24
24
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
Original file line number Diff line number Diff line change 4
4
5
5
import io
6
6
7
- def num_type (value ):
8
-
9
7
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
+ """
11
12
if '.' in value :
12
13
try : # Detect float
13
14
value_out = float (value )
@@ -26,11 +27,12 @@ def num_type(value):
26
27
except ValueError : # Otherwise leave as string
27
28
value_out = value
28
29
return value_out
29
-
30
+
30
31
31
32
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
+ """
34
36
if ',' in element : # Detect a list
35
37
values = element .split (',' )
36
38
element_out = []
@@ -86,11 +88,10 @@ def parse_panond(fbuf):
86
88
indent_lvl_2 = (len (lines [i + 1 ]) - len (lines [i + 1 ].lstrip (' ' ))) // 2
87
89
line_data = lines [i ].split ('=' )
88
90
key = line_data [0 ].strip ()
89
- # value = element_type(line_data[1].strip()) if len(line_data) > 1 else None
90
91
if len (line_data ) > 1 :
91
92
value = element_type (line_data [1 ].strip ())
92
93
else :
93
- value = element_type = None
94
+ value = None
94
95
# add a level to the dict. The key here will be ignored.
95
96
# Not vital to file function.
96
97
if indent_lvl_2 > indent_lvl_1 :
You can’t perform that action at this time.
0 commit comments