The announcement that world No 1 Ash Barty is to retire from professional tennis came as an enormous surprise to most people around the world.