arup-group / elara

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

LinkCounter benchmarks only work in one hour time periods #114

Open Georgea75 opened 3 years ago

Georgea75 commented 3 years ago

LinkCounter benchmarks are limited to only being in hourly time periods.

If you build a benchmark that is at any other time period and run it using a config it produces an error where the results data frame from the link volumes only contain counts for the first 24 time bands. Note that it takes 24 buckets even though the results data frame contains the correct amount of periods. When it tries to compare the supplied benchmark to the results data frame it sees the mismatch and raises an error: if not set(bm_hours) <= set(results_df.columns): raise UserWarning( f"Hours: {bm_hours} not available in results.columns: {results_df.columns}")

The issue seems to come from the following line of code: results_df = results_df[[str(h) for h in range(24)]]

Commenting this out allows you to generate the benchmark ( In my case I built a 15 minute time period benchmark) and the output looks valid. I am not sure of the down stream impacts of commenting this out. Therefore, this issue is more about understanding why this line is in there in the first place and deciding what/if we need to replace it with something.