-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
format.write([0, 1, None]) with format='(3I10)' runs into TypeError #21
Comments
Hi, could you post what you expect the behaviour to be? |
I expect it behaves like the example in wiki guide:
Or it might be easier to write None value into spaces with specified width, that is:
|
BTW, I would expect real numbers behave the similar way, that is:
However, currently the code behaves as follows: FortranRecordWriter('(3E10.2)').write([1.0, 2.0, None])
FortranRecordWriter('(3E10.2)').write([1.0, None, 2.0])
|
I have tried some local fixes. Will submit a PR later. |
@brendanarnold I have submitted two PRs for writting int and float strings (with None value) respectively. It would be good to add tests to cover the expected behaviors. But I need more time to understand how to add test. |
By convention, Running the following in GFortran ...
Gives the following output
... so it looks like numerical values are initialised to '0' and logical to |
OK. So it looks we need to handle tailing None values in the list during "writing". |
Yep, here is a commit with tests showing how |
Great. Please feel free to close my PRs. |
Now released as v1.2.0 |
The text was updated successfully, but these errors were encountered: