Пример #1
0
    def create(self, args, out=sys.stdout):
        proj = make_local_project()
        expt = make_local_expt(proj)

        # Get the necessary input samples
        parameters_sample = get_parameters_sample(expt, args.parameters_id,
                                                  out)

        proc = create_simulation_sample(expt, parameters_sample, verbose=True)
        out.write('Created process: ' + proc.name + ' ' + proc.id + '\n')
Пример #2
0
    def create(self, args, out=sys.stdout):
        proj = make_local_project()
        expt = make_local_expt(proj)

        if args.proc_name is None:
            proc_name = None
        else:
            proc_name = " ".join(args.proc_name)

        if args.samp_name is None:
            samp_name = None
        else:
            samp_name = " ".join(args.samp_name)

        proc = create_software_sample(expt,
                                      args,
                                      proc_name,
                                      samp_name,
                                      verbose=True)
        out.write('Created process: ' + proc.name + ' ' + proc.id + '\n')
    def create(self, parser):
        out = sys.stdout

        proj = make_local_project()
        expt = make_local_expt(proj)

        sample_list = []

        proc = prismscpfe_mcapi.numerical_parameters.create_parameters_sample(
            expt, verbose=True)
        out.write('Created process: ' + proc.name + ' ' + proc.id + '\n')
        sample_list.extend(proc.output_samples)

        proc = prismscpfe_mcapi.GrainID.create_GrainID_sample(expt,
                                                              verbose=True)
        out.write('Created process: ' + proc.name + ' ' + proc.id + '\n')
        sample_list.extend(proc.output_samples)

        proc = prismscpfe_mcapi.Orientations.create_Orientations_sample(
            expt, verbose=True)
        out.write('Created process: ' + proc.name + ' ' + proc.id + '\n')
        sample_list.extend(proc.output_samples)
Пример #4
0
    def create(self, args, out=sys.stdout):
        proj = make_local_project()
        expt = make_local_expt(proj)

        # Get the necessary input samples

        sample_list = []
        for sample_id in args.input_sample_ids:
            sample_found = False
            for proc in expt.get_all_processes():
                for sample in proc.get_all_samples():
                    if sample.id == sample_id:
                        # print("Sample found with id of: ", sample.id)
                        matching_sample = sample
                        sample_found = True
                        break
                if sample_found:
                    break
            sample_list.append(matching_sample)

        # parameters_sample = get_parameters_sample(expt, args.input_sample_ids[0], out)

        proc = create_simulation_sample(expt, sample_list, verbose=True)
        out.write('Created process: ' + proc.name + ' ' + proc.id + '\n')
Пример #5
0
 def create(self, args, out=sys.stdout):
     proj = make_local_project()
     expt = make_local_expt(proj)
     proc = create_parameters_sample(expt, verbose=True)
     out.write('Created process: ' + proc.name + ' ' + proc.id + '\n')
Пример #6
0
    def create(self, args, out=sys.stdout):
        proj = make_local_project()
        expt = make_local_expt(proj)

        # Get the necessary input samples
        sample_list = []

        if args.full_simulation:
            print("Creating input samples/processes for the simulation....")

            proc = prismspf_mcapi.numerical_parameters.create_parameters_sample(expt, args, verbose=True)
            out.write('Created process: ' + proc.name + ' ' + proc.id + '\n')
            sample_list.extend(proc.output_samples)

            proc = prismspf_mcapi.model_parameters.create_parameters_sample(expt, args, verbose=True)
            out.write('Created process: ' + proc.name + ' ' + proc.id + '\n')
            sample_list.extend(proc.output_samples)

            proc = prismspf_mcapi.environment.create_environment_sample(expt, args, verbose=True)
            out.write('Created process: ' + proc.name + ' ' + proc.id + '\n')
            sample_list.extend(proc.output_samples)

            proc_list = prismspf_mcapi.equations.create_equations_sample(expt, args, verbose=True)
            for p in proc_list:
                out.write('Created process: ' + p.name + ' ' + p.id + '\n')
                sample_list.extend(p.output_samples)

            proc = prismspf_mcapi.software.create_software_sample(expt, args, verbose=True)
            out.write('Created process: ' + proc.name + ' ' + proc.id + '\n')
            sample_list.extend(proc.output_samples)

            out.write('List of samples created as inputs for the simulation sample:\n')
            for s in sample_list:
                out.write(s.name + ' ' + s.id + '\n')
            out.write('\n')

        else:
            for sample_id in args.input_sample_ids:
                sample_found = False
                for proc in expt.get_all_processes():
                    for sample in proc.get_all_samples():
                        if sample.id == sample_id:
                            # print("Sample found with id of: ", sample.id)
                            matching_sample = sample
                            sample_found = True
                            break
                    if sample_found:
                        break
                sample_list.append(matching_sample)

        # parameters_sample = get_parameters_sample(expt, args.input_sample_ids[0], out)

        if args.proc_name is None:
            proc_name = None
        else:
            proc_name = " ".join(args.proc_name)

        if args.samp_name is None:
            samp_name = None
        else:
            samp_name = " ".join(args.samp_name)

        proc = create_simulation_sample(expt, args, sample_list, proc_name, samp_name, verbose=True)
        out.write('Created process: ' + proc.name + ' ' + proc.id + '\n')