Age | Commit message (Collapse) | Author |
|
|
|
non-CaseAttribute headers (before this caused issues if someone was
adding case attributes to a file that already contained some case
attributes)
|
|
Apparently max(string1, string2) in Python gets the strong that is
highest alphabetically, but I'm pretty sure this line was intenteded
to get the header with the most items (which this commit doesn't fully
address; you could still end up with a situation where some case
attributes were removed while others were added, though that should be
rare)
|
|
* gn3/csvcmp.py (get_allowable_sampledata_headers): Delete it.
* tests/unit/test_csvcmp.py: Remove "get_allowable_sampledata_headers" import.
(test_get_allowable_csv_headers): Delete it.
|
|
|
|
* gn3/csvcmp.py (parse_csv_column): New function.
* tests/unit/test_csvcmp.py: Test case for the above.
|
|
* gn3/csvcmp.py: Run "black -l 79 ..."
* tests/unit/db/test_sample_data.py: Ditto.
* tests/unit/test_csvcmp.py: Ditto.
|
|
There was a subtle bug where "csvdiff" generated an error related to
"different column headings" caused something akin to diffing: "a, b \n, ..."
with "a, b\n, ...".
* gn3/csvcmp.py (csv_diff): Clean csv texts before any diffing.
* tests/unit/test_csvcmp.py (test_csv_diff_same_columns): Modify test case to
capture aforementioned bug.
|
|
* gn3/csvcmp.py (clean_csv_text): New function.
* tests/unit/test_csvcmp.py: Import "csv_text".
(test_clean_csv_text): Test case for the above.
|
|
|
|
* gn3/csvcmp.py (extract_invalid_csv_headers): New function.
* tests/unit/test_csvcmp.py: Import "extract_invalid_csv_headers".
(test_extract_invalid_csv_headers_with_some_wrong_headers): Test case for the
above.
|
|
* gn3/csvcmp.py: Import "Any" and "List".
(get_allowable_sampledata_headers): New function.
* tests/unit/test_csvcmp: Import "get_allowable_sampledata_headers".
(test_get_allowable_csv_headers): Test case for the above.
|
|
|
|
|
|
* gn3/csvcmp.py (csv_diff): Use single quotes. There was a change in 6d39c92
that broke this.
|
|
|
|
* gn3/csvcmp.py (fill_csv): Update this function to allow empty lists to be
filled with the default value(set in the args).
* tests/unit/test_csvcmp.py (test_fill_csv): Update test to capture above.
|
|
* gn3/csvcmp.py (extract_strain_name): New function.
* gn3/db/sample_data (delete_sample_data): Use the aforementioned function.
(insert_sample_data): Ditto.
* tests/unit/test_csvcmp: Test cases for above.
|
|
gn3/csvcmp.py (csv_diff): If the diff is empty, don't add an extra key
"Column" to the dictionary.
tests/unit/test_csvcmp (test_csv_diff_only_column_change): Add test-case for
the above.
|
|
Should you try to run `csvdiff` against 2 csv files with either file having a
non-even columns, there will be an error. As such, the csv files need to be
"filled" before running `csvdiff`.
* gn3/csvcmp (csv_diff): For non-even rows in the csv files, fill the csv
rows.
|
|
* gn3/csvcmp.py (fill_csv): Given a csv text with uneven or incomplete fields
whole length are less than width, fill them with a value which defaults to
"x".
* tests/unit/test_csvcmp.py (test_fill_csv): Test cases for the above.
|
|
* gn3/csvcmp.py (remove_insignificant_edits): "all" evaluates all elements and
throws an error if when `abs(float(x) - float(y)) < epsilon` is processed. Use
"and" instead because of it's short-circuiting behaviour.
|
|
When inserting, deleting, or editing case-attributes, we need the column
headers in order to be able to know identify the attribute of interest.
* gn3/csvcmp.py (csv_diff): Add extra "Column" key in returned dict.
|
|
gn3/csvcmp.py: New file
(create_dirs_if_not_exists): From a list of dirs, create them if they don't
exist.
(remove_insignificant_edits): Given a dict with a "Modification" key, remove
edits with "delta < ε".
(csv_diff): Generate a csv_diff using the "csvdiff" tool packaged in guix.
tests/unit/test_csvcmp.py: Add some tests for "gn3/csvcmp.py"
|