Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(99)  |  Call(60)  |  Derive(0)  |  Import(39)

src/9/m/9ML-0.1.0/nineml/utility/__init__.py   9ML(Download)
 
from nineml.exceptions import internal_error, raise_exception
from nineml.exceptions import NineMLRuntimeError
 
 
            raise error_func
        elif isinstance(error_func, basestring):
            raise NineMLRuntimeError(error_func)
        else:
            error_func()
            raise default_error
        elif isinstance(default_error, basestring):
            raise NineMLRuntimeError(default_error)
        else:
            default_error()
 
    if not _is_iterable(lst):
        raise NineMLRuntimeError('Object not iterable')
    if issubclass(lst.__class__, (dict)):
        err = "Dictionary passed to expect_single. This could be ambiguous"
        err +="\nIf this is what you intended, please explicity pass '.keys' "
        raise NineMLRuntimeError(err)

src/9/m/9ML-0.1.0/nineml/abstraction_layer/validators/cv_general.py   9ML(Download)
import nineml
 
from nineml.exceptions import NineMLRuntimeError
#from nineml.abstraction_layer.component.namespaceaddress import NamespaceAddress
#from nineml.abstraction_layer import math_namespace
                if not td in self.sv_declared[namespace]:
                    err = 'StateVariable not declared: %s'%td
                    raise nineml.exceptions.NineMLRuntimeError(err)
 
 
                if not td in self.sv_declared[namespace]:
                    err = 'Not Assigning to state-variable: %s'%state_assignment
                    raise nineml.exceptions.NineMLRuntimeError(err)
 
    def action_statevariable(self, state_variable, namespace, **kwargs):
                errmsg += "You may have a recursion issue."
                errmsg += "Remaining Aliases: %s"%  ','.join(unresolved_aliases.keys()) 
                raise nineml.exceptions.NineMLRuntimeError(errmsg)
 
 
                    if not rhs_atom in self.available_symbols[ns]:
                        err = 'Unresolved Symbol in Alias: %s [%s]'%(rhs_atom, alias)                
                        raise nineml.exceptions.NineMLRuntimeError(err)                
 
        #Check TimeDerivatives:

