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

Canonicalise input files #2218

Merged
merged 4 commits into from
Feb 10, 2021
Merged

Canonicalise input files #2218

merged 4 commits into from
Feb 10, 2021

Conversation

ZedThree
Copy link
Member

@ZedThree ZedThree commented Feb 8, 2021

Sorry, this is a horrible PR. In order to apply other input file fixes more cleanly in #2210, first "canonicalise" the input files:

  • nested sections are moved to be under their parent section, while
    preserving relative order
  • empty sections are removed
  • floating point numbers may have their format changed, although the
    value will not change
  • consecutive blank lines will be reduced to a single blank line
  • whitespace around equals signs will be changed to exactly one space
  • trailing whitespace will be removed
  • comments will always use '#'

Essentially just a round-trip of input file -> python BoutOptions -> input file, with no other changes.

Viewing this PR with "hide whitespace" enabled will be useful.

The majority of the changes are like:

- zeta = 2.15e-3
+ zeta = 0.00215
- dx = 1.
+ dx = 1.0

This PR does mean any future input file changes will have much cleaner diffs!

That is, allow just fixing whitespace etc.
Basically, remove extra whitespace, add whitespace around assignments,
put subsections in order, convert floating point numbers to common format
Copy link
Contributor

@johnomotani johnomotani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good. A few small niggles to do with deleting (or not) commented-out options.

examples/2Dturbulence_multigrid/data/BOUT.inp Show resolved Hide resolved
examples/elm-pb/Python/data/BOUT.inp Outdated Show resolved Hide resolved
examples/fci-wave-logn/div-integrate/BOUT.inp Show resolved Hide resolved
examples/elm-pb/Python/data/BOUT.inp Outdated Show resolved Hide resolved
examples/elm-pb/Python/data/BOUT.inp Outdated Show resolved Hide resolved
examples/elm-pb/Python/data/BOUT.inp Outdated Show resolved Hide resolved
examples/elm-pb/Python/data/BOUT.inp Outdated Show resolved Hide resolved
examples/elm-pb/Python/data/BOUT.inp Outdated Show resolved Hide resolved
examples/fci-wave/logn/BOUT.inp Outdated Show resolved Hide resolved
examples/jorek-compare/data/BOUT.inp Show resolved Hide resolved
examples/jorek-compare/data/BOUT.inp Outdated Show resolved Hide resolved
examples/jorek-compare/data/BOUT.inp Outdated Show resolved Hide resolved
examples/lapd-drift/lapd/BOUT.inp Show resolved Hide resolved
Auto-tidy of input files removed some empty sections but left commented-out options "orphaned"
@ZedThree
Copy link
Member Author

ZedThree commented Feb 9, 2021

Meant to try out the new [skip ci] in that commit, oh well

Copy link
Contributor

@johnomotani johnomotani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a few extra orphaned lines to remove.

examples/elm-pb/eigen/BOUT.inp Outdated Show resolved Hide resolved
examples/elm-pb/eigen/BOUT.inp Outdated Show resolved Hide resolved
examples/fci-wave-logn/boundary/BOUT.inp Outdated Show resolved Hide resolved
examples/fci-wave-logn/div-integrate/BOUT.inp Outdated Show resolved Hide resolved
examples/fci-wave/div-integrate/BOUT.inp Outdated Show resolved Hide resolved
examples/gyro-gem/data/BOUT.inp Outdated Show resolved Hide resolved
examples/gyro-gem/data/BOUT.inp Outdated Show resolved Hide resolved
@ZedThree
Copy link
Member Author

Lovely, thanks @johnomotani !

@ZedThree ZedThree merged commit ec6381b into next Feb 10, 2021
@ZedThree ZedThree deleted the canonicalise-input-files branch February 10, 2021 14:55
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.

None yet

2 participants