arup-group / elara

Command line utility for processing MATSim events output files.
MIT License
13 stars 4 forks source link

Lab 1266/simplify inputs #145

Closed andkay closed 2 years ago

andkay commented 2 years ago

Allows for simplified config of input files using a config.toml using the construction:

[inputs]
inputs_directory = '/path'

The above config obviates the need to specify a path for each MATSim output separately by automatically setting, eg. the plans output to /path/output_plans.xml -- or if that file cannot be found, /path/output_plans.gz.

No further checks are implemented -- relying on valid_path to raise the appropriate errors when called through the plans_path method.

It is still expected that users provide the road pricing path directly because it often lives somewhere else.

Note that similar functionality is provided using override or set_path_root when using the cli -- I considered modifying one of these, but in the end decided a couple of new methods would be cleaner.

One item for special review -- I am not clear on what the logic needs to be under the condition that version = 12 and using_experienced_plans = True

andkay commented 2 years ago

@fredshone. requested changes completed -- could you have a quick look and approve?

andkay commented 2 years ago

@fredshone

I've tacked on a change in default configs to version=12 and using_experienced_plans=true while this branch is open.

this broke several tests but i've fixed them by explicitly setting attributes in the relevant test configs.

andkay commented 2 years ago

@fredshone I've updated example configs and readme. worth having a quick look at.

I added some warnings (as a config method) to remind users that using experienced plans is preferred, and that the expected input file is called output_experienced_plans.xml(.gz) -- to get the correct formatting, this is called in main after the logging environment is config'ed.

andkay commented 2 years ago

@fredshone bumped test coverage.

simplified inputs failed because it was being called before the config.version was set -- i've moved this block to end of the constructor.