Comments (3)
Yes, I can reproduce this:
x = {'x_nml': {'a': [{'b': 1, 'c': 2}, {'b': 3, 'c': 4}]}}
n = f90nml.Namelist(x)
print(n)
I'll try to fix this today.
from f90nml.
This should now be fixed in the latest commit: 5377573
From the commit log
The Namelist constructor was not converting lists of dicts into list of Namelists, which was causing various problems related to indexing and expectations of the start_index property.
There also was not very good support for arrays of dicts without a start index. This was presumed to not be a problem, since arrays of derived types require an explicit index, but it was an issue when initialising with a Python dict.
Could you try this for me?
from f90nml.
thank you, this issue is now fixed, lists of dicts are correctly converted to lists of Namelists.
from f90nml.
Related Issues (20)
- Namelist parsed successfully despite error when using in an application HOT 6
- Cannot pop Cogroup HOT 4
- Write fail when an empty list is provided HOT 3
- Bug reading mixed lists in version 1.4.0 HOT 6
- del with upper case not working in versions > 1.3.1 HOT 4
- Problem writing out read-in lists in version 1.4.2 HOT 4
- Keep case sensitive names for variables and groups HOT 3
- Improved f90nml parsing error messaging HOT 3
- Assertion errors with ill-valued namelist
- patching of fortran types only works for first occurence HOT 5
- patching a repeated section on a namelist returns an unclear message HOT 17
- Include a diff and update methods for namelists HOT 2
- f90nml without the -p option makes the transformed namelist unusable HOT 6
- f90nml does not parse WRF namelist files at all HOT 5
- Multiple Namelists in CLI HOT 1
- Namelist variable stays as single int/float value with comma HOT 2
- Patching an array with assignment on multiple lines corrupts the output file HOT 1
- Reducing permissiveness of parser HOT 5
- No spaces before comments results in a string, rather than the intended type HOT 2
- Support MOM6 parameter files? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from f90nml.