One of the namelists I am trying to parse using f90nml contains an array assignment of the following syntax
&example
arr(1:2)%foo = 1.0, 2.0
arr(1:2)%bar = 3.0, 4.0
/
If I try to read/parse this namelist
import f90nml
f90nml.reads('''
&example
arr(1:2)%foo = 1.0, 2.0
arr(1:2)%bar = 3.0, 4.0
/
''')
I will get the following error
Traceback (most recent call last):
File "<pyshell#1>", line 5, in <module>
''')
File "C:\Python\Python37-64\lib\site-packages\f90nml\__init__.py", line 47, in reads
return parser.reads(nml_string)
File "C:\Python\Python37-64\lib\site-packages\f90nml\parser.py", line 280, in reads
return self._readstream(iter(nml_string.splitlines()))
File "C:\Python\Python37-64\lib\site-packages\f90nml\parser.py", line 359, in _readstream
patch_nml=grp_patch
File "C:\Python\Python37-64\lib\site-packages\f90nml\parser.py", line 459, in _parse_variable
assert v_idx_bounds[0][1] - v_idx_bounds[0][0] == 1
AssertionError
One of the namelists I am trying to parse using
f90nmlcontains an array assignment of the following syntaxIf I try to read/parse this namelist
I will get the following error