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

Allow leading whitespace in input parameters #965

Merged
merged 7 commits into from
Nov 1, 2023

Conversation

brryan
Copy link
Collaborator

@brryan brryan commented Oct 20, 2023

PR Summary

Currently, input parameters are read incorrectly. For example,

<block>
 var = 1.0

will read var as = 1.0, which when called with GetReal will cast to 0.

This PR fixes a bug where the length of the name was incorrectly calculated if leading whitespace was present in the input parameter file.

PR Checklist

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md
  • CI has been triggered on Darwin for performance regression tests.
  • Docs build
  • (@lanl.gov employees) Update copyright on changed files

src/parameter_input.cpp Outdated Show resolved Hide resolved
@brryan
Copy link
Collaborator Author

brryan commented Oct 20, 2023

BTW I tested this by adding a leading space character to tlim in the advection example

Copy link
Collaborator

@pgrete pgrete left a comment

Choose a reason for hiding this comment

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

LGTM
How about also adding the one-line test you mention (adding a space to one of the examples input files called by the test suite)?

@brryan
Copy link
Collaborator Author

brryan commented Oct 31, 2023

LGTM How about also adding the one-line test you mention (adding a space to one of the examples input files called by the test suite)?

Good idea @pgrete, done (I changed tst/regression/test_suites/advection_performance/parthinput.advection_performance to check for both space and tab characters)

@brryan brryan enabled auto-merge (squash) October 31, 2023 18:41
@brryan brryan disabled auto-merge November 1, 2023 15:25
@brryan brryan enabled auto-merge (squash) November 1, 2023 15:25
@brryan brryan merged commit 2857394 into develop Nov 1, 2023
49 checks passed
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.

4 participants