Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Modified setup.py and control/__init__.py to match numpy. #38

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion control/tests/discrete_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@

import unittest
import numpy as np
from control import *
from control.statesp import StateSpace
from control import matlab
from control.xferfcn import TransferFunction
from control.lti import isdtime, timebase, isctime, timebaseEqual
from control.dtime import sample_system
from control.bdalg import feedback
from control.timeresp import step_response, impulse_response, forced_response
from control.freqplot import bode


class TestDiscrete(unittest.TestCase):
"""Tests for the DiscreteStateSpace class."""
Expand Down
44 changes: 30 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

MAJOR = 0
MINOR = 6
MICRO = 5
MICRO = 6
ISRELEASED = True
DISTNAME = 'control'
DESCRIPTION = 'Python control systems library'
Expand All @@ -36,15 +36,6 @@
tests_require=['scipy', 'matplotlib', 'nose']
)

VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

import os
import sys
import subprocess


from setuptools import setup, find_packages

CLASSIFIERS = """\
Development Status :: 3 - Alpha
Intended Audience :: Science/Research
Expand All @@ -60,6 +51,23 @@
Operating System :: MacOS
"""

VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

import os
import sys
import subprocess
from setuptools import setup, find_packages

# check for python version
if sys.version_info[:2] < (2, 6) or (3, 0) <= sys.version_info[0:2] < (3, 2):
raise RuntimeError("Python version 2.6, 2.7 or >= 3.2 required.")

# use builtins to store if we are running setup
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins


# Return the git revision as a string
def git_version():
Expand Down Expand Up @@ -88,6 +96,12 @@ def _minimal_ext_cmd(cmd):

return GIT_REVISION

# This is a bit hackish: we are setting a global variable so that the main
# numpy __init__ can detect if it is being loaded by the setup routine, to
# avoid attempting to load components that aren't built yet. While ugly, it's
# a lot more robust than what was previously being used.
builtins.__CONTROL_SETUP__ = True


def get_version_info():
# Adding the git rev number needs to be done inside write_version_py(),
Expand All @@ -100,10 +114,12 @@ def get_version_info():
# must be a source distribution, use existing version file
try:
from control.version import git_revision as GIT_REVISION
except ImportError:
raise ImportError("Unable to import git_revision. Try removing "
"control/version.py and the build directory "
"before building.")
except ImportError as e:
raise ImportError(
str(e) +
", Unable to import git_revision. Try removing "
"control/version.py and the build directory "
"before building.")
else:
GIT_REVISION = "Unknown"

Expand Down