{"action":"created","issue":{"url":"https://api.github.com/repos/PecanProject/pecan/issues/1156","repository_url":"https://api.github.com/repos/PecanProject/pecan","labels_url":"https://api.github.com/repos/PecanProject/pecan/issues/1156/labels{/name}","comments_url":"https://api.github.com/repos/PecanProject/pecan/issues/1156/comments","events_url":"https://api.github.com/repos/PecanProject/pecan/issues/1156/events","html_url":"https://github.com/PecanProject/pecan/issues/1156","id":186542855,"number":1156,"title":"Proposed updates to read.settings","user":{"login":"rykelly","id":6820366,"avatar_url":"https://avatars.githubusercontent.com/u/6820366?v=3","gravatar_id":"","url":"https://api.github.com/users/rykelly","html_url":"https://github.com/rykelly","followers_url":"https://api.github.com/users/rykelly/followers","following_url":"https://api.github.com/users/rykelly/following{/other_user}","gists_url":"https://api.github.com/users/rykelly/gists{/gist_id}","starred_url":"https://api.github.com/users/rykelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rykelly/subscriptions","organizations_url":"https://api.github.com/users/rykelly/orgs","repos_url":"https://api.github.com/users/rykelly/repos","events_url":"https://api.github.com/users/rykelly/events{/privacy}","received_events_url":"https://api.github.com/users/rykelly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-01T14:09:41Z","updated_at":"2016-11-01T19:38:24Z","closed_at":null,"body":"## Description\r\nI'd like to suggest a few changes to read.settings that I've half-assed implemented for my own purposes. If people like them, I'd work on the other half ass and then push them. Two things:\r\n\r\n#### Add a block to settings that keeps track of whether `check.settings`, `update.settings`, and `fix.deprecated.settings` have been run before. \r\n\r\nThose functions add a flag to the block when they've been run, and by default won't do anything next time if they see the flag. This is useful if you're testing or just coming back to a workflow that's been run before, so you don't have to wait for those functions to run again unnecessarily. You might be thinking \"who cares?\", to which I reply \"the poor sucker whose `settings` object is actually a list of 600 settings.\" To which you might retort \"well rewrite the functions so they work more efficiently with `MultiSettings`,\" and I'd then have to admit \"yes, that would be a great idea too but I don't have time now.\"\r\n\r\n#### Allow `read.settings` to read .rda\r\n\r\nIt's *much* faster than reading the XML (again, really noticeable for a big MultiSettings). My hacky version currently saves both the XML and a .rda file after running the first time. On subsequent calls it looks to see whether the .rda has been saved already, and if so reads that by default instead of XML. \r\n\r\nFor a cleaner version, I'd suggest that `read.settings`:\r\n\r\n* Adds argument `format` that can be 'xml', 'rda', or 'auto'. The latter is default and decides based on file extension. \r\n* Adds argument `use.rda.if.available`. If `TRUE` (default), the function will look for an existing `<inputfileWithExtensionStripped>.rda`, and read that in if it's found. \r\n* If `inputfile` has no extension (and `format='auto'`), the function looks for `<inputfile>.rda` and `<inputfile>.xml` in that order. \r\n\r\nIn addition, I'd add:\r\n* A corresponding `save.settings` function that would save to .rda by default but allow saving to .xml manually if desired. Or, if folks want .xml to continue to be default that's fine with me.  Might be a good place to have a global option (similar to the `.db.utils` variable used by `PEcAn.DB`, though I think there are preferred methods) so that users can set this behavior once if desired and forget about it. \r\n* A function `convert.settings` to convert between formats. \r\n\r\n## Context\r\nAs noted, basically the work of `read.settings` and associated functions becomes nontrivial for large MultiSettings files, and these changes would make things a lot quicker. \r\n\r\n## Possible Implementation\r\nSee above\r\n"},"comment":{"url":"https://api.github.com/repos/PecanProject/pecan/issues/comments/257671390","html_url":"https://github.com/PecanProject/pecan/issues/1156#issuecomment-257671390","issue_url":"https://api.github.com/repos/PecanProject/pecan/issues/1156","id":257671390,"user":{"login":"bcow","id":5503595,"avatar_url":"https://avatars.githubusercontent.com/u/5503595?v=3","gravatar_id":"","url":"https://api.github.com/users/bcow","html_url":"https://github.com/bcow","followers_url":"https://api.github.com/users/bcow/followers","following_url":"https://api.github.com/users/bcow/following{/other_user}","gists_url":"https://api.github.com/users/bcow/gists{/gist_id}","starred_url":"https://api.github.com/users/bcow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcow/subscriptions","organizations_url":"https://api.github.com/users/bcow/orgs","repos_url":"https://api.github.com/users/bcow/repos","events_url":"https://api.github.com/users/bcow/events{/privacy}","received_events_url":"https://api.github.com/users/bcow/received_events","type":"User","site_admin":false},"created_at":"2016-11-01T19:38:24Z","updated_at":"2016-11-01T19:38:24Z","body":"Just FYI @rykelly I originally proposed that `read.settings` have and argument for format and Rob argued against it, preferring instead individual `read. settings.format` functions. I'm on my phone so I can't type out everything we talked about but it's something that's been on my mind too."}}
{"actor":{"display_login":"bcow"}}