Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/QuantLib-Python-enum-problems-tp11012p11013.html
On Feb 25, 2006, at 10:38 AM, Ryan Mills wrote:
> I managed to install QuantLib-Python 0.3.10 on OS X 10.4.5, and to my
> knowledge, this has not been widely done as fink still does not have
> 10.4 support. I wrote a blog about it at:
>
http://mills.zapto.org/wordpressNice. I'll keep the link handy in case someone asks.
> Two things:
> First:
> the quantlib-config should include the location of the directories I
> passed in to ./configure for the boost directories. It causes problems
> for QuantLib-Python if quantlib-config is not in there, and modified
> to include the boost directories. The --with-boost-lib and
> --with-boost-include should be enough indication to put those
> directories into quantlib-config.
Done. It will work in next release.
> Second:
> I am using python, and I am having some problems creating and using
> the objects because many of them rely on various enums.
> QuantLib::TimeUnit, and QuantLib::Frequency come to mind. Basically I
> am just getting started by trying to use InterestRate to caluclate
> some expected values. Any chance there is a Python FAQ for QuantLib
> around anywhere with instructions on how to use the objects or where
> the enums are stored in Python? I cannot find the enums anywhere. If I
> do end up figuring it up, perhaps the examples can be added somewhere
> for future python developers.
Yes, documentation is a sore spot of the project. Anyway, in recent
releases (let me check your blog again... hmm, you're using 0.3.10. I
don't remember in which version we made the change) most enumerations
are exported in the module namespace (i.e., QuantLib.Weeks or
QuantLib.Annual.) In earlier releases you had to pass them as strings
("weeks" or "annual".) If 0.3.10 still has the string version, I
suggest you jump on 0.3.11 before you write much code, or you'll have
to change it down the road.
Later,
Luigi