当前位置: 首页>>代码示例>>Python>>正文


Python exceptions.mcdp_dev_warning函数代码示例

本文整理汇总了Python中mocdp.exceptions.mcdp_dev_warning函数的典型用法代码示例。如果您正苦于以下问题:Python mcdp_dev_warning函数的具体用法?Python mcdp_dev_warning怎么用?Python mcdp_dev_warning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mcdp_dev_warning函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: solve_trace

    def solve_trace(self, func, trace):
        if func in self._solve_cache:
            # trace.log('using cache for %s' % str(func))
            return trace.result(self._solve_cache[func])

        trace.values(type='series')

        with trace.child('dp1') as t:
            u1 = self.dp1.solve_trace(func, t)

        if do_extra_checks():
            R1 = self.dp1.get_res_space()
            tr1 = UpperSets(R1)
            tr1.belongs(u1)

        mcdp_dev_warning('rewrite this keeping structure')
        mins = set([])
        for u in u1.minimals:
            with trace.child('dp2') as t:
                v = self.dp2.solve_trace(u, t)
            mins.update(v.minimals)

        R = self.get_res_space()
        minimals = poset_minima(mins, R.leq)

        us = UpperSet(minimals, R)

        self._solve_cache[func] = us
        return trace.result(us)
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:29,代码来源:dp_series.py

示例2: __init__

 def __init__(self, nu):
     R = Rcomp()
     Fs = (R, R)
     self.nl = nu
     mcdp_dev_warning('This is not even true - it is the complicated function')
     amap = ProductNMap(Fs, R)
     WrapAMap.__init__(self, amap, None)
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:7,代码来源:dp_products.py

示例3: __init__

 def __init__(self, fs):
     fs = tuple(fs)
     self.fs = fs
     mcdp_dev_warning('add promotion to SpaceProduct')
     dom = PosetProduct(tuple(fi.get_domain() for fi in fs))
     cod = PosetProduct(tuple(fi.get_codomain() for fi in fs))
     Map.__init__(self, dom=dom, cod=cod)
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:7,代码来源:product_map.py

示例4: plot_upset_R2

def plot_upset_R2(pylab, us, axis, color_shadow,
                  extra_space_shadow=0.05, color_lines='none', markers='r.',
                  marker_params={}):

    points = us.minimals

    xmin, xmax, ymin, ymax = axis
    for p in points:
        if xmin <= p[0] <= xmax and (ymin <= p[1] <= ymax):
            mcdp_dev_warning('This should be smarter')

            # draw a little of them
            if p[0] == xmax:
                axis = enlarge_x(axis, extra_space_shadow)
            if p[1] == ymax:
                axis = enlarge_y(axis, extra_space_shadow)

            plot_cone(pylab, p, axis, color_shadow=color_shadow,
                      color_lines=color_lines)
        else:
            logger.debug('Warning: point %s not in axis %s' % (p, axis))
            
    # cuteness
    if markers is not None:
        for p in points:
            # This is to avoid underflow
            # when using "finfo.tiny"
            eps = finfo.eps
            p = np.maximum(p, eps)
            #print('plot_upset_R2: marker params: %s ' % marker_params)
            pylab.plot(p[0], p[1], markers, clip_on=False, **marker_params)
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:31,代码来源:drawing.py

示例5: eval_lfunction_invmult_ops

def eval_lfunction_invmult_ops(fs, context):
    if len(fs) == 1:
        return fs[0]
    elif len(fs) > 2: 
        mcdp_dev_warning('Maybe this should be smarter?')
        rest = eval_lfunction_invmult_ops(fs[1:], context)
        return eval_lfunction_invmult_ops([fs[0], rest], context) 
    else:   
        assert len(fs) == 2
        Fs = tuple(map(context.get_ftype, fs))
    
        if isinstance(Fs[0], Nat) and isinstance(Fs[1], Nat):
            dp = InvMult2Nat(Nat(), Fs)
        else:
            if isinstance(Fs[0], RcompUnits) and \
               isinstance(Fs[1], RcompUnits):
                R = mult_table(Fs[0], Fs[1])
                dp = InvMult2(R, Fs)
            elif isinstance(Fs[0], Rcomp) and isinstance(Fs[1], Rcomp):
                R = Rcomp()
                dp = InvMult2(R, Fs)
            else:
                msg = 'Could not create invplus for types {}.'.format(Fs)
                raise_desc(DPNotImplementedError, msg, Fs0=Fs[0], Fs1=Fs[1])
                
        return create_operation_lf(context, dp=dp, functions=fs,
                        name_prefix='_invmult', op_prefix='_ops',
                        res_prefix='_result') 
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:28,代码来源:eval_lfunction_imp.py

