Exemplo n.º 1
0
    def make_report(self, ddict):
        """Create the difference report.

        Parameters
        ----------
        ddict : dict
            The set of changed and default information.
        """
        headings = collections.defaultdict(list)
        for name in ddict.keys():
            if "/" in name:
                h1, h2 = name.split('/')
                headings[h1].append(h2)
            else:
                headings[name]

        self.report = []
        self._make_css()

        for heading, sub_headings in headings.iteritems():
            self._make_heading(title(heading) if heading.islower() else heading)
            if len(sub_headings) == 0:
                self._make_table(ddict[heading])
            else:
                for sub_heading in sub_headings:
                    self._make_heading(title(sub_heading), 2)
                    self._make_table(ddict[heading + "/" + sub_heading])

        final_report = os.linesep.join(self.report)
        self.report_text.setHtml(final_report)
Exemplo n.º 2
0
    def make_report(self, ddict):
        """Create the difference report.

        Parameters
        ----------
        ddict : dict
            The set of changed and default information.
        """
        headings = collections.defaultdict(list)
        for name in ddict:
            if "/" in name:
                h1, h2 = name.split('/')
                headings[h1].append(h2)
            else:
                headings[name]

        self.report = []
        self._make_css()

        for heading, sub_headings in headings.items():
            self._make_heading(
                title(heading) if heading.islower() else heading)
            if len(sub_headings) == 0:
                self._make_table(ddict[heading])
            else:
                for sub_heading in sub_headings:
                    self._make_heading(title(sub_heading), 2)
                    self._make_table(ddict[heading + "/" + sub_heading])

        final_report = os.linesep.join(self.report)
        self.report_text.setHtml(final_report)
Exemplo n.º 3
0
 def __init__(self):
     """Initialize the class.
     """
     self.tab_order = ["survey", "science", "observatory", "observing_site",
                       "scheduler_driver", "environment", "downtime"]
     for tab in self.tab_order:
         setattr(self, tab + "_controller",
                 getattr(lsst.sims.opsim4.controller, title(tab, spacer="") + "Controller")(tab))
Exemplo n.º 4
0
 def __init__(self):
     """Initialize the class.
     """
     self.tab_order = ["survey", "science", "observatory", "observing_site",
                       "scheduler_driver", "environment", "downtime"]
     for tab in self.tab_order:
         setattr(self, tab + "_controller",
                 getattr(lsst.sims.opsim4.controller, title(tab, spacer="") + "Controller")(tab))
    def create_tabs(self, params):
        """Create the individual proposal tabs.

        Parameters
        ----------
        params : dict(str: params)
            Set of configuration information.
        """
        module = importlib.import_module("lsst.sims.opsim4.widgets")
        for name in params:
            obs_widget = getattr(module, self.tab_mapping[name])
            tab = obs_widget(name)
            self.addTab(tab, title(name))
    def create_tabs(self, params):
        """Create the individual proposal tabs.

        Parameters
        ----------
        params : dict(str: params)
            Set of configuration information.
        """
        module = importlib.import_module("lsst.sims.opsim4.widgets")
        for name in params:
            obs_widget = getattr(module, self.tab_mapping[name])
            tab = obs_widget(name)
            self.addTab(tab, title(name))
Exemplo n.º 7
0
 def create_tabs(self):
     """Create all the configuration tabs.
     """
     tab_dict = self.main_controller.get_tabs()
     for key, tab in tab_dict.items():
         self.tab_widget.addTab(tab, title(key))
Exemplo n.º 8
0
 def create_tabs(self):
     """Create all the configuration tabs.
     """
     tab_dict = self.main_controller.get_tabs()
     for key, tab in tab_dict.items():
         self.tab_widget.addTab(tab, title(key))