Creating custom decorators in Python 3.6
In the hips package, often data has to be fetched from remote servers, especially HiPS tiles. One way to cut back on the queries was by introducing the hips-extra repository. This contains HiPS tiles from various HiPS surveys. This allows us to quickly fetch tiles from local storage, which makes the testing process less time-consuming.
As hips-extra repository does not come with the standard hips package, user has to manually clone it. The availability of the package is checked using an environment variable. This can be set using:
$export HIPS_EXTRA=\path\to\hips-extra
In Python, the path can be retrieved using the os module: os.environ['HIPS_EXTRA']. Now, what if the user does not have hips-extra repository …