- Notifications
You must be signed in to change notification settings - Fork441
Add conda build recipe and improve version numbering#52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
6 commits Select commitHold shift + click to select a range
09a7153
Simplify setup.py and automatic version generation
cwrowley7f93726
Update and improve README
cwrowley688d1f6
Fix print statement in tests/freqresp.py for py3
cwrowley6d33754
Add conda recipe
cwrowley4a35d46
Modify travis build to test conda recipe
cwrowley5ff196c
Install slycot from binstar in Travis CI
cwrowleyFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
4 changes: 3 additions & 1 deletion.gitignore
This file contains hidden or 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 |
---|---|---|
@@ -3,7 +3,9 @@ build/ | ||
dist/ | ||
.ropeproject/ | ||
MANIFEST | ||
control/_version.py | ||
__conda_*.txt | ||
record.txt | ||
build.log | ||
*.egg-info/ | ||
.coverage | ||
9 changes: 5 additions & 4 deletions.travis.yml
This file contains hidden or 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
111 changes: 71 additions & 40 deletionsREADME.rst
This file contains hidden or 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 @@ | ||
.. image:: https://travis-ci.org/python-control/python-control.svg?branch=master | ||
: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 | ||
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 | ||
============ | ||
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: | ||
https://github.com/jgoppert/Slycot | ||
Installation | ||
============ | ||
The package may be installed using pip or distutils. | ||
Pip | ||
--- | ||
To install using pip:: | ||
pip install slycot # optional | ||
pip install control | ||
Distutils | ||
--------- | ||
To install in your home directory, use:: | ||
python setup.pyinstall--user | ||
To install for all users (on Linux or Mac OS):: | ||
python setup.py build | ||
sudo python setup.py install | ||
Development | ||
=========== | ||
Code | ||
---- | ||
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 run a set of unit tests to make sure that everything is working | ||
correctly. After installation, run:: | ||
python setup.py test | ||
Contributing | ||
------------ | ||
Your contributions are welcome! Simply fork the GitHub repository and send a | ||
`pull request`_. | ||
.. _pull request: https://github.com/python-control/python-control/pulls |
3 changes: 3 additions & 0 deletionsconda-recipe/bld.bat
This file contains hidden or 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 |
32 changes: 32 additions & 0 deletionsconda-recipe/meta.yaml
This file contains hidden or 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 |
103 changes: 47 additions & 56 deletionscontrol/__init__.py
This file contains hidden or 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
2 changes: 1 addition & 1 deletioncontrol/tests/freqresp.py
This file contains hidden or 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
40 changes: 40 additions & 0 deletionsmake_version.py
This file contains hidden or 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.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.