Ticket #29 (new defect)

Opened 19 months ago

Last modified 3 weeks ago

Add python docstrings to boost:python bindings

Reported by: artem Owned by: artem
Priority: critical (top) Milestone: 1.0.0
Component: Boost.Python Binding Version: SVN Trunk
Severity: Normal Keywords:
Cc: springmeyer, lwu Patch Needs Improvement: no
Needs Docmentation: no Has Patch?: no
Design Decision Needed: no

Description (last modified by springmeyer) (diff)

Add missing doc strings to core objects e.g Style,Rule,Filter,Datasource etc.

Attachments

python_layer_docstrings.patch (9.9 kB) - added by springmeyer 7 weeks ago.
First attempt at a draft example of boost::python docstrings (this one for mapnik.Layer)
python_map_docstrings.patch (12.0 kB) - added by springmeyer 7 weeks ago.
Docstring for map object in boost::python

Change History

Changed 11 months ago by artem

  • milestone changed from 0.5.0 to 1.0.0

Changed 4 months ago by springmeyer

  • cc springmeyer, lwu added

I think this is really, really important.

I could help with this given a bit of guidance from those familiar with boost python syntax. Perhaps we could focus on one set of really good docstrings for say:

import mapnik
help(mapnik.Map)

To use as a guide to follow.

Thoughts?

Changed 4 months ago by springmeyer

  • priority set to critical (top)

Changed 7 weeks ago by springmeyer

First attempt at a draft example of boost::python docstrings (this one for mapnik.Layer)

Changed 7 weeks ago by springmeyer

  • has_patch unset
  • patch_need_improvement unset
  • need_documentation unset
  • design_decision_needed unset

The sample patch tries to do a few things I'd like feedback on:

1) Reorders the def and properties in the order the user sees them when they call help(mapnik.Layer), just to make it easier for the docstring writer to make sure all things are accounted for. 2) Implements the convention of 4 space indents (I'm not sure how the rest of mapnik C++ code works but I'll look around) 3) Adds docstrings to the init() function as well as class functions 4) Adds sample usage with a few comments

I'm hoping to understand the best approach with the Layer class as an example, so any further work can be systematic...

Changed 7 weeks ago by springmeyer

Docstring for map object in boost::python

Changed 7 weeks ago by springmeyer

layer docstrings committed in r763 map docstrings committed in r767

Changed 7 weeks ago by springmeyer

  • description modified (diff)

Changed 7 weeks ago by springmeyer

r768 shows some tab fixes for the python docstrings in source:trunk/bindings/python/mapnik_map.cpp which I'll check out and try to match in the other files.

Today I also skimmed http://www.python.org/doc/essays/styleguide.html which looks like it will provide some further guidance on how to write appropriate docstrings

Changed 3 weeks ago by springmeyer

  • description modified (diff)
  • summary changed from Doc strings to Add python docstrings to boost:python bindings
Note: See TracTickets for help on using tickets.