Skip to content
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

Column width update #1

Open
wants to merge 8 commits into
base: write-colwidth
Choose a base branch
from

Conversation

marshallward
Copy link

Update to the column width PR after merging with current mainline

Valid types and default values have been added to the docstrings for the
properties of Namelist and Parser.
This small change includes the indentation in any calculations of header
for handling multiline records.

This is a minor first step to applying any indentation for each record,
rather than prepending an indent for every record.

This will allow for indentation to be optional for some lines,
particularly for split strings.
Indentation is now handled completely as part of the header for each
record, and no longer needs to be handled by the namelist group.

This will allow us to optionally remove the indent when appropriate
(e.g. split strings).
This patch completes the transfer of indent management to the variable string
output generation in the Namelist output.

column width is now explicit, rather than based on some offset from the
variable name, which simplifies the interpretation.  Several slightly
complex structures were also simplified due to the uniformity of most
operations.

The pathological case of writing output when the header exceeds the
columns is now handled slightly differently.  Previously, we were
looking for an empty string to avoid redundant writes.  Since we now
pre-pad the next potential record with indented whitespace, we must now
check for a whitespace string.
This patch will split strings which exceed the column width across
multiple lines.

This changes the output of certain pathological cases, such as column
widths shorter than the variable names, but otherwise it should not
alter any existing namelists whose strings do not exceed the column
width.

Lists of strings were not extensive tested yet, so behavior may be a bit
unpredictable here.
This resolves the conflicts with the current mainline branch, but also
"devolves" the colwidth arguments into an attribute.

The attribute will need to be promoted to a property and renamed before
this can be merged however.
@marshallward
Copy link
Author

Sorry, should have copied over these comments from the commit log:

This resolves the conflicts with the current mainline branch, but also
"devolves" the colwidth arguments into an attribute.

The attribute will need to be promoted to a property and renamed before
this can be merged however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant