From: Gustavo G. <gor...@mi...> - 2011-04-17 18:07:48
|
Hey All, I didn't intent to commit the change to setup.py. Sorry about that. I was trying to install "control" like so: $ python setup.py develop The "develop" option makes apparently makes an egg link from the python dist-packages to src folder. This way changes to the src folder take effect in my python environment. You can accomplish the same thing manually with symlinks, I think. Anyway I haven't been able to get this to work. I haven't developed a python module before so I thought I'd ask your methods. Thanks, Gustavo On Sat, Apr 16, 2011 at 7:45 PM, <gor...@us...> wrote: > Revision: 155 > > http://python-control.svn.sourceforge.net/python-control/?rev=155&view=rev > Author: goretkin > Date: 2011-04-16 23:45:46 +0000 (Sat, 16 Apr 2011) > > Log Message: > ----------- > Support for the **,/ operator. > >> s = control.tf.TransferFunction([1, 0],[1]) > sys = s/(s**2+s+1) #works as expected > > Modified Paths: > -------------- > trunk/setup.py > trunk/src/xferfcn.py > > Modified: trunk/setup.py > =================================================================== > --- trunk/setup.py 2011-04-07 20:12:28 UTC (rev 154) > +++ trunk/setup.py 2011-04-16 23:45:46 UTC (rev 155) > @@ -1,6 +1,7 @@ > #!/usr/bin/env python > > -from distutils.core import setup > +#from distutils.core import setup > +from setuptools import setup > > setup(name = 'control', > version = '0.4c', > > Modified: trunk/src/xferfcn.py > =================================================================== > --- trunk/src/xferfcn.py 2011-04-07 20:12:28 UTC (rev 154) > +++ trunk/src/xferfcn.py 2011-04-16 23:45:46 UTC (rev 155) > @@ -372,9 +372,13 @@ > def __div__(self, other): > """Divide two LTI objects.""" > > - # Convert the second argument to a transfer function. > - other = _convertToTransferFunction(other) > + if isinstance(other, (int, float, long, complex)): > + other = _convertToTransferFunction(other, inputs=self.inputs, > + outputs=self.inputs) > + else: > + other = _convertToTransferFunction(other) > > + > if (self.inputs > 1 or self.outputs > 1 or > other.inputs > 1 or other.outputs > 1): > raise NotImplementedError("TransferFunction.__div__ is > currently \ > @@ -388,6 +392,11 @@ > # TODO: Division of MIMO transfer function objects is not written yet. > def __rdiv__(self, other): > """Right divide two LTI objects.""" > + if isinstance(other, (int, float, long, complex)): > + other = _convertToTransferFunction(other, inputs=self.inputs, > + outputs=self.inputs) > + else: > + other = _convertToTransferFunction(other) > > if (self.inputs > 1 or self.outputs > 1 or > other.inputs > 1 or other.outputs > 1): > @@ -395,6 +404,16 @@ > implemented only for SISO systems.") > > return other / self > + def __pow__(self,other): > + if not type(other) == int: > + raise ValueError("Exponent must be an integer") > + if other == 0: > + return TransferFunction([1],[1]) #unity > + if other > 0: > + return self * (self**(other-1)) > + if other < 0: > + return (TransferFunction([1],[1]) / self) * (self**(other+1)) > + > > def evalfr(self, omega): > """Evaluate a transfer function at a single angular frequency. > > > This was sent by the SourceForge.net collaborative development platform, > the world's largest Open Source development site. > > > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > |