Perform the initial setup for the project

        Parameters
        ----------
        root_dir: str
            The path to the root directory where the experiments, etc. will
            be stored
        projectname: str
            The name of the project that shall be initialized at `root_dir`. A
            new directory will be created namely
            ``root_dir + '/' + projectname``
        link: bool
            If set, the source files are linked to the original ones instead
            of copied

        Other Parameters
        ----------------
        ``**kwargs``
            Are passed to the :meth:`app_main` method

def setup(self, root_dir, projectname=None, link=False, **kwargs):
        """
        Perform the initial setup for the project

        Parameters
        ----------
        root_dir: str
            The path to the root directory where the experiments, etc. will
            be stored
        projectname: str
            The name of the project that shall be initialized at `root_dir`. A
            new directory will be created namely
            ``root_dir + '/' + projectname``
        link: bool
            If set, the source files are linked to the original ones instead
            of copied

        Other Parameters
        ----------------
        ``**kwargs``
            Are passed to the :meth:`app_main` method
        """
        projects = self.config.projects
        if not projects and projectname is None:
            projectname = self.name + '0'
        elif projectname is None:  # try to increment a number in the last used
            try:
                projectname = utils.get_next_name(self.projectname)
            except ValueError:
                raise ValueError(
                    "Could not estimate a project name! Please use the "
                    "projectname argument to provide a project name.")
        self.app_main(**kwargs)
        root_dir = osp.abspath(osp.join(root_dir, projectname))
        projects[projectname] = OrderedDict([
            ('name', projectname), ('root', root_dir),
            ('timestamps', OrderedDict())])
        data_dir = self.config.global_config.get(
            'data', osp.join(root_dir, 'data'))
        projects[projectname]['data'] = data_dir
        self.projectname = projectname
        self.logger.info("Initializing project %s", projectname)
        self.logger.debug("    Creating root directory %s", root_dir)
        if not osp.exists(root_dir):
            os.makedirs(root_dir)
        return root_dir