Navigation Menu

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

Set nml with vectors #245

Merged
merged 5 commits into from Feb 5, 2019
Merged

Set nml with vectors #245

merged 5 commits into from Feb 5, 2019

Conversation

jsta
Copy link
Member

@jsta jsta commented Jan 10, 2019

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.

@jsta
Copy link
Member Author

jsta commented Jan 10, 2019

Pinging @farrellkj2. I think this fixes the errors you were having.

@jordansread
Copy link
Member

@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")))
Copy link
Member

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.

Copy link
Member Author

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.

@jordansread
Copy link
Member

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

@jsta
Copy link
Member Author

jsta commented Feb 5, 2019

I think this is good to go @jread-usgs

@jordansread jordansread merged commit fbd96d0 into GLEON:master Feb 5, 2019
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