Question

I would like to make a documentation for an API called Ulyxes PyAPI. I have already started it, but the auto-generation process is not working. When I click Automated Generated Document link in my index.html page, I am referred to an empty page having no information about my class and functions of class
Actually, I have a 10+ python file in my API, each file consists a class which models measuring sensors(robot total stations, GPS, etc). In this question I only write a little part of it in order to make my problem understandable.

I am of the opinion that, either code.rst or leicameasureunit.py is wrong...

The *.py and *.srt files are in the same directory which is my working directory. I use windows 7 operation system.

Thank you very much!

...\UlyxesPyApiDoc:

The files are the following:

index.srt:

.. Ulyxes PyAPI  documentation master file, created by
   sphinx-quickstart on Mon Oct 21 20:53:48 2013.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to Ulyxes PyAPI 's documentation!
=========================================

 Ulyxes is an open source project to drive robotic total stations (RTS) and other
 sensors and publish observation results on web based maps (GPL 2).

 Requirmenets:

 Contents:

 .. toctree::
     :maxdepth: 2

     project
     tutorial
     code

  Indices and tables
  ==================

  * :ref:`genindex`
  * :ref:`modindex`
  * :ref:`search`

code.rst:

Auto Generated Documentation
============================

.. autoclass:: leicameasureunit
    :members:

project.srt:

Project Summary
===============

Goals Achieved
--------------

Goal 1 to create a framework to drive robotic total stations from a computer and      publish data on the Internet

Goal 2 we want to create a framework not a ready to use application

Goal 3 the project is based on several other open source projects

tutorial.srt:

Tutorial for driving RTSs
=========================

This is a short description about how to drive RTSs via serial port from PC/laptop

leicameasureunit.py:`

"""
Created on 29 July 2012
@author: Dani Moka
"""

from measureunit import *
from angle import *
import re

class LeicaMeasureUnit(MeasureUnit):
"""
This class models Leica robotic totals stations
""" 
def __init__(self, name = 'Leica generic', type = 'TPS'):
    # call super class init
    super(LeicaMeasureUnit, self).__init__(name, type)

def MoveMsg(self, hz, v, units='RAD', atr=0):
    """
    This function make instruments moving.

    :arguments:
      hz
       Direction 1
      units
       uints in default RAD
    """
    hz_rad = Angle(hz, units).GetAngle('RAD')
    v_rad = Angle(v, units).GetAngle('RAD')
    return '%%R1Q,9027:%f,%f,0,%d,0' % (hz_rad, v_rad, atr)

def SetATRMsg(self, atr):
    """
    This function used for setting Automatic Target Recognition

    :arguments:
      atr
       1 - on / 2 - off
      units
       1 - on / 2 - off
    """
    return '%%R1Q,9018:%d' % (atr)

def GetATRMsg(self):
    """
    This function used for getting the  status of Automatic Target Recognition
    """
    return '%R1Q,9019:'

`

Was it helpful?

Solution

In code.rst, it says

.. autoclass:: leicameasureunit

It does not work since there is no class of that name. In order to document the leicameasureunit module, use

.. automodule:: leicameasureunit

The module contains a class called LeicaMeasureUnit, so you could use

.. autoclass:: leicameasureunit.LeicaMeasureUnit

to document just that class.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top