-
Notifications
You must be signed in to change notification settings - Fork 151
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
Allow writing mnemonics in ~A line #465
Conversation
Adds mnemonics_header and data_section_header to writer.py:write The former is boolean controlling whether it occurs or not (off by default for backwards compatibility). The latter allows the prefix to be controlled e.g. "~A" vs "~ASCII". The mnemonic headers are right-aligned based on the numeric value's column width, so that a fixed-width formatting parser can read it in. If the mnemonics are too long, then they are just placed one following the other, out of alignment.
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.
Looks good! I've noted a few suggestions.
Add tests for data-section-header column names
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.
I put these suggestions on the dcslagel:data-header-line-optional-changes branch which can be closed or merged to this data-header-branch. Either way, the data-header-line pull-request can merge when you are ready.
Optional changes for the data-header-line (#465) branch
Thanks for the review and comments, and changes! 🎉 I will merge shortly. |
Partial implementation of #375 - also ref SO question https://stackoverflow.com/questions/60329481/how-to-add-curve-header-to-output-of-las-write-with-lasio-py/66939467#66939467
Adds mnemonics_header and data_section_header keyword arguments to
writer.py:write
. The former is boolean controlling whether it occurs or not (off by default for backwards compatibility). The latter allows the prefix to be controlled e.g. "~A" vs "~ASCII".The mnemonic headers are right-aligned based on the numeric value's column width, so that a fixed-width formatting parser can read it in. If the mnemonics are too long, then they are just placed one following the other, out of alignment.
See https://gist.github.com/kinverarity1/aaf3459c3fa3eeafe127c9011c15c835 for a demo.