BrianPreference class¶
(Shortest import: from brian2 import BrianPreference)
- class brian2.core.preferences.BrianPreference(default, docs, validator=None, representor=<built-in function repr>)[source]¶
Bases:
objectUsed for defining a Brian preference.
- Parameters
default : object
The default value.
docs : str
Documentation for the preference value.
validator : func
A function that True or False depending on whether the preference value is valid or not. If not specified, uses the
DefaultValidatorfor the default value provided (check if the class is the same, and forQuantityobjects, whether the units are consistent).representor : func
A function that returns a string representation of a valid preference value that can be passed to
eval. By default, usesreprwhich works in almost all cases.