Convert H_Abstraction/TS_training.py to use new DistanceData class.

Conversion using a scrip to ensure consistency in
the changes.