QuantLib-SWIG port to Python3

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

QuantLib-SWIG port to Python3

Minjae David Kim
Hello,

I was wondering if there is any interest in porting QuantLib-SWIG to work with Python3.x.  Currently, it seems to work only with Python2.x.

I have done some quick fixes on SWIG interface files so that it works with Python3.x  Works well with me so far and passes all the tests.  If there is interest, I will be happy to contribute -- please let me know.  Also, I was hoping to add more to the test cases.

Best Regards,
Minjae

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib-SWIG port to Python3

Luigi Ballabio

Hello Minjae,
    yes, it would be great if you contributed your fixes (a pull request on GitHub would be best, but you can send it in whatever format works for you). The same goes for the test cases.

Thanks,
    Luigi

On Oct 3, 2013 7:01 PM, "Minjae David Kim" <[hidden email]> wrote:
Hello,

I was wondering if there is any interest in porting QuantLib-SWIG to work with Python3.x.  Currently, it seems to work only with Python2.x.

I have done some quick fixes on SWIG interface files so that it works with Python3.x  Works well with me so far and passes all the tests.  If there is interest, I will be happy to contribute -- please let me know.  Also, I was hoping to add more to the test cases.

Best Regards,
Minjae

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib-SWIG port to Python3

Minjae David Kim
Hello Luigi,

I have accordingly made a pull request on GitHub.  I tested the code in both Python 2 and Python 3 to ensure that we are maintaining full compatibility.  If people are using Python, it would be great if they could test the new code and give feedback.

Best Regards,
Minjae


On Thu, Oct 3, 2013 at 10:49 AM, Luigi Ballabio <[hidden email]> wrote:

Hello Minjae,
    yes, it would be great if you contributed your fixes (a pull request on GitHub would be best, but you can send it in whatever format works for you). The same goes for the test cases.

Thanks,
    Luigi

On Oct 3, 2013 7:01 PM, "Minjae David Kim" <[hidden email]> wrote:
Hello,

I was wondering if there is any interest in porting QuantLib-SWIG to work with Python3.x.  Currently, it seems to work only with Python2.x.

I have done some quick fixes on SWIG interface files so that it works with Python3.x  Works well with me so far and passes all the tests.  If there is interest, I will be happy to contribute -- please let me know.  Also, I was hoping to add more to the test cases.

Best Regards,
Minjae

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev



------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib-SWIG port to Python3

Luigi Ballabio
Minjae,
    I've merged the pull request.  I've made a few small changes to
ensure compatibility with older versions (such as the ancient Python
2.5, with which QuantLib still works) so please check that I haven't
broken anything.

Thanks,
    Luigi


On Sun, Oct 6, 2013 at 6:06 AM, Minjae David Kim <[hidden email]> wrote:

> Hello Luigi,
>
> I have accordingly made a pull request on GitHub.  I tested the code in both
> Python 2 and Python 3 to ensure that we are maintaining full compatibility.
> If people are using Python, it would be great if they could test the new
> code and give feedback.
>
> Best Regards,
> Minjae
>
>
> On Thu, Oct 3, 2013 at 10:49 AM, Luigi Ballabio <[hidden email]>
> wrote:
>>
>> Hello Minjae,
>>     yes, it would be great if you contributed your fixes (a pull request
>> on GitHub would be best, but you can send it in whatever format works for
>> you). The same goes for the test cases.
>>
>> Thanks,
>>     Luigi
>>
>> On Oct 3, 2013 7:01 PM, "Minjae David Kim" <[hidden email]> wrote:
>>>
>>> Hello,
>>>
>>> I was wondering if there is any interest in porting QuantLib-SWIG to work
>>> with Python3.x.  Currently, it seems to work only with Python2.x.
>>>
>>> I have done some quick fixes on SWIG interface files so that it works
>>> with Python3.x  Works well with me so far and passes all the tests.  If
>>> there is interest, I will be happy to contribute -- please let me know.
>>> Also, I was hoping to add more to the test cases.
>>>
>>> Best Regards,
>>> Minjae
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> October Webinars: Code for Performance
>>> Free Intel webinars can help you accelerate application performance.
>>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
>>> from
>>> the latest Intel processors and coprocessors. See abstracts and register
>>> >
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> QuantLib-dev mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>>>
>



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib-SWIG port to Python3

Minjae David Kim
I reviewed your changes and ran the tests in Python 3.  Also, thanks for updating the examples.

One minor comment I have is that I see some changes in the relative import syntax (in QuantLib/__init__.py line 19 - 26).  Your implementation certainly works, but I am curious why the previous implementation ("import .QuantLib [...]") did not work.  Due to PEP 328, all major versions of Python (including 2.5) should support the prefix dot import syntax, but unfortunately, I don't have Python 2.5 on my system to test it.  Python 2.7 worked with the previous implementation.

Anyhow, the above comment is just a minor one.  The code works fine as far as I can see from the tests in Python 2.7 and 3.3.


Best Regards,
Minjae


On Mon, Oct 7, 2013 at 8:07 AM, Luigi Ballabio <[hidden email]> wrote:
Minjae,
    I've merged the pull request.  I've made a few small changes to
ensure compatibility with older versions (such as the ancient Python
2.5, with which QuantLib still works) so please check that I haven't
broken anything.

Thanks,
    Luigi


