Improve docs#41
Conversation
There was an error in the way the sphinx documentation was configured that prevented it from building correctly, now that absolute imports (e.g., "from control import lti") have been changed to relative imports (e.g., "from . import lti"). In particular, the directory "root/control" should not be added to sys.path. Because this directory contains an __init__.py file, it is a Python package, and packages should never be added to the path, or lots of strange things happen, particularly with relative imports. Instead, the directory "root" should be added to the path. This change was made in the conf.py file. Also, the mocks for modules were fixed so that the documentation builds even if numpy, scipy, etc are not installed. Conflicts: doc/conf.py
Conflicts: control/ctrlutil.py
Comparisons like
if A == None:
give a FutureWarning: comparison to `None` will result in an
elementwise object comparison in the future.
This resuits in a bunch of warnings when running nosetests, so
this commit changes these to
if A is None:
Note that if you don't escape func(x, t, *parms) as `func(x, t, *parms)`, then Sphinx interprets the * as *emphasis*.
Previously, at least on my machine (Mac with Anaconda), running runtests.py gave a build error when setup.py tried to build a local copy of the package. It turns out this was because we were importing setuptools, which caused problems, because the rest of the setup.py script (which was taken from numpy) assumes we are using the numpy version of setup(), in numpy.distutils.core This commit removes the import of setuptools and makes setup.py almost identical to that used in numpy.
Use setuptools instead of numpy.distutils for "setup.py test"
Note: this is apparently a bug in the version of setup.py included
with numpy ("setup.py test" doesn't work for numpy).
The travis build hangs when installing matplotlib for python 3.2
(but not 2.7 and 3.3). This is apparently a documented issue with
matplotlib: see
matplotlib/matplotlib#3443
matplotlib/matplotlib#3741
|
@cwrowley - there is a build error in version 2.7 after this change. Can you have a look and see if there is an easy fix? |
|
Finally getting back to this. I suggest we no longer support Python 3.2, and instead support 3.3 and 3.4 (and 2.7, and possibly 2.6). That's what Anaconda supports now, and that is probably the main distribution people will be using. (It's certainly what I suggest to people.) This has the added benefit of being able to use the conda installer for Travis builds, which is much faster and cleaner than installing everything from source like we do now. |
This dramatically speeds up the installation of numpy, scipy, and matplotlib in the Travis build. Note that python 3.2 is not available in Anaconda, however.
Conflicts: control/mateqn.py
|
I support the recommendation to not support Python 3.2. Trying to support v3.2 in addition to the other versions of Python listed in the comment above causes complications with respect to denoting Unicode strings (cf. PEP 414). @cwrowley, I can review and merge this pull request when you are ready. I understand this to be a pull request that addresses issue #33. |
|
@slivingston, thanks--this is ready to go as far as I am concerned. Yes, this addresses issue #33 and #29. |
Fixes #48 The old algorithm called a general-purpose ODE integrator at each timestep, and this could be extremely slow (hundreds of times slower than scipy.signal.lsim). This new algorithm evaluates the matrix exponential once, and uses it to advance the simulation at each step. Importantly, the old algorithm would work for variable timesteps, but the new version assumes a fixed timestep (as does Matlab's lsim). This is the usual case, and it is the price one pays for increased speed. Note that this algorithm is the same idea as the algorithm used in scipy.signal.lsim, but the scipy version requires inverting the `A` matrix, and thus does not work if the system has a pole at the origin. The algorithm used here works even if there is a pole at the origin. This commit also adds a test for this case (the double integrator).
Speed up forced_response/lsim
|
I merged the lsim improvements from crowley/lsim. This pull request should be ready for merging into master. Just waiting on Travis CI to build and complete its checks. |
|
Errors from Travis CI. @cwrowley, can you take a look? |
|
Note that the build failure may be spurious. GitHub has been under a big DDoS attack. https://status.github.com |
|
I restarted the build, and it succeeded. |
There were some problems with the way the sphinx documentation was configured, in particular the path setting in
doc/conf.py. The changes in this pull request fix this, and create "mocks" for numpy and scipy routines so that these packages do not need to be installed for the documentation to build (necessary on readthedocs.org, and a good thing in general).This branch is based on the 0.6d release, and builds successfully on readthedocs.org (but not on travis.ci, because this release predates that setup). My plan is to merge this in to master, and then improve the documentation further.