modelica-tools / csv-compare

Tool to compare curves from one csv files with curves from other csv files using an adjustable tolerance
https://www.modelica.org
BSD 3-Clause "New" or "Revised" License
26 stars 15 forks source link

Missing variables are not always skipped #17

Open ghost opened 9 years ago

ghost commented 9 years ago

CSV Compare does not skip variables which aren't present in both csv files in some cases. For example the following base.csv:

time;a;b;c
0;1;2;3
1;2;3;4
2;3;4;5
3;4;5;6
4;5;6;7

and actual.csv:

time;a;x;c
0;1;0;3
1;2;0;4
2;3;0;5
3;4;0;6
4;5;0;7

Note that b exists in base.csv but not in actual.csv, and x is missing from base.csv but exists in actual.csv. In the generated report the variable b is listed with a 100% success rate. This is a rather severe bug since the user get the impression that everything is fine and the variable produces the correct result! It does however leave a warning in the log, saying that b has been skipped (which it apparently haven't). Log:

2015-07-07Z13:16:51 [     Warning ] b not found in "actual.csv", skipping checks.

Command used:

Compare.exe actual.csv base.csv -r out

Version:

CSV File Comparison Tool v2.0.0-rel
Copyright ? 2015 ITI GmbH
ghost commented 9 years ago

Even worse, there doesn't even need to be another variable in the actual.csv file, i.e.:

time;a;c
0;1;3
1;2;4
2;3;5
3;4;6
4;5;7

Lists variable b as 100%.

tbeu commented 8 years ago

What is the expected behavior? Should actual.b always fail or simply be ignored?

jonsten commented 8 years ago

I would expect it to be a failure since the actual result isn't like the expected/base result.

tbeu commented 8 years ago

Can you please check if 9c0a0aa fixes the problem as you would expect! Thanks.

jonsten commented 8 years ago

Unfortunately I currently haven't any software setup for compiling csv-compare on my own but looking from the changeset it looks correct, you changed the warning into an error and also changed the graph. But I can't say for sure until the above tests has been tried.

Thanks!

tbeu commented 6 years ago

@jonsten Can you please check if 209c607641b8dfb311bba75234328363bafa3898 fixes the problem as you would expect! Thanks.

jonsten commented 6 years ago

@tbeu, unfortunately I'm no longer working with this product/project as I've left the company that was using this product... @JohanYli as far as I know you are still interested in this, care to take a look or forward to those that needed this?