src/9/m/9ML-0.1.0/nineml/abstraction_layer/component/component.py   9ML(Download)
"""
 
from nineml.exceptions import NineMLRuntimeError
from namespaceaddress import NamespaceAddress
import componentqueryer
            err = "Attempted to lookup node: %s\n" % local_namespace_ref
            err +="Doesn't exist in this namespace: %s" % self.subnodes.keys() 
            raise NineMLRuntimeError(err)
 
        subnode = self.subnodes[local_namespace_ref]
        if not isinstance( namespace, basestring):
            err = 'Invalid namespace: %s' % type(subnode)
            raise NineMLRuntimeError(err)
 
        if not isinstance( subnode, ComponentClass):
            err =  'Attempting to insert invalid '
            err += 'object as subcomponent: %s' % type(subnode)
            raise NineMLRuntimeError(err)
        if namespace in self.subnodes:
            err = 'Key already exists in namespace: %s' % namespace
            raise NineMLRuntimeError(err)
        from nineml.abstraction_layer.visitors.cloner import ClonerVisitor
        self.subnodes[namespace] = ClonerVisitor().visit( subnode )

src/9/m/9ML-0.1.0/nineml/abstraction_layer/component/ports.py   9ML(Download)
            err = ("%s('%s')"+ "specified undefined mode: '%s'") %\
                  (self.__class__.__name__, self.name, mode)
            raise nineml.exceptions.NineMLRuntimeError(err)
 
        if mode == 'reduce':
            if reduce_op not in Port._reduce_op_map.keys():
                err = ("%s('%s')"+ "specified undefined reduce_op: '%s'") %\
                      (self.__class__.__name__, name, str(reduce_op))
                raise nineml.exceptions.NineMLRuntimeError(err)
        if reduce_op and mode != "reduce":
            err = "Port of mode!=reduce may not specify 'op'."
            raise nineml.exceptions.NineMLRuntimeError(err)
 
 

src/9/m/9ML-0.1.0/nineml/abstraction_layer/component/dynamics.py   9ML(Download)
 
import nineml.utility
from nineml.exceptions import NineMLRuntimeError
 
 
        if self._source_regime:
            err = "Should not be called by users.Use source_regime.name instead"
            raise NineMLRuntimeError(err)
        assert self._source_regime_name
        return self._source_regime_name
            if not arg in valid_kwargs:
                err = 'Unexpected Arg: %s'%arg
                raise NineMLRuntimeError(err)
 
        transitions=kwargs.get('transitions',None)
        if not isinstance(on_event, OnEvent):
            err = "Expected 'OnEvent' Obj, but got %s"%(type(on_event))
            raise NineMLRuntimeError(err)
 
        self._resolve_references_on_transition(on_event)
        if not isinstance(on_condition, OnCondition):
            err = "Expected 'OnCondition' Obj, but got %s"%(type(on_condition))
            raise NineMLRuntimeError(err)
        self._resolve_references_on_transition(on_condition)
        self._on_conditions.append( on_condition )

src/9/m/9ML-0.1.0/nineml/abstraction_layer/flattening/flattening.py   9ML(Download)
 
            if regime_index in self.changed_regime_indices:
                raise nineml.exceptions.NineMLRuntimeError('Something has gone wrong with event resolution. Changing Regime Twice!')
            self.changed_regime_indices.add(regime_index)
 
                err += '\nNamespaces: %s' % ','.join([str(ns) for ns in  ns_regimename.keys()])
                err += '\nSpecified String: %s'% old_regime_string
                raise nineml.exceptions.NineMLRuntimeError(err)
            target_regime_name = ns_regimename[comp_ns]
 
            regime_map = dict( [ (r.name, r) for r in c.regimes] )
            if not target_regime_name in regime_map:
                err =  'Namespace has no regime named: %s'
                err += '\nRegimes: %s' % (str(regime_map.keys()))
                raise nineml.exceptions.NineMLRuntimeError(err)

src/9/m/9ML-0.1.0/nineml/abstraction_layer/component/util.py   9ML(Download)
 
import re
from nineml.exceptions import NineMLRuntimeError
import nineml
 
        if not cls.is_alias(alias_string):
            errmsg = "Invalid Alias: %s" % alias_string
            raise NineMLRuntimeError(errmsg)
 
        lhs, rhs = alias_string.split(':=')
        if not match:
            err = "Unable to load time derivative: %s" % time_derivative_string
            raise NineMLRuntimeError(err)
        dependent_variable =  match.groupdict()['dependent_var']
        rhs = match.groupdict()['rhs'] 

src/9/m/9ML-0.1.0/nineml/abstraction_layer/component/expressions.py   9ML(Download)
 
#import math_namespace
from nineml.exceptions import NineMLRuntimeError
import util
 
        if not util.MathUtil.is_single_symbol( lhs ):
            err = 'Expecting a single symbol on the LHS; got: %s' % lhs
            raise NineMLRuntimeError(err)
        if not nineml.maths.is_valid_lhs_target(lhs):
            err = 'Invalid LHS target: %s'%lhs
            raise NineMLRuntimeError(err)

src/9/m/9ML-0.1.0/nineml/abstraction_layer/component/namespaceaddress.py   9ML(Download)
        if self.is_root_namespace():
            err = "Can't call get_parent_addr() on root namespace"
            raise nineml.exceptions.NineMLRuntimeError(err)
 
        return NamespaceAddress( loc = tuple(self.loctuple[:-1]) )
        if self.is_root_namespace():
            err = "Can't call get_local_name() on root namespace"
            raise nineml.exceptions.NineMLRuntimeError(err)
        return self.loctuple[-1]
 

src/9/m/9ML-0.1.0/nineml/abstraction_layer/readers/xml_reader.py   9ML(Download)
                    err = "Unexpected Block tag: %s "%tag
                    err += '\n Expected: %s'%','.join(blocks)
                    raise nineml.exceptions.NineMLRuntimeError(err)
 
            res[tag].append( XMLLoader.tag_to_loader[tag](self,t) ) 

  1 | 2  Next