The following code causes a bug when it tries to raise an error:
import control as ct
import control.iosys as io
2*io.ss2io(ct.ss(1,1,1,1))
raise NotImplemented("Scalar multiplication not yet implemented")
This is because InputOutputSystems define various methods, e.g. __mul__ that override those in StateSpace and some are not implemented yet.
Options that come to mind if we want this to work better:
- Test for instances of
StateSpace correctly and dispatch. This seems to be onerous and at odds with how inheritance ought to make things easier.
- In the
__init__ method of LinearIOSystem, delete those methods
- move those operations to NonLinearIOSystem (and override as necessary in
LinearIOSystem when it makes sense to create a new LinearICSystem)
Related: many of the methods like __mul__ don't act on self and other but rather sys1 and sys2. This might still work, but I think the first argument should be self according to Python convention.
The following code causes a bug when it tries to raise an error:
raise NotImplemented("Scalar multiplication not yet implemented")This is because
InputOutputSystemsdefine various methods, e.g.__mul__that override those inStateSpaceand some are not implemented yet.Options that come to mind if we want this to work better:
StateSpacecorrectly and dispatch. This seems to be onerous and at odds with how inheritance ought to make things easier.__init__method ofLinearIOSystem, delete those methodsLinearIOSystemwhen it makes sense to create a newLinearICSystem)Related: many of the methods like
__mul__don't act onselfandotherbut rathersys1andsys2. This might still work, but I think the first argument should beselfaccording to Python convention.