Skip to content

Convert docstrings to NumPy style#169

Open
dhruvildarji wants to merge 1 commit intof1tenth:mainfrom
dhruvildarji:docs/numpy-style-docstrings
Open

Convert docstrings to NumPy style#169
dhruvildarji wants to merge 1 commit intof1tenth:mainfrom
dhruvildarji:docs/numpy-style-docstrings

Conversation

@dhruvildarji
Copy link
Copy Markdown

Summary

  • Converts all docstrings in the core gym environment files from Google-style (Args:/Returns:) to NumPy-style (Parameters/Returns with underline separators)
  • Covers all 6 core source files: f110_env.py, base_classes.py, dynamic_models.py, laser_models.py, collision_models.py, rendering.py
  • No functional code changes — only docstring formatting

Closes #156

Files changed

File Description
f110_env.py F110Env class (main gym environment)
base_classes.py RaceCar and Simulator classes
dynamic_models.py Vehicle dynamics functions (accl_constraints, steering_constraint, vehicle_dynamics_ks, vehicle_dynamics_st, pid)
laser_models.py Scan simulation (ScanSimulator2D, ray tracing, iTTC checks)
collision_models.py GJK collision detection (collision, collision_multiple, get_vertices)
rendering.py EnvRenderer class (pyglet rendering)

Example

Before (Google style):

def reset(self, pose):
    """
    Resets the vehicle to a pose

        Args:
            pose (np.ndarray (3, )): pose to reset the vehicle to

        Returns:
            None
    """

After (NumPy style):

def reset(self, pose):
    """
    Resets the vehicle to a pose

    Parameters
    ----------
    pose : np.ndarray (3,)
        Pose to reset the vehicle to [x, y, theta].
    """

Test plan

  • Verify no functional code changes (only docstring formatting)
  • Spot-check converted docstrings for correctness

Convert all docstrings in the core gym environment files from
Google-style (Args/Returns) to NumPy-style (Parameters/Returns
with underline separators) format, as requested in f1tenth#156.

Files converted:
- f110_env.py (F110Env class)
- base_classes.py (RaceCar, Simulator classes)
- dynamic_models.py (vehicle dynamics functions)
- laser_models.py (scan simulation, ray casting)
- collision_models.py (GJK collision detection)
- rendering.py (EnvRenderer class)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert to Numpy style docstrings

1 participant