Ejemplo n.º 1
0
    def test_combinations(self, params):
        """Do testing"""

        network_maker_name = NETWORK_NAME
        config = params['config']
        dataset_loader_name = params['dataset_loader_name']

        network_maker = load_network_maker(network_maker_name)
        network_maker.configure(config)

        self.source_files = network_maker.generate(**config)

        self.check_scripts()
        self.check_src(dataset_loader_name, config)
        self.check_train_eval_readme(config['dataset'], config['loss'], config['optimizer'])
Ejemplo n.º 2
0
    def run(self, args):
        """Override run method to start."""
        project_name = args.get('name')
        try:
            self._check_project_dir(project_name)
        except CommandError as error:
            click.secho(error.message, fg='red')
            sys.exit(1)
        try:
            self.echo_notice()
            network_maker_name = self.ask_network()
            network_maker = load_network_maker(network_maker_name)
            network_maker.configure()
        except click.exceptions.Abort:
            sys.exit(1)

        project_dir = self._make_project_dir(project_name)
        source_files = network_maker.generate(**args)
        for source_file in source_files:
            source_file.write(project_dir)

        click.secho(f"{project_name} is generated in {project_dir}")
Ejemplo n.º 3
0
    def test_combinations(self, params):
        """Do testing."""

        network_maker_name = NETWORK_NAME
        config = params['config']
        dataset_loader_name = params['dataset_loader_name']

        network_maker = load_network_maker(network_maker_name)
        network_maker.configure(config)

        source_files = network_maker.generate(**config)

        self.output_dir = os.path.realpath('test_folder')
        for source_file in source_files:
            source_file.write(self.output_dir)

        try:
            self.check_scripts()
            self.check_src(dataset_loader_name, config)
            self.check_train_eval_readme(config['dataset'], config['loss'],
                                         config['optimizer'])
        finally:
            shutil.rmtree(self.output_dir)