Hi Didrik,

It's work-in-progress, I'll delete the code for now. However, it raises 
a question we have not faced so far:

Up to now, all the accessors to QL objects returned python native types 
(float and date).

Here, we have an accessor that returns a QL object. Another example is 
found in interest_rate_index.pyx:

     property tenor:
         def __get__(self):
             cdef _pe.Period pe

             pe = get_iri(self).tenor()
             return Period(pe.length(), pe.units())

The Instrument class hierarchy is full of accessors of that kind.

In the code above, I create a new instance of the QL object. This is 
also what Bond Geek is doing. Of course, the preferred solution would be 
to instantiate a Period with a ref to the existing QL object, but I'm 
not clear about the behavior of the dealloc method in Period:

     def __dealloc__(self):
         if self._thisptr is not NULL:
             del self._thisptr

We would have several Period python objects with ref to a single QL 
Period. I need to experiement with this carefully.

Regarding Travis, I continue to observe what looks like random behavior. 
Obscure import errors, never at the same place. A build can fail, then 
pass when I restart it from the Travis page. I'm wondering if it's 
related to boost. I see that Travis is now using Boost 1.53. Is this 
also what you are using?

Cheers,

Patrick Hénaff
Maître de Conférences
IAE Paris
Université Paris I | Panthéon Sorbonne

+33 (0)1 53 55 27 70
+33 (0)6 01 30 13 57
skype: pahenaff

On 01/03/2014 12:28 PM, Didrik Pinte wrote:
> In quantlib/instruments/swap.pyx:
>
>> +    internal _thisptr attribute of the Instrument base class. """
>> +
>> +    cdef _swap.Swap* ref = <_swap.Swap*>swap._thisptr.get()
>> +    return ref
>> +
>> +
>> +cdef class Swap(Instrument):
>> +    """
>> +    Base swap class
>> +    """
>> +
>> +    def __init__(self):
>> +        raise NotImplementedError('Generic swap not yet implemented. \
>> +        Please use child classes.')
>> +
>> +    ## def __init__(self, Leg firstLeg,
>
> @phenaff <https://github.com/phenaff> what is the status of this set of
> commented methods?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/enthought/pyql/pull/32/files#r8639427>.Web Bug from
> https://github.com/notifications/beacon/346260__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwNDMwMjkxMiwiZGF0YSI6eyJpZCI6MjI3ODYzOTl9fQ==--c980d2f57efb7c589df7e8ca2f6a62a27884b0c4.gif
>
>
> --
> Ce message a été vérifié par MailScanner <http://www.mailscanner.info/>
> pour des virus ou des polluriels et rien de suspect n'a été trouvé.

-- 
Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.