fix: grade columns in deterministic ordering #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As mentioned in #5, currently parsing the csv files results in non-deterministic ordering in grade columns.
By sorting the data across multiple runs of
ut_grade_parser parse
, it's clear that all the data is always there, however, the column order is randomized.The random column ordering only seems to happen on the grade columns (A, A-, B+, B, B-, ..., D+, D, D-, F, Other)
The reason for this was that inserting the grade columns was just a loop over a HashMap, relying on it for the ordering. The problem with that is that HashMaps have arbitrary ordering. Switching to a BTreeSet wouldn't help here, since that sorts based on UTF-8 ordering, not insertion order.
fixes #5, unblocks Longhorn-Developers/UT-Registration-Plus#163