Beispiel #1
0
    def runtime_options(self):
        if self._jobmenu is None:
            opts = [
                TDLOption(
                    'tile_size',
                    "Tile size, in timeslots", [1, 10, 100],
                    doc=
                    """Input data is normally sliced by time, and processed in chunks of the
                    indicated size. This will also be the effective parameter solution interval
                    (in time), unless you specify a different (smaller) value for the "Solution subinterval (time)" option below.""",
                    more=int,
                    namespace=self),
                TDLOption(
                    'time_step',
                    "Time stepping, in timeslots", [1, 2, 5, 10],
                    doc=
                    """Enter a step size N>1 to only process every Nth timeslot.""",
                    more=int,
                    namespace=self)
            ]
            # add options from parmgroups
            global _all_parmgroups
            self.pg_controllers = []
            other_opts = []
            for pg in _all_parmgroups:
                solvable = pg in self.active_parmgroups
                controller = pg.make_controller(self.label, solvable=solvable)
                if solvable:
                    opts += controller.runtime_options()
                else:
                    other_opts += controller.runtime_options()
                self.pg_controllers.append(controller)
            if other_opts:
                opts.append(
                    TDLMenu("Simultaneously solve for other parameters",
                            *other_opts))

            # add solver control
            self.solver_control = SolverControl(self.label)
            opts.append(
                TDLMenu("Solver options (for the brave)",
                        *self.solver_control.runtime_options()))
            # add solve job
            opts.append(
                TDLJob(self._run_solve_job,
                       self.name or "Run solution",
                       job_id=self.label))
            # now make a runtime menu
            self._jobmenu = TDLMenu(self.name or "Solve for %s" % self.label,
                                    *opts)
        return [self._jobmenu]