diff --git a/.github/workflows/docs-cd.yml b/.github/workflows/docs-cd.yml index 39cb961..a93371c 100644 --- a/.github/workflows/docs-cd.yml +++ b/.github/workflows/docs-cd.yml @@ -39,7 +39,6 @@ jobs: python -m pip install --upgrade pip pip install -e . pip install -r requirements.txt - pip install -r docs/requirements.txt - name: Generate API stubs run: | diff --git a/README.md b/README.md index c464da0..478b294 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ self.neo_pixel.change_color(255, 128, 0) Sphinx documentation lives in `docs/` and is auto-generated on pushes to `dev` via GitHub Actions, then deployed to GitHub Pages. To build locally: ```bash -pip install -r docs/requirements.txt +pip install -r requirements.txt sphinx-apidoc -o docs/api src/robot python -m sphinx -b html docs docs/_build/html open docs/_build/html/index.html diff --git a/docs/installation.md b/docs/installation.md index 629df15..fdd5534 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -25,7 +25,7 @@ pip install -e . From the repository root: ```bash -pip install -r docs/requirements.txt +pip install -r requirements.txt sphinx-apidoc -o docs/api src/robot python -m sphinx -b html docs docs/_build/html ``` @@ -33,7 +33,7 @@ python -m sphinx -b html docs docs/_build/html Or from inside the `docs/` directory: ```bash -pip install -r requirements.txt +pip install -r ../requirements.txt make apidoc make html ``` diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index cd61286..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -furo==2025.12.19 -Sphinx==9.1.0 -myst-parser==4.0.1 -sphinx-autodoc-typehints==3.6.3 -sphinx-autobuild==2025.8.25 -sphinx_rtd_theme==3.1.0 diff --git a/requirements.txt b/requirements.txt index 1c5ba72..29964f4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,10 @@ flake8==7.3.0 +furo==2025.12.19 +myst-parser==4.0.1 packaging==25.0 paho-mqtt==2.1.0 pytest==8.4.2 +Sphinx==8.2.3 +sphinx-autobuild==2025.8.25 +sphinx-autodoc-typehints<3 +sphinx_rtd_theme==3.1.0 diff --git a/src/robot/helpers/motion_controller.py b/src/robot/helpers/motion_controller.py index 09df5d8..059195f 100644 --- a/src/robot/helpers/motion_controller.py +++ b/src/robot/helpers/motion_controller.py @@ -49,7 +49,7 @@ def publish_coordinate(self): pass coordinate = _StubCoord() # type: ignore[assignment] - self.c = coordinate # type: ignore[assignment] + self.c: Coordinate = coordinate # type: ignore[assignment] # Wrappers ----------------------------------------------------------- def move( @@ -86,9 +86,7 @@ def rotate_degree(self, speed: int, degree: float) -> None: 2 * math.pi * RobotSettings.ROBOT_RADIUS * (abs(degree) / 360) ) * self.CM_2_MM duration = float(distance / abs(speed)) * self.SEC_2_MS - self._debug( - f"Sign: {sign} Distance: {distance} Duration: {duration}" - ) + self._debug(f"Sign: {sign} Distance: {distance} Duration: {duration}") self._rotate(sign * speed, duration) except MotionControllerException: # noqa: F841 pass @@ -104,13 +102,11 @@ def _move( duration: float, ) -> None: if not ( - self._is_speed_in_range(left_speed) - and self._is_speed_in_range(right_speed) + self._is_speed_in_range(left_speed) and self._is_speed_in_range(right_speed) ): try: raise MotionControllerException( - "One of the provided speeds is out of " - "range in move() function" + "One of the provided speeds is out of range in move() function" ) except MotionControllerException: return @@ -128,10 +124,7 @@ def _move( x = self.c.get_x() + d * math.cos(h) y = self.c.get_y() + d * math.sin(h) - heading = ( - self.c.get_heading_rad() - + (dR - dL) / (RobotSettings.ROBOT_WIDTH) - ) + heading = self.c.get_heading_rad() + (dR - dL) / (RobotSettings.ROBOT_WIDTH) self.c.set_coordinate_heading(x, y, math.degrees(heading)) @@ -154,8 +147,7 @@ def _move( def _is_speed_in_range(self, speed: int) -> bool: if speed > 0: return ( - RobotSettings.ROBOT_SPEED_MIN <= speed - <= RobotSettings.ROBOT_SPEED_MAX + RobotSettings.ROBOT_SPEED_MIN <= speed <= RobotSettings.ROBOT_SPEED_MAX ) elif speed < 0: return (