John Burkhart
2012-11-09 11:51:55 UTC
Hello,
I'm working with a custom built set of .NET 4 assemblies.
The .NET assemblies have a type 'TimeSeries'.
These time series can have operations conducted on them (addition,
averaging, etc.), which returns a new type ('BinaryOperation'). I can do
However, in pythonnet the BinaryOperation fails... conducting the identical
TypeError Traceback (most recent call last)
<ipython-input-79-367816bc7679> in <module>()
----> 1 sumts = tsvalues[0]+tsvalues[1]
TypeError: unsupported operand type(s) for +: 'TimeSeries' and 'TimeSeries'
Any ideas on why pythonnet and IronPython would handle operations on my
class types differently? In pythonnet do my types have to have the
.__add__, .__sub__, etc. method-wrappers implemented??
Thank you,
john
I'm working with a custom built set of .NET 4 assemblies.
The .NET assemblies have a type 'TimeSeries'.
These time series can have operations conducted on them (addition,
averaging, etc.), which returns a new type ('BinaryOperation'). I can do
type(tsvalues)
<type 'List[ITimeSeries]'>type(tsvalues[0])
<type 'TimeSeries'>sumts = tsvalues[0] + tsvalues[1]
type(sumts)
<type 'BinaryOperation'>type(sumts)
However, in pythonnet the BinaryOperation fails... conducting the identical
type(tsvalues)
System.Collections.Generic.0, Culture=neutral, PublicKeyToken=null]]type(tsvalues[0])
TimeSeriessumts = tsvalues[0]+tsvalues[1]
---------------------------------------------------------------------------TypeError Traceback (most recent call last)
<ipython-input-79-367816bc7679> in <module>()
----> 1 sumts = tsvalues[0]+tsvalues[1]
TypeError: unsupported operand type(s) for +: 'TimeSeries' and 'TimeSeries'
Any ideas on why pythonnet and IronPython would handle operations on my
class types differently? In pythonnet do my types have to have the
.__add__, .__sub__, etc. method-wrappers implemented??
Thank you,
john