-
Notifications
You must be signed in to change notification settings - Fork 182
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
Made format constants public #617
Conversation
Thanks for starting this. Have a look at https://github.com/fortran-lang/stdlib/blob/HEAD/doc/specs/stdlib_io.md to add a description of the constants which should become part of the public API. |
Another point for discussion is how the format specifier should be exported. Do we want to be able to use it in a context like this: use stdlib_io, only : FMT_REAL_SP, FMT_COMPLEX_SP
implicit none
print '('//FMT_REAL_SP//',1x,'//FMT_COMPLEX_SP//')', 1.0, (2.0, 3.0)
end I wonder whether the Further, what about non-advancing output, some format specifies have a trailing skip ( |
Added now, let me know if you have any comments on the format of this as wasn't too sure what to copy format-wise from the other examples in the docs.
Is there any reason the complex doesn't have the trailing skip? It would make more sense if all the formats had the same output |
Good points, I think we should export constants without the
I think I implemented this and I don't remember why it is like this. It's possible that I did it by mistake and the tests were insufficient to make it an issue. |
Great, I'm happy to implement this. |
That seems fine to me. 👍 |
… and load_txt to compensate.
Okay, updated the code and docs. Let me know if anything needs changed or adjusted. |
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!
Co-authored-by: Milan Curcic <[email protected]>
Co-authored-by: Milan Curcic <[email protected]>
Co-authored-by: Milan Curcic <[email protected]>
Co-authored-by: Milan Curcic <[email protected]>
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.
Thanks for sharing. Looks good to me.
Could you add a note about this change in https://github.com/fortran-lang/stdlib/blob/HEAD/CHANGELOG.md as well?
Done. Thanks for all your and @milancurcic help in getting this done! |
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.
Small questions: is there no tests?
Also, I think that these will not be documented in Ford docs. Could you add some comments for each format (or at least one general comment) with a link to the specs, please?
…an_env to stdlib_kinds in spec file.
With regards to tests. There are no explicit tests. However, there are some implicit ones within the save_txt tests since save_txt uses the format specifiers. Is that sufficient? Added some comments for each specifier. Let me know if I've done the documentation wrong as I've not used FORD before. |
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 @lewisfish . It looks good to me!
Co-authored-by: Jeremie Vandenplas <[email protected]>
Thank you @lewisfish and reviewers! |
Hey,
This resolves #570.
Pull request makes the format constants from stdlib_io public.
Let me know if I need to do anything else as this is my first pull request, so not 100% sure of the protocol.
Lewis