-
Notifications
You must be signed in to change notification settings - Fork 168
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
loadtxt/savetxt
: do not require space after last entry
#877
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @perazz . Pending minor comments, LGTM.
Note: I thought that write(*,'(*(i0,1x)')
would not result in a line with a space at its end. Is this compiler-specific?
Co-authored-by: Jeremie Vandenplas <[email protected]>
Co-authored-by: Jeremie Vandenplas <[email protected]>
I'm never sure about these string formats, so I went test it here. It seems like all most used compilers do add a space at the end. After this PR we will have an error message, so if those tests fail again, we will hopefully know why (I've never had any errors testing on my machine locally). |
Co-authored-by: Jeremie Vandenplas <[email protected]>
Can this PR be merged, @perazz ? |
As there have been no further comments, I will merge @jvdp1. Thanks for the review and approval. |
Attempt to address #862.
The current formats require an end-of-row space both in
savetxt
andloadtxt
, i.e.,This PR proposes to not require a space after the last record, i.e.,
This should hopefully improve the seldom crashing CI tests.
@fortran-lang/stdlib @chuckyvt @minhqdao
PS: these routines would benefit from some form of error control in the
read
andwrite
statements.Without changing the API, I propose checking for
iostat
andiomsg
, so that when something goes wrong, an error can be produced to give information about what happened (what file, which line).