Skip to content

Commit

Permalink
Removing sfx error message and updating doc
Browse files Browse the repository at this point in the history
  • Loading branch information
philkr committed Sep 22, 2021
1 parent 7233e62 commit 253ef48
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 50 deletions.
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ help:
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

rst: Makefile
@$(SPHINXBUILD) -M rst "$(SOURCEDIR)/auto" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M rst "$(SOURCEDIR)/auto" "$(BUILDDIR)" $(SPHINXOPTS) -E $(O)
cp -f "$(BUILDDIR)"/rst/*.grst auto/

1 change: 1 addition & 0 deletions docs/auto/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
'rst',
]

autodoc_docstring_signature = True
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down
18 changes: 18 additions & 0 deletions docs/auto/graphicsconfig.grst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
Low-definition graphics settings


.. py:method:: none () -> pystk.GraphicsConfig
:staticmethod:

Disable graphics and rendering


.. py:method:: sd () -> pystk.GraphicsConfig
:staticmethod:

Expand All @@ -40,6 +46,12 @@
Disable specular IBL


.. py:method:: display_adapter () -> int
:property:

GPU to use (Linux only)


.. py:method:: dof () -> bool
:property:

Expand Down Expand Up @@ -88,6 +100,12 @@
Particle effect 0 (none) to 2 (full)


.. py:method:: render () -> bool
:property:

Is rendering enabled?


.. py:method:: screen_height () -> int
:property:

Expand Down
4 changes: 2 additions & 2 deletions docs/auto/log.grst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
.. py:method:: name () -> str
:property:

(self: handle) -> str

.. py:method:: value () -> int
:property:

.. py:attribute:: verbose
:annotation: = 1
Expand Down
6 changes: 3 additions & 3 deletions docs/auto/objecttype.grst
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
.. py:method:: name () -> str
:property:

(self: handle) -> str


.. py:attribute:: nitro
:annotation: = 5

Expand All @@ -41,3 +38,6 @@

.. py:attribute:: unknown
:annotation: = 9

.. py:method:: value () -> int
:property:
4 changes: 2 additions & 2 deletions docs/auto/playerconfig.grst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
.. py:method:: name () -> str
:property:

(self: handle) -> str

.. py:method:: value () -> int
:property:

.. py:method:: controller () -> pystk.PlayerConfig.Controller
:property:
Expand Down
6 changes: 0 additions & 6 deletions docs/auto/race.grst
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@
The current race configuration


.. py:method:: last_action () -> List[pystk.Action]
:property:

the last action the agent took


.. py:method:: render_data () -> List[pystk.RenderData]
:property:

Expand Down
10 changes: 2 additions & 8 deletions docs/auto/raceconfig.grst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
.. py:method:: name () -> str
:property:

(self: handle) -> str

.. py:method:: value () -> int
:property:

.. py:method:: difficulty () -> int
:property:
Expand Down Expand Up @@ -63,12 +63,6 @@
List of all agent players


.. py:method:: render () -> bool
:property:

Is rendering enabled?


.. py:method:: reverse () -> bool
:property:

Expand Down
6 changes: 3 additions & 3 deletions docs/auto/renderdata.grst
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
SuperTuxKart rendering output


.. py:method:: depth () -> array
.. py:method:: depth () -> numpy.ndarray
:property:

Depth image of the kart (memoryview[float] screen_height x screen_width)


.. py:method:: image () -> array
.. py:method:: image () -> numpy.ndarray
:property:

Color image of the kart (memoryview[uint8] screen_height x screen_width x 3)


.. py:method:: instance () -> array
.. py:method:: instance () -> numpy.ndarray
:property:

Instance labels (memoryview[uint32] screen_height x screen_width)
Expand Down
6 changes: 5 additions & 1 deletion docs/auto/rst/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@


def get_text(e):
return ''.join(str(c) for c in e.children)
import docutils
return ''.join(str(c) if isinstance(c, docutils.nodes.Text) else get_text(c) for c in e.children)


def gen_signature(s, indent):
Expand Down Expand Up @@ -117,6 +118,9 @@ def init(self):
def prepare_writing(self, docnames):
pass

def get_target_uri(self, docname: str, typ: str = None):
return docname

def write_doc(self, docname, doctree):
outfilename = path.join(self.outdir, docname+self.file_suffix)
# print "write(%s,%s) -> %s" % (type(doctree), type(destination), outfilename)
Expand Down
20 changes: 8 additions & 12 deletions docs/auto/rst/property.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from sphinx.ext.autodoc import PropertyDocumenter, AttributeDocumenter, ClassLevelDocumenter, SUPPRESS
from sphinx.util import inspect
from typing import Any, Callable, Dict, Iterator, List, Sequence, Set, Tuple, Union


class TypedPropertyDocumenter(PropertyDocumenter): # type: ignore
Expand All @@ -14,9 +12,6 @@ class TypedPropertyDocumenter(PropertyDocumenter): # type: ignore
# before AttributeDocumenter
priority = PropertyDocumenter.priority + 10

def document_members(self, all_members: bool = False) -> None:
pass

def format_signature(self, **kwargs) -> str:
from inspect import signature, getdoc
sig = super().format_signature(**kwargs)
Expand All @@ -27,6 +22,8 @@ def format_signature(self, **kwargs) -> str:

def add_directive_header(self, sig: str) -> None:
super().add_directive_header(sig)
sourcename = self.get_sourcename()
self.add_line(' :property:', sourcename)


class EnumAttributeDocumenter(AttributeDocumenter): # type: ignore
Expand All @@ -40,13 +37,12 @@ def add_directive_header(self, sig: str) -> None:
ClassLevelDocumenter.add_directive_header(self, sig)
sourcename = self.get_sourcename()
if not self.options.annotation:
if not self._datadescriptor:
try:
objrepr = str(int(self.object))
except ValueError:
pass
else:
self.add_line(' :annotation: = ' + objrepr, sourcename)
try:
objrepr = str(int(self.object))
except ValueError:
pass
else:
self.add_line(' :annotation: = ' + objrepr, sourcename)
elif self.options.annotation is SUPPRESS:
pass
else:
Expand Down
22 changes: 11 additions & 11 deletions docs/auto/state.grst
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@
length of the track


.. py:method:: path_distance () -> numpy.ndarray[float32]
.. py:method:: path_distance () -> numpy.ndarray[numpy.float32]
:property:

Distance down the track of each line segment (float N x 2)


.. py:method:: path_nodes () -> numpy.ndarray[float32]
.. py:method:: path_nodes () -> numpy.ndarray[numpy.float32]
:property:

Center line of the drivable area as line segments of 3d coordinates (float N x 2 x 3)


.. py:method:: path_width () -> numpy.ndarray[float32]
.. py:method:: path_width () -> numpy.ndarray[numpy.float32]
:property:

Width of the path segment (float N)
Expand Down Expand Up @@ -118,8 +118,8 @@
.. py:method:: name () -> str
:property:

(self: handle) -> str

.. py:method:: value () -> int
:property:

.. py:method:: aspect () -> float
:property:
Expand Down Expand Up @@ -176,8 +176,8 @@
.. py:method:: name () -> str
:property:

(self: handle) -> str

.. py:method:: value () -> int
:property:

.. py:method:: id () -> int
:property:
Expand Down Expand Up @@ -371,8 +371,8 @@
.. py:method:: name () -> str
:property:

(self: handle) -> str

.. py:method:: value () -> int
:property:

.. py:method:: num () -> int
:property:
Expand Down Expand Up @@ -411,8 +411,8 @@
.. py:method:: name () -> str
:property:

(self: handle) -> str

.. py:method:: value () -> int
:property:

.. py:method:: time_left () -> float
:property:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def ignore(base, entries):

setup(
name='PySuperTuxKart',
version='1.1.1',
version='1.1.2',
author='Philipp Krähenbühl',
author_email='philkr@utexas.edu',
description='Python SuperTuxKart inferface',
Expand Down
1 change: 1 addition & 0 deletions src/tracks/track_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ void TrackObject::init(const XMLNode &xml_node, scene::ISceneNode* parent,
Track::getCurrentTrack()->addMetaLibrary(parent_library, this);
}
}
else if (type == "sfx-emitter") {}
else if (type == "action-trigger")
{
std::string action;
Expand Down

0 comments on commit 253ef48

Please sign in to comment.