TravelMapping / DataProcessing

Data Processing Scripts and Programs for Travel Mapping Project
4 stars 6 forks source link

System abbreviation error output #621

Closed michihdeu closed 6 months ago

michihdeu commented 7 months ago

the errors given when two lines in systems.csv have the same system abbreviation are not very helpful at diagnosing the problem

https://github.com/TravelMapping/RailwayData/pull/140#issue-2257045450 by @neroute2

yakra commented 7 months ago

Tried it out for myself and I see what you mean. :grimacing:

The solution is easy enough, just use an unordered_set to make sure system codes are unique when reading systems.csv. Though if I'm doing that, may as well make a static unordered_map member of the HighwaySystem class, similar to Region::code_hash. That will help clean up the routines that parse systemgraphs.csv, multisystem.csv & fullcustom.csv, thus tying in with #614, but I don't expect it to get much use other than that.

Similar stuff we could also do (though is it worth the bother?):

yakra commented 7 months ago

Upcoming pull request will check for duplicate system abbreviations and report those, rather than the flood of unhelpful error messages @neroute2 noted.

It will not add either of the other checks I considered above.