Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 798 Bytes

File metadata and controls

42 lines (30 loc) · 798 Bytes

Data mirroring

Create copy from saved file.

csv_copy = File.from_file('example.csv', 1000)

Check distance of the last object in copy and defect orientation.

assert csv_copy.total_length == 12000
assert len(csv_copy.data) == 6

defect_row = csv_copy.data[4]
assert defect_row.is_defect
assert defect_row.orient_td == '4,00'
assert defect_row.orient_bd == '5,00'

Reverse copy.

csv_copy.reverse()

Relative position of defekt must change and defect orientation must be mirrored.

defect_row = csv_copy.data[3]
assert defect_row.is_defect

assert defect_row.orient_td == '7,00'
assert defect_row.orient_bd == '8,00'

Save reversed copy to file.

csv_file.to_file('reversed.csv')
assert os.path.getsize('reversed.csv') > 0