Commits

German Larrain committed 8725f06

app.Program: added Sphinx format to some docstrings

Comments (0)

Files changed (1)

ars/app/__init__.py

 	which will be called during the simulation creation.
 
 	To use it, only two statements are necessary:
-	-create an object of this class (i.e. sim_program = ProgramSubclass() )
-	-call its 'start' method (i.e. sim_program.start() )
+
+	* create an object of this class
+		>>> sim_program = ProgramSubclass()
+	* call its 'start' method
+		>>> sim_program.start()
 
 	"""
 
 	def __init__(self):
 		"""Constructor. Defines some attributes and calls some initialization
 		methods to:
-		-sets the basic mapping of key to action,
-		-create the visualization window according to class constants,
-		-create the simulation.
+
+		* set the basic mapping of key to action,
+		* create the visualization window according to class constants,
+		* create the simulation.
 
 		"""
 		self.do_create_window = True
 
 	def create_simulation(self, add_axes=True, add_floor=True):
 		"""Creates an empty simulation and:
-		-adds basic simulation objects (:meth:`add_basic_simulation_objects`),
-		-(if ``add_axes`` is ``True``) adds axes to the visualization at the
-		coordinates-system origin,
-		-(if ``add_floor`` is ``True``) adds a floor with a defined normal
-		vector and some visualization parameters,
-		-calls :meth:`create_sim_objects` (which must be implemented by
-		subclasses),
-		-gets the actors representing the simulation objects and adds them to
-		the graphics adapter.
+
+		#. adds basic simulation objects (:meth:`add_basic_simulation_objects`),
+		#. (if ``add_axes`` is ``True``) adds axes to the visualization at the
+			coordinates-system origin,
+		#. (if ``add_floor`` is ``True``) adds a floor with a defined normal
+			vector and some visualization parameters,
+		#. calls :meth:`create_sim_objects` (which must be implemented by
+			subclasses),
+		#. gets the actors representing the simulation objects and adds them to
+			the graphics adapter.
 
 		"""
 		# set up the simulation parameters
 	def create_sim_objects(self):
 		"""This method must be overriden (at least once in the inheritance tree)
 		by the subclass that will instatiated to run the simulator.
+
 		It shall contain statements calling its 'sim' attribute's methods for
-		adding objects (e.g. add_sphere). For example:
-		self.sim.add_sphere(0.5, (1,10,1), density=1)
+		adding objects (e.g. add_sphere).
+
+		For example:
+
+		>>> self.sim.add_sphere(0.5, (1,10,1), density=1)
 
 		"""
 		raise NotImplementedError()