示例6: invmultU_solve_options

def invmultU_solve_options(F, R, f, n, algo):
    """ Returns a set of points in R that are on the line r1*r2=f. """
    from .dp_inv_mult import InvMult2

    assert algo in [InvMult2.ALGO_UNIFORM, InvMult2.ALGO_VAN_DER_CORPUT]
    if is_top(F, f):
        mcdp_dev_warning('FIXME Need much more thought about this')
        top1 = R[0].get_top()
        top2 = R[1].get_top()
        s = set([(top1, top2)])
        return s

    check_isinstance(f, float)
            
    if f == 0.0:
        return set([(0.0, 0.0)])

    if algo == InvMult2.ALGO_UNIFORM:
        mcdp_dev_warning('TODO: add ALGO as parameter. ')
        ps = samplec(n, f)
    elif algo == InvMult2.ALGO_VAN_DER_CORPUT:
        x1, x2 = generate_exp_van_der_corput_sequence(n=n, C=f)
        ps = zip(x1, x2)
    else: # pragma: no cover
        assert False
    return ps
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:26,代码来源:sequences_invplus.py

示例7: simplify_indices_F

def simplify_indices_F(F, coords):
    # Safety check: Clearly if it's not the identity it cannot be equal to ()
    R = get_R_from_F_coords(F, coords)
    if not (R == F):
        return coords

    # generic test
    i0 = get_id_indices(F)
    # compose
    i0coords = compose_indices(F, i0, coords, list)
    if i0 == i0coords:
        return ()

    if coords == [0] and len(F) == 1:
        return ()
    if coords == [0, 1] and len(F) == 2:
        return ()
    if coords == [0, (1,)] and len(F) == 2:
        return ()
    if coords == [0, 1, 2] and len(F) == 3:
        return ()

    mcdp_dev_warning('need a double check here')
    if coords == [[(0, 0)], [(1, 0)]]:
        return ()

    if coords == [[(0, 0)], [(1, 0), (1, 1)]]:
        return ()

    # [[(0, 1)], [(1, 0), (0, 0)]]
    return coords
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:31,代码来源:dp_series_simplification.py

示例8: eval_lfunction_invplus_ops

def eval_lfunction_invplus_ops(fs, context):
    if len(fs) == 1:
        raise DPInternalError(fs)
    elif len(fs) > 2: # pragma: no cover
        mcdp_dev_warning('Maybe this should be smarter?')    
        rest = eval_lfunction_invplus_ops(fs[1:], context)
        return eval_lfunction_invplus_ops([fs[0], rest], context) 
    else:   
        Fs = map(context.get_ftype, fs)
        R = Fs[0]
    
        if all(isinstance(_, RcompUnits) for _ in Fs):
            tu = get_types_universe()
            if not tu.leq(Fs[1], Fs[0]):
                msg = 'Inconsistent units %s and %s.' % (Fs[1], Fs[0])
                raise_desc(DPSemanticError, msg, Fs0=Fs[0], Fs1=Fs[1])
    
            if not tu.equal(Fs[1], Fs[0]):
                msg = 'This case was not implemented yet. Differing units %s and %s.' % (Fs[1], Fs[0])
                raise_desc(DPNotImplementedError, msg, Fs0=Fs[0], Fs1=Fs[1])
            
            dp = InvPlus2(R, tuple(Fs))            
        elif all(isinstance(_, Rcomp) for _ in Fs):
            dp = InvPlus2(R, tuple(Fs))
        elif all(isinstance(_, Nat) for _ in Fs):
            dp = InvPlus2Nat(R, tuple(Fs))
            
        else: # pragma: no cover
            msg = 'Cannot find operator for these types.'
            raise_desc(DPInternalError, msg, Fs=Fs)
        
        return create_operation_lf(context, dp=dp, functions=fs,
                               name_prefix='_invplus', op_prefix='_',
                                res_prefix='_result') 
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:34,代码来源:eval_lfunction_imp.py

