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
Set nml with vectors #245
Set nml with vectors #245
Conversation
Pinging @farrellkj2. I think this fixes the errors you were having. |
@jsta can the test failures be fixed? |
# read character vectors | ||
glm_nml <- read_nml() | ||
glm_nml <- set_nml(glm_nml, arg_list = list( | ||
'inflow_fl' = c("yahara.csv", "yahara2.csv"))) |
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.
Can you also add a small test to verify that setting it the old way has an identical result? So that we stay backwards compatible with this change. I expect it is the same, but better to have a test.
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.
Ok, I think the new test I've added checks for this.
One more request, please increment the minor version (to 0.15.0 I think) and add yourself as a contributor in the DESCRIPTION file unless you would prefer not to be named @jsta |
I think this is good to go @jread-usgs |
It looks like nml character fields with more than one value (i.e. vectors) are expected to be written ("collapsed") as a single comma separated string. However,
set_nml
writes them as a vector of strings.See MWE at: https://gist.github.com/jsta/2c82af2399bce2ead477727b3e1e2532
This PR enforces collapsing for character fields passed to
set_nml
.