def _new_autoplot_editor(self, new):
        from pychron.pipeline.plot.editors.figure_editor import FigureEditor

        for editor in self.editor_area.editors:
            if isinstance(editor, FigureEditor):
                if new.identifier == editor.identifier:
                    break
        else:
            if is_special(new.identifier):
                from pychron.pipeline.plot.editors.series_editor import SeriesEditor

                editor = SeriesEditor()
            elif new.step:
                from pychron.pipeline.plot.editors.spectrum_editor import SpectrumEditor

                editor = SpectrumEditor()
            else:
                from pychron.pipeline.plot.editors.ideogram_editor import IdeogramEditor

                editor = IdeogramEditor()

            editor.identifier = new.identifier

        editor.last_update = time.time()
        return editor
示例#2
0
    def _new_autoplot_editor(self, new):
        from pychron.pipeline.plot.editors.figure_editor import FigureEditor

        for editor in self.editor_area.editors:
            if isinstance(editor, FigureEditor):
                if new.identifier == editor.identifier:
                    break
        else:
            if is_special(new.identifier):
                from pychron.pipeline.plot.editors.series_editor import SeriesEditor

                editor = SeriesEditor()
            elif new.step:
                from pychron.pipeline.plot.editors.spectrum_editor import SpectrumEditor

                editor = SpectrumEditor()
            else:
                from pychron.pipeline.plot.editors.ideogram_editor import IdeogramEditor

                editor = IdeogramEditor()

            editor.identifier = new.identifier

        editor.last_update = time.time()
        return editor
示例#3
0
    def retroactive_repository_identifiers(self, spec):
        # print '{} added to {}'.format(spec.experiment_id, spec.runid)
        self.cruns, self.expid = retroactive_repository_identifiers(spec, self.cruns, self.expid)

        self.associate(spec.repository_identifier, spec.runid)
        if not is_special(spec.identifier) and self.cruns:
            for c in self.cruns:
                # print 'add {} {} {}'.format(self.expid, c.experiment_id, c.runid)
                self.associate(self.expid, c.runid)
            self.cruns = []
示例#4
0
def renumber_aliquots(aruns):
    akey = attrgetter('user_defined_aliquot')

    for ln, ans in groupby_key(aruns, 'labnumber'):
        if is_special(ln):
            continue

        b, a = partition(ans, akey)
        b = list(b)
        if b:
            minaliquot = min([bi.user_defined_aliquot for bi in b])
            for i, (al, ans) in enumerate(groupby(b, key=akey)):
                for ai in ans:
                    ai.user_defined_aliquot = minaliquot + i
示例#5
0
def renumber_aliquots(aruns):
    key = lambda x: x.labnumber
    akey = lambda x: x.user_defined_aliquot

    aruns = sorted(aruns, key=key)
    for ln, ans in groupby(aruns, key=key):
        if is_special(ln):
            continue

        b, a = partition(ans, akey)
        b = list(b)
        if b:
            minaliquot = min([bi.user_defined_aliquot for bi in b])
            for i, (al, ans) in enumerate(groupby(b, key=akey)):
                for ai in ans:
                    ai.user_defined_aliquot = minaliquot + i
示例#6
0
def retroactive_repository_identifiers(spec, cruns, active_respository_identifier):
    if cruns is None:
        cruns = []

    if is_special(spec.identifier):
        cruns.append(spec)
        if active_respository_identifier:
            spec.repository_identifier = active_respository_identifier
    else:
        exp_id = spec.repository_identifier
        # if cruns:
        #     for c in self._cached_runs:
        #         self.datahub.maintstore.add_experiment_association(c, exp_id)
        #     self._cached_runs = []
        active_respository_identifier = exp_id

    return cruns, active_respository_identifier
def retroactive_repository_identifiers(spec, cruns,
                                       active_respository_identifier):
    if cruns is None:
        cruns = []

    if is_special(spec.identifier):
        cruns.append(spec)
        if active_respository_identifier:
            spec.repository_identifier = active_respository_identifier
    else:
        exp_id = spec.repository_identifier
        # if cruns:
        #     for c in self._cached_runs:
        #         self.datahub.maintstore.add_experiment_association(c, exp_id)
        #     self._cached_runs = []
        active_respository_identifier = exp_id

    return cruns, active_respository_identifier
示例#8
0
文件: spec.py 项目: NMGRL/pychron
 def is_special(self):
     return is_special(self.labnumber)
示例#9
0
 def is_special(self):
     return is_special(self.labnumber)