On Sun, Oct 6, 2013 at 6:06 AM, Minjae David Kim <[hidden email]> wrote:
> Hello Luigi,
>
> I have accordingly made a pull request on GitHub.  I tested the code in both
> Python 2 and Python 3 to ensure that we are maintaining full compatibility.
> If people are using Python, it would be great if they could test the new
> code and give feedback.
>
> Best Regards,
> Minjae
>
>
> On Thu, Oct 3, 2013 at 10:49 AM, Luigi Ballabio <[hidden email]>
> wrote:
>>
>> Hello Minjae,
>>     yes, it would be great if you contributed your fixes (a pull request
>> on GitHub would be best, but you can send it in whatever format works for
>> you). The same goes for the test cases.
>>
>> Thanks,
>>     Luigi
>>
>> On Oct 3, 2013 7:01 PM, "Minjae David Kim" <[hidden email]> wrote:
>>>
>>> Hello,
>>>
>>> I was wondering if there is any interest in porting QuantLib-SWIG to work
>>> with Python3.x.  Currently, it seems to work only with Python2.x.
>>>
>>> I have done some quick fixes on SWIG interface files so that it works
>>> with Python3.x  Works well with me so far and passes all the tests.  If
>>> there is interest, I will be happy to contribute -- please let me know.
>>> Also, I was hoping to add more to the test cases.
>>>
>>> Best Regards,
>>> Minjae
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> October Webinars: Code for Performance
>>> Free Intel webinars can help you accelerate application performance.
>>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
>>> from
>>> the latest Intel processors and coprocessors. See abstracts and register
>>> >
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> QuantLib-dev mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>>>
>



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib-SWIG port to Python3

Luigi Ballabio
The relative-import syntax seems to have limitations in Python 2.5.  I
can import specific names, but if I try to import everything I get
    SyntaxError: 'import *' not allowed with 'from .'

Luigi


On Mon, Oct 7, 2013 at 8:59 PM, Minjae David Kim <[hidden email]> wrote:

> I reviewed your changes and ran the tests in Python 3.  Also, thanks for
> updating the examples.
>
> One minor comment I have is that I see some changes in the relative import
> syntax (in QuantLib/__init__.py line 19 - 26).  Your implementation
> certainly works, but I am curious why the previous implementation ("import
> .QuantLib [...]") did not work.  Due to PEP 328, all major versions of
> Python (including 2.5) should support the prefix dot import syntax, but
> unfortunately, I don't have Python 2.5 on my system to test it.  Python 2.7
> worked with the previous implementation.
>
> Anyhow, the above comment is just a minor one.  The code works fine as far
> as I can see from the tests in Python 2.7 and 3.3.
>
>
> Best Regards,
> Minjae
>
>
> On Mon, Oct 7, 2013 at 8:07 AM, Luigi Ballabio <[hidden email]>
> wrote:
>>
>> Minjae,
>>     I've merged the pull request.  I've made a few small changes to
>> ensure compatibility with older versions (such as the ancient Python
>> 2.5, with which QuantLib still works) so please check that I haven't
>> broken anything.
>>
>> Thanks,
>>     Luigi
>>
>>
>> On Sun, Oct 6, 2013 at 6:06 AM, Minjae David Kim <[hidden email]>
>> wrote:
>> > Hello Luigi,
>> >
>> > I have accordingly made a pull request on GitHub.  I tested the code in
>> > both
>> > Python 2 and Python 3 to ensure that we are maintaining full
>> > compatibility.
>> > If people are using Python, it would be great if they could test the new
>> > code and give feedback.
>> >
>> > Best Regards,
>> > Minjae
>> >
>> >
>> > On Thu, Oct 3, 2013 at 10:49 AM, Luigi Ballabio
>> > <[hidden email]>
>> > wrote:
>> >>
>> >> Hello Minjae,
>> >>     yes, it would be great if you contributed your fixes (a pull
>> >> request
>> >> on GitHub would be best, but you can send it in whatever format works
>> >> for
>> >> you). The same goes for the test cases.
>> >>
>> >> Thanks,
>> >>     Luigi
>> >>
>> >> On Oct 3, 2013 7:01 PM, "Minjae David Kim" <[hidden email]>
>> >> wrote:
>> >>>
>> >>> Hello,
>> >>>
>> >>> I was wondering if there is any interest in porting QuantLib-SWIG to
>> >>> work
>> >>> with Python3.x.  Currently, it seems to work only with Python2.x.
>> >>>
>> >>> I have done some quick fixes on SWIG interface files so that it works
>> >>> with Python3.x  Works well with me so far and passes all the tests.
>> >>> If
>> >>> there is interest, I will be happy to contribute -- please let me
>> >>> know.
>> >>> Also, I was hoping to add more to the test cases.
>> >>>
>> >>> Best Regards,
>> >>> Minjae
>> >>>
>> >>>
>> >>>
>> >>> ------------------------------------------------------------------------------
>> >>> October Webinars: Code for Performance
>> >>> Free Intel webinars can help you accelerate application performance.
>> >>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the
>> >>> most
>> >>> from
>> >>> the latest Intel processors and coprocessors. See abstracts and
>> >>> register
>> >>> >
>> >>>
>> >>>
>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
>> >>> _______________________________________________
>> >>> QuantLib-dev mailing list
>> >>> [hidden email]
>> >>> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>> >>>
>> >
>>
>>
>>
>> --
>> <https://implementingquantlib.blogspot.com>
>> <https://twitter.com/lballabio>
>
>



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev