81ac05cfd756e6c43261660b5c6bfb44703ebe36,brian2/stateupdaters/base.py,StateUpdateMethod,determine_stateupdater,#Any#Any#Any#,111

Before Change


            method = method.lower()  // normalize name to lower case
            stateupdater = None
            for name, registered_stateupdater in StateUpdateMethod.stateupdaters:
                if name == method:
                    stateupdater = registered_stateupdater
                    break
            if stateupdater is None:
                raise ValueError("No state updater with the name "%s" "
                                 "is known" % method)
            if not stateupdater.can_integrate(equations, variables):

After Change


            return stateupdater
        elif isinstance(method, collections.Iterable):
            for name in method:
                if name not in StateUpdateMethod.stateupdaters:
                    logger.warn("No state updater with the name "%s" "
                                "is known" % name, "unkown_stateupdater")
                else:
                    stateupdater = StateUpdateMethod.stateupdaters[name]
                    try:
                        if stateupdater.can_integrate(equations, variables):
                            logger.info("Using stateupdater "%s"" % name)
                            return stateupdater
                    except KeyError:
                        logger.debug(("It could not be determined whether state "
                                      "updater "%s" is able to integrate the equations, "
                                      "it appears the namespace is not yet complete."
                                      % name))

            raise ValueError(("No stateupdater that is suitable for the given "
                              "equations has been found"))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: brian-team/brian2
Commit Name: 81ac05cfd756e6c43261660b5c6bfb44703ebe36
Time: 2015-03-02
Author: marcel.stimberg@inserm.fr
File Name: brian2/stateupdaters/base.py
Class Name: StateUpdateMethod
Method Name: determine_stateupdater


Project Name: vatlab/SoS
Commit Name: ecb620b20567af3a5cbc1a29f8938335e66aa669
Time: 2017-04-08
Author: ben.bog@gmail.com
File Name: sos/sos_executor.py
Class Name: Base_Executor
Method Name: run


Project Name: vatlab/SoS
Commit Name: 9e805c5f17d868a9d2a266e96600cfdbdee9dbfa
Time: 2017-04-07
Author: ben.bog@gmail.com
File Name: sos/sos_executor.py
Class Name: Base_Executor
Method Name: run