|
56 | 56 | lqe linear quadratic estimator |
57 | 57 | """ |
58 | 58 |
|
59 | | -try: |
60 | | - __CONTROL_SETUP__ |
61 | | -except NameError: |
62 | | - __CONTROL_SETUP__ = False |
63 | | - |
64 | | -if __CONTROL_SETUP__: |
65 | | - import sys as _sys |
66 | | - _sys.stderr.write('Running from control source directory.\n') |
67 | | - del _sys |
68 | | -else: |
| 59 | +# Import functions from within the control system library |
| 60 | +# Should probably only import the exact functions we use... |
| 61 | +from .bdalg import series, parallel, negate, feedback |
| 62 | +from .delay import pade |
| 63 | +from .dtime import sample_system |
| 64 | +from .freqplot import bode_plot, nyquist_plot, gangof4_plot |
| 65 | +from .freqplot import bode, nyquist, gangof4 |
| 66 | +from .lti import issiso, timebase, timebaseEqual, isdtime, isctime |
| 67 | +from .margins import stability_margins, phase_crossover_frequencies |
| 68 | +from .mateqn import lyap, dlyap, care, dare |
| 69 | +from .modelsimp import hsvd, modred, balred, era, markov |
| 70 | +from .nichols import nichols_plot, nichols |
| 71 | +from .phaseplot import phase_plot, box_grid |
| 72 | +from .rlocus import root_locus |
| 73 | +from .statefbk import place, lqr, ctrb, obsv, gram, acker |
| 74 | +from .statesp import StateSpace |
| 75 | +from .timeresp import forced_response, initial_response, step_response, \ |
| 76 | + impulse_response |
| 77 | +from .xferfcn import TransferFunction |
| 78 | +from .ctrlutil import unwrap, issys |
| 79 | +from .frdata import FRD |
| 80 | +from .canonical import canonical_form, reachable_form |
69 | 81 |
|
70 | | - # Import functions from within the control system library |
71 | | - # Should probably only import the exact functions we use... |
72 | | - from .bdalg import series, parallel, negate, feedback |
73 | | - from .delay import pade |
74 | | - from .dtime import sample_system |
75 | | - from .freqplot import bode_plot, nyquist_plot, gangof4_plot |
76 | | - from .freqplot import bode, nyquist, gangof4 |
77 | | - from .lti import issiso, timebase, timebaseEqual, isdtime, isctime |
78 | | - from .margins import stability_margins, phase_crossover_frequencies |
79 | | - from .mateqn import lyap, dlyap, care, dare |
80 | | - from .modelsimp import hsvd, modred, balred, era, markov |
81 | | - from .nichols import nichols_plot, nichols |
82 | | - from .phaseplot import phase_plot, box_grid |
83 | | - from .rlocus import root_locus |
84 | | - from .statefbk import place, lqr, ctrb, obsv, gram, acker |
85 | | - from .statesp import StateSpace |
86 | | - from .timeresp import forced_response, initial_response, step_response, \ |
87 | | - impulse_response |
88 | | - from .xferfcn import TransferFunction |
89 | | - from .ctrlutil import unwrap, issys |
90 | | - from .frdata import FRD |
91 | | - from .canonical import canonical_form, reachable_form |
| 82 | +# Exceptions |
| 83 | +from .exception import * |
92 | 84 |
|
93 | | - # Exceptions |
94 | | - from .exception import * |
95 | | - |
96 | | - # Version information |
97 | | - from control.version import full_version as __version__ |
98 | | - from control.version import git_revision as __git_revision__ |
| 85 | +# Version information |
| 86 | +try: |
| 87 | + from ._version import __version__, __commit__ |
| 88 | +except ImportError: |
| 89 | + __version__ = "dev" |
99 | 90 |
|
100 | | - # Import some of the more common (and benign) MATLAB shortcuts |
101 | | - # By default, don't import conflicting commands here |
102 | | - #! TODO (RMM, 4 Nov 2012): remove MATLAB dependencies from __init__.py |
103 | | - #! |
104 | | - #! Eventually, all functionality should be in modules *other* than matlab. |
105 | | - #! This will allow inclusion of the matlab module to set up a different set |
106 | | - #! of defaults from the main package. At that point, the matlab module will |
107 | | - #! allow provide compatibility with MATLAB but no package functionality. |
108 | | - #! |
109 | | - from .matlab import ss, tf, ss2tf, tf2ss, drss |
110 | | - from .matlab import pole, zero, evalfr, freqresp, dcgain |
111 | | - from .matlab import nichols, rlocus, margin |
112 | | - # bode and nyquist come directly from freqplot.py |
113 | | - from .matlab import step, impulse, initial, lsim |
114 | | - from .matlab import ssdata, tfdata |
| 91 | +# Import some of the more common (and benign) MATLAB shortcuts |
| 92 | +# By default, don't import conflicting commands here |
| 93 | +#! TODO (RMM, 4 Nov 2012): remove MATLAB dependencies from __init__.py |
| 94 | +#! |
| 95 | +#! Eventually, all functionality should be in modules *other* than matlab. |
| 96 | +#! This will allow inclusion of the matlab module to set up a different set |
| 97 | +#! of defaults from the main package. At that point, the matlab module will |
| 98 | +#! allow provide compatibility with MATLAB but no package functionality. |
| 99 | +#! |
| 100 | +from .matlab import ss, tf, ss2tf, tf2ss, drss |
| 101 | +from .matlab import pole, zero, evalfr, freqresp, dcgain |
| 102 | +from .matlab import nichols, rlocus, margin |
| 103 | + # bode and nyquist come directly from freqplot.py |
| 104 | +from .matlab import step, impulse, initial, lsim |
| 105 | +from .matlab import ssdata, tfdata |
115 | 106 |
|
116 | 107 | # The following is to use Numpy's testing framework |
117 | 108 | # Tests go under directory tests/, benchmarks under directory benchmarks/ |
118 | | - from numpy.testing import Tester |
119 | | - test = Tester().test |
120 | | - bench = Tester().bench |
| 109 | +from numpy.testing import Tester |
| 110 | +test = Tester().test |
| 111 | +bench = Tester().bench |
0 commit comments