QuantLib python mirror functions questions

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

QuantLib python mirror functions questions

Shuo Wang-2
Hi,

will all the functions of a python class be mirror all functions in a C++ class?
when i try to use the Schedule class in python, it claims it doesnt
have those attributes documented here

http://quantlib.org/reference/class_quant_lib_1_1_schedule.html

I am trying something like this

 schedule = QuantLib.Schedule(settlementDate, maturity,
                                        QuantLib.Period(5,
QuantLib.Years), China(),
                                        QuantLib.Unadjusted,
QuantLib.Unadjusted,
                                        QuantLib.DateGeneration.Forward, False)
print schedule.dates()


--
王硕
邮箱:[hidden email]
Whatever your journey, keep walking.

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Ciosco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib python mirror functions questions

Luigi Ballabio
On Thu, 2011-10-20 at 15:43 +0800, Shuo Wang wrote:
> will all the functions of a python class be mirror all functions in a
> C++ class?

That would be the idea, but it needs work.


> when i try to use the Schedule class in python, it claims it doesnt
> have those attributes documented here
>
> http://quantlib.org/reference/class_quant_lib_1_1_schedule.html
>
> I am trying something like this
>
>  schedule = QuantLib.Schedule(settlementDate, maturity,
>                                         QuantLib.Period(5,
> QuantLib.Years), China(),
>                                         QuantLib.Unadjusted,
> QuantLib.Unadjusted,
>                                         QuantLib.DateGeneration.Forward, False)
> print schedule.dates()

Hmm. Yes, that's missing. You can add it to the SWIG interface and
regenerate the wrappers (send me a patch if you do and I'll add it to
next release) or, in this case, you can work around it by using

print list(schedule)

or

for d in schedule:
    print d

Luigi


--

Everything can be filed under "miscellaneous".
-- unknown



------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Ciosco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users