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

Mangled values when input parameters have leading whitespace #958

Open
brryan opened this issue Oct 16, 2023 · 3 comments
Open

Mangled values when input parameters have leading whitespace #958

brryan opened this issue Oct 16, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@brryan
Copy link
Collaborator

brryan commented Oct 16, 2023

Someone recently tried the input parameter block

<testblock>
 testparam = 2.0

and the result of GetReal("testblock", "testparam") was 0.0. This appeared to be due to Parthenon reading a value of = 2.0 and casting this string to a Real which resulted in 0.0. The problem was fixed by removing the leading whitespace from testparam. It appears we need to check parameter input for leading whitespace.

@brryan brryan added the bug Something isn't working label Oct 16, 2023
@brryan brryan self-assigned this Oct 16, 2023
@Yurlungur
Copy link
Collaborator

👍 presumably this is as easy as removing leading whitespace from every line when reading it in?

@pgrete
Copy link
Collaborator

pgrete commented Oct 18, 2023

to quote @bprather (IIRC) "that's why you don't write your own parser" 😄

@bprather
Copy link
Collaborator

Linking #939 in case whoever fixes this wants to take a crack at some of those while they're in the parser code (or replacing it!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants