Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Conflicts:
#	pyproject.toml
  • Loading branch information
TheVinhLuong102 committed May 22, 2023
2 parents 5dbdfdc + dd1d167 commit c4858a0
Show file tree
Hide file tree
Showing 60 changed files with 1,353 additions and 664 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Build Python package and docs
on:
push:
tags-ignore:
- "*"
- '**'
pull_request:
paths:
- doc/**
Expand All @@ -20,19 +20,11 @@ on:
jobs:
build:

runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8, 3.9]

runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install poetry
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-ide-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
publish_ide_docs:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Ubuntu packages
run: |
Expand All @@ -17,16 +17,16 @@ jobs:
with:
submodules: recursive
- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install poetry
poetry run python -m pip install --upgrade pip
poetry run python -m pip install --upgrade setuptools
poetry install
- uses: actions/setup-node@v1
poetry install --only=doc
- uses: actions/setup-node@v3
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
Expand Down
26 changes: 26 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "3.10"
jobs:
post_create_environment:
- pip install poetry
- poetry config virtualenvs.create false
post_install:
- poetry install --only=doc

# Build documentation in the doc/main/ directory with Sphinx
sphinx:
configuration: doc/main/conf.py
fail_on_warning: true

# Optionally build your docs in additional formats such as PDF
formats:
- pdf
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"ms-python.python"
"ms-python.python",
"ms-python.black-formatter"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
},
"python.defaultInterpreterPath": ".venv/bin/python",
"python.autoComplete.extraPaths": ["jedi/src"],
"python.formatting.provider": "black",
"python.formatting.provider": "none",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.pycodestyleEnabled": false,
"python.linting.enabled": true,
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-python.python"
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.languageServer": "Pylance",
"python.testing.pytestArgs": [
Expand Down
25 changes: 21 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,29 @@

## Unreleased

## 3.3.0b5 - 2023-05-16

### Added
- Documented new `hub.ble` methods.

## 3.3.0b4 - 2023-04-21

### Added
- Documented `positive_direction` in `DriveBase`.
- Document deceleration setter in `DriveBase`.
- Documented ``integral_deadzone`` in ``Control.pid()``.
- Documented ``Motor.model``. This can be used to view the estimated motor
- Documented `integral_deadzone` in `Control.pid()`.
- Documented `Motor.model`. This can be used to view the estimated motor
state and change its settings.
- Added `rotation`, `orientation`, `ready`, `stationary` and `settings` methods
to `IMU` class.
- Added `GyroDriveBase` class to `pybricks.robotics`.

### Changed
- Change implementation status of `IMU.heading` and `IMU.reset_heading`. They
are now implemented, with some limitations as noted in a note box.
- Moved `Matrix` and `vector` from `pybricks.geometry` to `pybricks.tools`.
- Moved `Axis` from `pybricks.geometry` to `pybricks.parameters`.

### Removed
- Removed `pybricks.geometry` module.

## 3.2.0 - 2022-12-20

Expand Down
3 changes: 2 additions & 1 deletion doc/common/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,11 @@ def on_missing_reference(
app.builder, node["refdoc"], "signaltypes", "numbers", contnode
)

# References with special characters can't exist, so we have to supress
# References with special characters can't exist, so we have to suppress
# warnings when Sphinx tries to cross reference units like deg/s. For
# consistency, we also treat units without special characters this way.
for unit in [
"dBm",
"deg",
"deg/s",
"deg/s²",
Expand Down
9 changes: 4 additions & 5 deletions doc/common/extensions/requirements-static.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

# Medium feature set.
FEATURES_MEDIUM = FEATURES_SMALL | {
"pybricks-geometry",
"pybricks-common-control",
"pybricks-iodevices",
"stm32-extra",
Expand All @@ -24,10 +23,10 @@
HUB_FEATURES = {
"movehub": {"movehub"} | FEATURES_SMALL,
"cityhub": {"cityhub"} | FEATURES_MEDIUM,
"technichub": {"technichub"} | FEATURES_MEDIUM,
"primehub": {"primehub", "inventorhub", "light-matrix"} | FEATURES_LARGE,
"inventorhub": {"primehub", "inventorhub", "light-matrix"} | FEATURES_LARGE,
"essentialhub": {"essentialhub"} | FEATURES_LARGE,
"technichub": {"technichub", "gyro"} | FEATURES_MEDIUM,
"primehub": {"primehub", "inventorhub", "light-matrix", "gyro"} | FEATURES_LARGE,
"inventorhub": {"primehub", "inventorhub", "light-matrix", "gyro"} | FEATURES_LARGE,
"essentialhub": {"essentialhub", "gyro"} | FEATURES_LARGE,
}


Expand Down
6 changes: 3 additions & 3 deletions doc/main/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# General information about the project.
project = "pybricks"
copyright = "2018-2021 The Pybricks Authors"
copyright = "2018-2023 The Pybricks Authors"
author = ""

_TITLE = "Pybricks Modules and Examples"
Expand All @@ -29,7 +29,7 @@
# HACK: this allows Number type alias to be imported by Sphinx
os.environ["SPHINX_BUILD"] = "True"

# Addtional configuration of the IDE docs
# Additional configuration of the IDE docs
if "ide" in tags.tags: # noqa F821
_DISCLAIMER = ""
html_show_copyright = False
Expand All @@ -45,7 +45,7 @@

exec(open(os.path.abspath("../common/conf.py")).read())

# Addtional configuration of the IDE docs
# Additional configuration of the IDE docs
if "ide" in tags.tags: # noqa F821

extensions.remove("sphinx.ext.mathjax") # noqa F821
Expand Down
4 changes: 2 additions & 2 deletions doc/main/ev3devices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ Motors

.. rubric:: Measuring

.. automethod:: pybricks.ev3devices.Motor.speed

.. automethod:: pybricks.ev3devices.Motor.angle

.. automethod:: pybricks.ev3devices.Motor.reset_angle

.. automethod:: pybricks.ev3devices.Motor.speed

.. automethod:: pybricks.ev3devices.Motor.load

.. automethod:: pybricks.ev3devices.Motor.stalled
Expand Down
51 changes: 0 additions & 51 deletions doc/main/geometry.rst

This file was deleted.

22 changes: 22 additions & 0 deletions doc/main/hubs/cityhub.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ City Hub

.. automethod:: pybricks.hubs::CityHub.light.animate

.. rubric:: Using connectionless Bluetooth messaging

``ble.broadcast()`` does not work on ``CityHub`` due to a bug in the
Bluetooth chip firmware.

.. automethod:: pybricks.hubs::CityHub.ble.observe

.. automethod:: pybricks.hubs::CityHub.ble.signal_strength

.. automethod:: pybricks.hubs::CityHub.ble.version

.. rubric:: Using the battery

.. automethod:: pybricks.hubs::CityHub.battery.voltage
Expand Down Expand Up @@ -70,6 +81,17 @@ Creating light animations
.. literalinclude::
../../../examples/pup/hub_common/build/light_animate_cityhub.py


Bluetooth examples
------------------

Observing data from other hubs
******************************

.. literalinclude::
../../../examples/pup/hub_common/build/ble_observe_cityhub.py


Button and system examples
----------------------------------

Expand Down
37 changes: 37 additions & 0 deletions doc/main/hubs/essentialhub.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Essential Hub

.. rubric:: Using the IMU

.. automethod:: pybricks.hubs::EssentialHub.imu.ready

.. automethod:: pybricks.hubs::EssentialHub.imu.stationary

.. automethod:: pybricks.hubs::EssentialHub.imu.up

.. automethod:: pybricks.hubs::EssentialHub.imu.tilt
Expand All @@ -37,6 +41,22 @@ Essential Hub

.. automethod:: pybricks.hubs::EssentialHub.imu.reset_heading

.. automethod:: pybricks.hubs::EssentialHub.imu.rotation

.. automethod:: pybricks.hubs::EssentialHub.imu.orientation

.. automethod:: pybricks.hubs::EssentialHub.imu.settings

.. rubric:: Using connectionless Bluetooth messaging

.. automethod:: pybricks.hubs::EssentialHub.ble.broadcast

.. automethod:: pybricks.hubs::EssentialHub.ble.observe

.. automethod:: pybricks.hubs::EssentialHub.ble.signal_strength

.. automethod:: pybricks.hubs::EssentialHub.ble.version

.. rubric:: Using the battery

.. automethod:: pybricks.hubs::EssentialHub.battery.voltage
Expand Down Expand Up @@ -126,6 +146,23 @@ Reading acceleration and angular velocity on one axis
.. literalinclude::
../../../examples/pup/hub_common/build/imu_read_scalar_essentialhub.py


Bluetooth examples
------------------

Broadcasting data to other hubs
*******************************

.. literalinclude::
../../../examples/pup/hub_common/build/ble_broadcast_essentialhub.py

Observing data from other hubs
******************************

.. literalinclude::
../../../examples/pup/hub_common/build/ble_observe_essentialhub.py


System examples
----------------------------------

Expand Down
Loading

0 comments on commit c4858a0

Please sign in to comment.