def setUp(self):
     set_io_objects(D=MyDomain)
     self.SKIP = False
     try:
         import matplotlib.pyplot
     except ImportError:
         self.SKIP = True
Exemplo n.º 2
0
def read_pil_line(*args, **kwargs):
    set_io_objects(D=PepperDomain,
                   S=PepperStrand,
                   C=PepperComplex,
                   R=PepperReaction,
                   M=PepperMacrostate)
    out = dsd_read_pil_line(*args, **kwargs)
    clear_io_objects()
    return out
def load_pil(data, is_file=False):
    """ Parses a string or file written in PIL notation! """
    # We only assign reactions in a postprocessing step,
    # because there are no macrostates in nuskell.
    set_io_objects(D=NuskellDomain, C=NuskellComplex)
    out = dsd_read_pil(data, is_file)
    clear_io_objects()

    cxs = {k: v for k, v in out['complexes'].items()}
    rms = {k: v for k, v in out['macrostates'].items()}
    det = set(list(out['det_reactions']))
    con = set(list(out['con_reactions']))
    [o.clear() for o in out.values()]
    out.clear()
    return cxs, rms, det, con
Exemplo n.º 4
0
def read_pil(data, is_file=False, ignore=None):
    set_io_objects(D=PepperDomain,
                   S=PepperStrand,
                   C=PepperComplex,
                   R=PepperReaction,
                   M=PepperMacrostate)
    out = dsd_read_pil(data, is_file, ignore)
    clear_io_objects()

    if len(out['con_reactions']):
        log.warning('Ignoring condensed reaction input.')
    if len(out['macrostates']):
        log.warning('Ignoring complex macrostate input.')

    # Make sure that strands are not within initial complexes!
    for strand in out['strands'].values():
        strand.concentration = ('constant', 0, 'M')
        out['complexes'][('s', strand.name)] = strand
    out['domains'].clear()
    return out['complexes'], out['det_reactions']
 def setUp(self):
     set_io_objects()
 def setUp(self):
     set_io_objects(D=MyDomain)