File: brian_unit_prefs.py

package info (click to toggle)
brian 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, stretch
  • size: 23,436 kB
  • sloc: python: 68,707; cpp: 29,040; ansic: 5,182; sh: 111; makefile: 61
file content (27 lines) | stat: -rw-r--r-- 651 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""This module is used by the package Brian for turning units on and off.

For the user, you can ignore this unless you want to turn units off,
in which case you simply put at the top of your program (before
importing anything from brian):

from brian_unit_prefs import turn_off_units
turn_off_units()

Or to turn units off and not have a warning printed:

from brian_unit_prefs import turn_off_units
turn_off_units(warn=False)
"""


class _unit_prefs():
    pass

bup = _unit_prefs()

bup.use_units = True
bup.warn_about_units = True

def turn_off_units(warn=True):
    bup.use_units = False
    bup.warn_about_units = warn