Reformat code
Add automatic unit conversion to set_spatial() method
Adjust code following conventions