arup-group / elara

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

Mode confusion #194

Closed andkay closed 2 years ago

andkay commented 2 years ago

This PR adds a mode comparison input/output benchmark.

The scoring is set to be {'pct': percent_of_input_modes_unchanged}.

Fred and I have discussed moving all of these to their own module, which I'm generally in support of, but wanted to sneak these changes in before @mfitz executes the BFG.

Will add docs later.

andkay commented 2 years ago

I was a bit fast on the button. The outputs of this handlers include three tables:

  1. longform data table with agent, seq, prev_mode, new_mode
  2. confusion matrix with counts
  3. confusion matrix with percents (row-wise)

At the moment, the tests are limited and built on very simplistic fixtures. These return a StringsIO buffer that can be passed to the pandas.read_csv method safely rather than a filepath. Where it makes sense, I'd propose replicating this pattern in future to improve test readability,