Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from cwrowley/conda-build
Add conda build recipe and improve version numbering
- Loading branch information
Showing
9 changed files
with
235 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,96 @@ | ||
Python Control System Library | ||
============================= | ||
|
||
.. image:: https://travis-ci.org/python-control/python-control.svg?branch=master | ||
:target: https://travis-ci.org/python-control/python-control | ||
:target: https://travis-ci.org/python-control/python-control | ||
.. image:: https://coveralls.io/repos/python-control/python-control/badge.png | ||
:target: https://coveralls.io/r/python-control/python-control | ||
:target: https://coveralls.io/r/python-control/python-control | ||
|
||
Python Control Systems Library | ||
============================== | ||
|
||
The Python Control Systems Library is a Python module that implements basic | ||
operations for analysis and design of feedback control systems. | ||
|
||
Features | ||
-------- | ||
|
||
- Linear input/output systems in state-space and frequency domain | ||
- Block diagram algebra: serial, parallel, and feedback interconnections | ||
- Time response: initial, step, impulse | ||
- Frequency response: Bode and Nyquist plots | ||
- Control analysis: stability, reachability, observability, stability margins | ||
- Control design: eigenvalue placement, linear quadratic regulator | ||
- Estimator design: linear quadratic estimator (Kalman filter) | ||
|
||
|
||
Links | ||
===== | ||
|
||
- Project home page: http://python-control.sourceforge.net | ||
- Source code repository: https://github.com/python-control/python-control | ||
- Documentation: http://python-control.readthedocs.org/ | ||
- Issue tracker: https://github.com/python-control/python-control/issues | ||
- Mailing list: http://sourceforge.net/p/python-control/mailman/ | ||
|
||
|
||
Dependencies | ||
============ | ||
|
||
RMM, 23 May 09 | ||
The package requires numpy, scipy, and matplotlib. In addition, some routines | ||
use a module called slycot, that is a Python wrapper around some FORTRAN | ||
routines. Many parts of python-control will work without slycot, but some | ||
functionality is limited or absent, and installation of slycot is recommended | ||
(see below). Note that in order to install slycot, you will need a FORTRAN | ||
compiler on your machine. The Slycot wrapper can be found at: | ||
|
||
This directory contains the source code for the Python Control Systems | ||
Library (python-control). This package provides a library of standard | ||
control system algorithms in the python programming environment. | ||
https://github.com/jgoppert/Slycot | ||
|
||
Installation | ||
------------ | ||
============ | ||
|
||
The package may be installed using pip or distutils. | ||
|
||
Pip | ||
--- | ||
|
||
To install using pip:: | ||
|
||
Using pip | ||
~~~~~~~~~~~ | ||
pip install slycot # optional | ||
pip install control | ||
|
||
Pip is a python packaging system. It can be installed on debian based | ||
linux distros with the command:: | ||
Distutils | ||
--------- | ||
|
||
sudo apt-get install pip | ||
To install in your home directory, use:: | ||
|
||
Pip can then be used to install python-control:: | ||
python setup.py install --user | ||
|
||
sudo pip install control | ||
To install for all users (on Linux or Mac OS):: | ||
|
||
python setup.py build | ||
sudo python setup.py install | ||
|
||
From Source | ||
~~~~~~~~~~~ | ||
|
||
Standard python package installation:: | ||
Development | ||
=========== | ||
|
||
python setup.py install | ||
Code | ||
---- | ||
|
||
To see if things are working, you can run the script | ||
examples/secord-matlab.py (using ipython -pylab). It should generate a step | ||
response, Bode plot and Nyquist plot for a simple second order linear | ||
system. | ||
You can check out the latest version of the source code with the command:: | ||
|
||
git clone https://github.com/python-control/python-control.git | ||
|
||
Testing | ||
------- | ||
|
||
You can also run a set of unit tests to make sure that everything is working | ||
You can run a set of unit tests to make sure that everything is working | ||
correctly. After installation, run:: | ||
|
||
python runtests.py | ||
|
||
Slycot | ||
------ | ||
|
||
Routines from the Slycot wrapper are used for providing the | ||
functionality of several routines for state-space, transfer functions | ||
and robust control. Many parts of python-control will still work | ||
without slycot, but some functionality is limited or absent, and | ||
installation of Slycot is definitely recommended. The Slycot wrapper | ||
can be found at: | ||
python setup.py test | ||
|
||
https://github.com/jgoppert/Slycot | ||
Contributing | ||
------------ | ||
|
||
and can be installed with:: | ||
Your contributions are welcome! Simply fork the GitHub repository and send a | ||
`pull request`_. | ||
|
||
sudo pip install slycot | ||
.. _pull request: https://github.com/python-control/python-control/pulls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
cd %RECIPE_DIR%\.. | ||
%PYTHON% make_version.py | ||
%PYTHON% setup.py install --single-version-externally-managed --record=record.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package: | ||
name: control | ||
|
||
build: | ||
script: | ||
- cd $RECIPE_DIR/.. | ||
- $PYTHON make_version.py | ||
- $PYTHON setup.py install --single-version-externally-managed --record=record.txt | ||
|
||
requirements: | ||
build: | ||
- python | ||
- nose | ||
|
||
run: | ||
- python | ||
- numpy | ||
- scipy | ||
- matplotlib | ||
|
||
test: | ||
imports: | ||
- control | ||
|
||
about: | ||
home: http://python-control.sourceforge.net | ||
license: BSD License | ||
summary: 'Python control systems library' | ||
|
||
# See | ||
# http://docs.continuum.io/conda/build.html for | ||
# more information about meta.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from subprocess import check_output | ||
import os | ||
|
||
def main(): | ||
cmd = 'git describe --always --long' | ||
output = check_output(cmd.split()).decode('utf-8').strip().split('-') | ||
if len(output) == 3: | ||
version, build, commit = output | ||
else: | ||
raise Exception("Could not git describe, (got %s)" % output) | ||
|
||
print("Version: %s" % version) | ||
print("Build: %s" % build) | ||
print("Commit: %s\n" % commit) | ||
|
||
filename = "control/_version.py" | ||
print("Writing %s" % filename) | ||
with open(filename, 'w') as fd: | ||
if build == '0': | ||
fd.write('__version__ = "%s"\n' % (version)) | ||
else: | ||
fd.write('__version__ = "%s.post%s"\n' % (version, build)) | ||
fd.write('__commit__ = "%s"\n' % (commit)) | ||
|
||
# Write files for conda version number | ||
SRC_DIR = os.environ.get('SRC_DIR', '.') | ||
conda_version_path = os.path.join(SRC_DIR, '__conda_version__.txt') | ||
print("Writing %s" % conda_version_path) | ||
with open(conda_version_path, 'w') as conda_version: | ||
conda_version.write(version) | ||
|
||
conda_buildnum_path = os.path.join(SRC_DIR, '__conda_buildnum__.txt') | ||
print("Writing %s" % conda_buildnum_path) | ||
|
||
with open(conda_buildnum_path, 'w') as conda_buildnum: | ||
conda_buildnum.write(build) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Oops, something went wrong.