spatialmodel / inmap

InMAP reduced-form air quality model for fine particulate matter (PM2.5)
GNU General Public License v3.0
61 stars 42 forks source link

Make configuration more flexible #22

Closed ctessum closed 6 years ago

ctessum commented 7 years ago

@dpaolella, I've modified the program to be able to use the https://github.com/spf13/viper configuration framework, and I've started adding in some of the configuration options from the configuration file. Would you be willing to add the rest when you get some time?

ctessum commented 7 years ago

The part that you would be adding to for the most part is in 202fa995c3990eb69bfe0a86bfab3ca704361fd8, in the file cmd.go. The .md files are automatically generated by running go generate in the root directory.

dpaolella commented 7 years ago

Do we really want to add defaults for every configuration option? It seems unlikely that someone would want to run InMAP that way. I'm still trying to learn how viper works - is the ultimate goal here for there to be no config file, just a command line interface for setting up the config variables?

ctessum commented 7 years ago

I was thinking to have defaults for the things that have obvious defaults, like the variable grid thresholds. Otherwise, no default. The goals are allow users to have a general configuration file where they can override specific flags with command line arguments or environment variables, and to have the configuration documentation to be accessible from within the model in a way that can be used in a graphical user interface.

dpaolella commented 7 years ago

That makes sense.

ctessum commented 7 years ago

Thanks, David! When you get a chance, would you also be willing to add in the rest of the configuration variables as well? It's not a super high priority.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.1%) to 82.007% when pulling a1a7acfe489314f5da5eaadb53ff3f7f2231eba0 on viper into 2a941c9647a0f05da050e219ff07b6df5206d20e on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.1%) to 82.007% when pulling 6ec92dc8d350c7ee77baef920fdd4d75362aa424 on viper into 2a941c9647a0f05da050e219ff07b6df5206d20e on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.1%) to 82.007% when pulling 6ec92dc8d350c7ee77baef920fdd4d75362aa424 on viper into 2a941c9647a0f05da050e219ff07b6df5206d20e on master.