Пример #1
0
 def check_all_validated(self):
     '''
     Checks that all preferences that have been set have been validated.
     
     Logs a warning if not. Should be called by `Network.run` or other
     key angela functions.
     '''
     if len(self.prefs_unvalidated):
         from angela2.utils.logger import get_logger
         logger = get_logger(__name__)
         logger.warn("The following preferences values have been set but "
                     "are not registered preferences:\n%s\nThis is usually "
                     "because of a spelling mistake or missing library "
                     "import." % ', '.join(self.prefs_unvalidated),
                     once=True)
Пример #2
0
    raise ImportError("angela2.hears is deprecated and will be removed in a future release, please use the angela2hears "                        
                      "package available at https://angela2hears.readthedocs.io/. If you really want to keep "
                      "using it, note: angela2.hears is a bridge between angela 2 and the version of angela Hears from "
                      "angela 1, you need to have angela 1 installed to use it.")

from angela2.core.clocks import Clock
from angela2.core.operations import network_operation
from angela2.groups.neurongroup import NeuronGroup
from angela2.utils.logger import get_logger
from angela2.units.fundamentalunits import Quantity
from angela2.units import second

from numpy import asarray, array, ndarray
from inspect import isclass, ismethod

logger = get_logger(__name__)

logger.warn("angela2.hears is deprecated and will be removed in a future release, please use the angela2hears "                        
            "package available at https://angela2hears.readthedocs.io/. If you really want to keep using it, note "
            "that it is a bridge between angela 2 and angela Hears from angela 1. "
            "This is not guaranteed to work in all cases that angela.hears works. "
            "See the limitations in the online documentation.")

def convert_unit_b1_to_b2(val):
    return Quantity.with_dimensions(float(val), arg.dim._dims)

def convert_unit_b2_to_b1(val):
    return b1.Quantity.with_dimensions(float(val), arg.dim._dims)


def modify_arg(arg):