'Compute a unique results subdirectory based on the given name.
Appends base_subdirectory_name with a number as necessary to find a
directory name that doesn\'t already exist.'

def _unique_subdirectory(self, base_subdirectory_name):

    subdirectory = base_subdirectory_name
    counter = 1
    while os.path.exists(os.path.join(self.resultdir, subdirectory)):
        subdirectory = ((base_subdirectory_name + '.') + str(counter))
        counter += 1
    return subdirectory
