-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy path__init__.py
More file actions
72 lines (53 loc) · 1.4 KB
/
__init__.py
File metadata and controls
72 lines (53 loc) · 1.4 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
"""Sound Field Synthesis Toolbox.
https://sfs-python.readthedocs.io/
.. rubric:: Submodules
.. autosummary::
:toctree:
fd
td
array
tapering
plot2d
plot3d
util
"""
__version__ = "0.6.3"
class default:
"""Get/set defaults for the *sfs* module.
For example, when you want to change the default speed of sound::
import sfs
sfs.default.c = 330
"""
c = 343
"""Speed of sound."""
rho0 = 1.2250
"""Static density of air."""
selection_tolerance = 1e-6
"""Tolerance used for secondary source selection."""
def __setattr__(self, name, value):
"""Only allow setting existing attributes."""
if name in dir(self) and name != 'reset':
super().__setattr__(name, value)
else:
raise AttributeError(
'"default" object has no attribute ' + repr(name))
def reset(self):
"""Reset all attributes to their "factory default"."""
vars(self).clear()
import sys as _sys
if not getattr(_sys.modules.get('sphinx'), 'SFS_DOCS_ARE_BEING_BUILT', False):
# This object shadows the 'default' class, except when the docs are built:
default = default()
from . import tapering
from . import array
from . import util
try:
from . import plot2d
except ImportError:
pass
try:
from . import plot3d
except ImportError:
pass
from . import fd
from . import td