Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eliminate drivers, refactor config and city constructors
1. The driver functions for each city (the city name in uppercase) have been removed. They are all replaced with a single drive classmethod in City. This simplifies the code considerably and removes the copy-n-paste mess that has been growing an each new city was added. 2. The city constructors no longer take and pass arguments explicitly by name, this is now achieved with **kwds. This closes next-exp#143 and has a number of consequences Significant noise reduction in constructor definitions. The config files become the sole source of + values of the parameters + documentation of what parameters are needed by each kind of city 3. The config files are now written in Python syntax and parsed with Python's built-in parser. Our custom config parser for our ad-hoc config syntax has been thrown away and replaced with Python's parser. Do not re-invent the wheel. 4. The ability to inculde config files within other config files has been added, allowing the use of hierarchical configurations. Thus the default configuration of some base city does not need to be repeated in each concrete city's config file, as in can be included. 5. A new configuration printer has been added with the key abilities to + report the config file which provides any given value in an active configuration + highlight cases where a value set in one config file is overridden by a setting in another one. Improvements to the config printer are envisaged: + Displaying the comments from the config files. + Displaying the units used in the config files. 6. The mandatory -c (config file) command line option has been turned into a positional argument. (next-exp#203 has not been addressed at all here.)
- Loading branch information