def safe_mkdir(self, d):
        """If a directory doesn't exist, create it.
        If it does exist, print a warning to the logger.
        If it exists as a file, rais a FileExistsError

        :param d: directory path to create
        :type d: str
        """

        if os.path.isfile(d):
            raise FileExistsError(
                "Cannont create directory %s, a file by that name already exists." % d)

        if os.path.isdir(d):
            logger.warning("%s already exists, using existing directory.", d)
            return

        os.makedirs(d)
If a directory doesn't exist, create it.
        If it does exist, print a warning to the logger.
        If it exists as a file, rais a FileExistsError

        :param d: directory path to create
        :type d: str