[Ns-developers] NS-3 Python
Gustavo Carneiro
gjcarneiro at gmail.com
Fri Jan 18 11:07:25 PST 2008
On 18/01/2008, craigdo at ee.washington.edu <craigdo at ee.washington.edu> wrote:
>
> [ ... ]
>
> > > Comments/objections?
> >
> > Yes, my main question is:
> > - as a developer, what do I have to do to bind new models I add to
> > ns-3 ?
> > - as a developer, what do I have to do to make sure that I do not
> > break the bindings if I change the ns-3 API ?
>
> Obviously getting the code in and starting to use it is the most important
> thing, so this isn't really on any critical path; but I'm curious:
>
> - Is it easy to tell which parts of the ns-3 API are covered and which are
> not (especially with respect to Mathieu's "new models" comment)?
For each method or function not supported, PyBindGen prints a warning to
stderr during code generation. Or do you mean python coverage
statistics?...
- Is how to find and use the Python APIs intuitively (or at least
> relatively) obvious?
Python APIs are a relatively obvious mapping from the C++ ones. You can
use the command "pydoc ns3" to get an overview of classes and methods [1].
- How are we going to (initially and eventually) document the Python API if
> bindings are automagically generated?
I have no idea :-)
I do not think it is crucial to document the Python bindings; just pointing
to the C++ docs is not a bad solution for now. Some day it could be nice to
extract the doxygen comment strings and use them to generate python
docstrings, so that pydoc would show full docs. But to be honest I think
there are more important things to do right now in NS-3 than python bindings
documentation.
[1] there is only one caveat: nested modules, like ns3.olsr, are not
automatically listed by 'pydoc ns3', you have to know they are there and do
e.g. 'pydoc ns3.olsr'. I submitted a patch to try to resolve the issue, but
it needs more work: http://bugs.python.org/issue1715
--
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert
More information about the Ns-developers
mailing list