示例9: go_loop2

    def go_loop2(dp, imp):
        if do_imp:
            m0, _f2, _r2 = dp._unpack_m(imp)
        else:
            m0 = _f2 = _r2 = None

        (n1i, n1o) = go(dp.dp1, m0)

        i = gg.newItem('|')
        gg.propertyAppend(i, "shape", "plaintext")
        o = gg.newItem('|')
        gg.propertyAppend(o, "shape", "plaintext")

        l0 = gg.newLink(i, n1i, label=str(dp.dp1.get_fun_space()))
        l1 = gg.newLink(n1o, o, label=str(dp.dp1.get_res_space()))
        gg.propertyAppend(l0, 'arrowhead', 'none')
        gg.propertyAppend(l1, 'arrowhead', 'none')

        loop_label = str(dp.F2)

        mcdp_dev_warning('add option')
#         if False:
#             M = dp.get_imp_space_mod_res()
#             M0 = dp.dp1.get_imp_space_mod_res()
#             loop_label += ' M0: %s' % M0
#             loop_label += ' M: %s' % M
        l = gg.newLink(o, i, label=loop_label)
        gg.propertyAppend(l, "color", "red")
        gg.propertyAppend(l, "headport", "sw")
        gg.propertyAppend(l, "tailport", "s")
        
        gg.propertyAppend(l, 'arrowhead', 'none')

        return (i, o)
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:34,代码来源:dp_graph_flow_imp.py

示例10: gg_deepcopy

def gg_deepcopy(ggraph):
    try:
        return deepcopy(ggraph)
    except Exception as e:
        print traceback.format_exc(e)
        mcdp_dev_warning('Deep copy of gvgen graph failed: happens when in IPython.')
        return ggraph
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:7,代码来源:gg_utils.py

示例11: plot

    def plot(self, pylab, axis, space, value, params={}):
        params0 = dict(color_shadow=[1.0, 0.8, 0.8], markers="k.", markers_params={})
        params0.update(params)

        color_shadow = params0.pop("color_shadow")
        markers = params0.pop("markers")
        markers_params = params0.pop("markers_params")
        if params0:
            raise ValueError(params0)

        self.axis = axis
        self.check_plot_space(space)

        minimals = [self._get_screen_coords(_, axis) for _ in value.minimals]
        print "minimals", minimals
        R2 = PosetProduct((Rcomp(), Rcomp()))
        v = R2.Us(minimals)

        from mcdp_report.generic_report_utils import extra_space_finite

        mcdp_dev_warning("incomplete PlotterUR")
        logger.error("todo: change this to plot a line")
        plot_upset_R2(
            pylab,
            v,
            axis,
            extra_space_shadow=extra_space_finite,
            color_shadow=color_shadow,
            markers=markers,
            marker_params=markers_params,
        )
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:31,代码来源:plotter_ur.py

示例12: check_equal

 def check_equal(self, a, b):
     m1 = a.get_elements()
     m2 = b.get_elements()
     mcdp_dev_warning('#XXX should use S.equal()')
     if not (m1 == m2):  # XXX: should use S.equal()...
         msg = "Not equal"
         raise_desc(NotEqual, msg, elements1=m1, elements2=m2)
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:7,代码来源:multiset.py

示例13: solve_r

 def solve_r(self, r):
     if self.n > 2:
         msg = 'SumNRcompLDP:solve_r: Cannot invert more than two terms.'
         raise_desc(NotImplementedError, msg)
         
     mcdp_dev_warning('not sure')
     options = sample_sum_lowersets(self.R, self.F, r, self.nl)
     return self.F.Ls(options)
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:8,代码来源:dp_sum.py

示例14: make_parallel_n

def make_parallel_n(dps):
    if len(dps) == 2:
        return make_parallel(dps[0], dps[1])

    if len(dps) == 0:
        mcdp_dev_warning('This works but should be a special case.')

    return ParallelN(tuple(dps)) 
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:8,代码来源:dp_parallel_simplification.py

示例15: get_language_css

def get_language_css():
    from mcdp_library.utils.dir_from_package_nam import dir_from_package_name
    mcdp_dev_warning('TODO: remove from mcdp_web')
    package = dir_from_package_name('mcdp_web')
    fn = os.path.join(package, 'static', 'css', 'mcdp_language_highlight.css')
    with open(fn) as f:
        css = f.read()
    return css
开发者ID:AndreaCensi,项目名称:mcdp,代码行数:8,代码来源:html.py


注:本文中的mocdp.exceptions.mcdp_dev_warning函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。