Mangle
Modify assay CSV files to simulate poor formatting.
mangle_assay(readings_file, raw_file, persons, forced=None)
Mangle a single assay file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
readings_file
|
clean readings file |
required | |
raw_file
|
file to produce |
required | |
persons
|
staff members |
required | |
forced
|
optional list of specified manglings (for testing) |
None
|
Source code in src/snailz/mangle.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
_mangle_id(data, persons)
Convert ID field to string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
values from CSV file |
required | |
persons
|
lab staff |
required |
Returns:
Type | Description |
---|---|
Modified copy of data. |
Source code in src/snailz/mangle.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
_mangle_indent(data, persons)
Indent data portion.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
values from CSV file |
required | |
persons
|
lab staff |
required |
Returns:
Type | Description |
---|---|
Modified copy of data. |
Source code in src/snailz/mangle.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
_mangle_missing(data, persons)
Remove machine name (alters length of header).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
values from CSV file |
required | |
persons
|
lab staff |
required |
Returns:
Type | Description |
---|---|
Modified copy of data. |
Source code in src/snailz/mangle.py
72 73 74 75 76 77 78 79 80 81 82 |
|
_mangle_person(data, persons)
Replace person identifier with name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
values from CSV file |
required | |
persons
|
lab staff |
required |
Returns:
Type | Description |
---|---|
Modified copy of data. |
Source code in src/snailz/mangle.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|