Compare commits

..
Author SHA1 Message Date
David Lechner dd77c548d2 v3.1.0 2021-12-16 15:35:09 -06:00
David Lechner 022afabd30 pybricks.robotics: add type hint for curve()
This method was added in 30803fc.
2021-12-16 15:33:00 -06:00
David Lechner ce17123325 pybricks._common: remove type hint for integral_range()
This was removed in e061617.

Also fix import of Axis while we are touching this file.
2021-12-16 15:29:44 -06:00
Laurens Valk f2346df4e5 pybricks.iodevices: Hide LWP3Device
This is not part of the upcoming release.

Hiding is nicer than adding not-ready disclaimers throughout, especially since this information is very easy to access via our beta channel.
2021-12-01 15:39:05 +01:00
Laurens Valk 94c659ba6d pybricks.geometry: Hide module and IMU examples.
This is not part of the upcoming release.

Hiding is nicer than adding not-ready disclaimers throughout, especially since this information is very easy to access via our beta channel.
2021-12-01 15:39:04 +01:00
Laurens Valk 9c0298bad0 doc/main/index: Drop beta note.
This is a normal release.
2021-12-01 15:39:04 +01:00
Laurens Valk 602b21fe9d doc/main/hubs: Hide Prime Hub.
This is not part of the upcoming release.

Hiding is nicer than adding not-ready disclaimers throughout, especially
since this information is very easy to access via our beta channel.
2021-12-01 15:39:04 +01:00
598 changed files with 7326 additions and 16388 deletions
+12 -16
View File
@@ -3,28 +3,24 @@
name: Build Python package and docs
on:
push:
tags-ignore:
- '**'
pull_request:
paths:
- doc/**
- src/**
- poetry.lock
- poetry.toml
- pyproject.toml
- setup.cfg
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
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
@@ -39,7 +35,7 @@ jobs:
run: poetry run doc8
- name: Build html docs for Read the Docs
run: poetry run make -C doc html
- name: Install IDE docs dependencies
- name: Instal IDE docs dependencies
run: |
sudo apt-get update
sudo apt-get install dvisvgm preview-latex-style texlive texlive-fonts-extra texlive-latex-extra
-30
View File
@@ -1,30 +0,0 @@
name: pybricks_jedi
on: [push, pull_request]
jobs:
test:
if: github.ref_type != 'tag'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: pipx install poetry
- run: poetry install
working-directory: ./jedi
- run: poetry run pytest -vv
working-directory: ./jedi
publish:
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'pybricks_jedi/')
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: pipx install poetry
- run: poetry install
working-directory: ./jedi
- run: poetry build
working-directory: ./jedi
- run: poetry publish
working-directory: ./jedi
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_PYBRICKS_JEDI_TOKEN }}
+5 -5
View File
@@ -7,17 +7,17 @@ on:
jobs:
publish_ide_docs:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
steps:
- name: Ubuntu packages
run: |
sudo apt-get update
sudo apt-get install -y dvisvgm preview-latex-style texlive texlive-fonts-extra texlive-latex-extra
- uses: actions/checkout@v3
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
@@ -25,8 +25,8 @@ jobs:
pip install poetry
poetry run python -m pip install --upgrade pip
poetry run python -m pip install --upgrade setuptools
poetry install --only=doc
- uses: actions/setup-node@v3
poetry install
- uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
-23
View File
@@ -1,23 +0,0 @@
name: Release @pybricks/images
on:
push:
tags:
- '@pybricks/images/**'
jobs:
publish_ide_docs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: ./build.py
working-directory: npm/images
- run: yarn publish
working-directory: npm/images/build
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
-23
View File
@@ -1,23 +0,0 @@
name: Release @pybricks/jedi
on:
push:
tags:
- '@pybricks/jedi/**'
jobs:
publish_jedi:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: ./build.py
working-directory: npm/jedi
- run: yarn publish
working-directory: npm/jedi/build
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
+11 -4
View File
@@ -6,10 +6,17 @@ on:
jobs:
build_and_publish:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: pipx run poetry build
- run: pipx run poetry publish
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: 1.1.6
- run: poetry install
- run: poetry build
- run: poetry publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
+1 -9
View File
@@ -26,9 +26,8 @@ build/
build-*/
_build/
# Tests
# Test failure outputs
######################
.pytest_cache/
tests/*.exp
tests/*.out
@@ -58,10 +57,3 @@ genrst/
# Virtual environment
######################
.venv/
.python-version
# Generated LDRAW output
######################
stderr-ldview
stdout-ldview
LPub3D/
+22
View File
@@ -0,0 +1,22 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
#
# Settings in the readthedocs online dashboard will be ignored.
# Required
version: 2
# Build documentation in the doc/main directory with Sphinx
sphinx:
configuration: doc/main/conf.py
# Build your docs in additional formats such as PDF
formats:
- pdf
# Set the version of Python and requirements required to build the docs
python:
version: 3.8
install:
- requirements: rtd-requirements.txt
-25
View File
@@ -1,25 +0,0 @@
# .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
# Optionally build your docs in additional formats such as PDF
formats:
- pdf
+1 -2
View File
@@ -4,8 +4,7 @@
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"ms-python.python",
"ms-python.black-formatter"
"ms-python.python"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [
+4 -25
View File
@@ -1,24 +1,10 @@
{
"files.exclude": {
"**/__pycache__": true,
},
"python.defaultInterpreterPath": ".venv/bin/python",
"python.autoComplete.extraPaths": ["jedi/src"],
"python.formatting.provider": "none",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.pythonPath": "${workspaceFolder}/.venv",
"python.formatting.provider": "black",
"python.linting.pycodestyleEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.enabled": true,
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.languageServer": "Pylance",
"python.testing.pytestArgs": [
"jedi/tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"files.associations": {"*.inc": "restructuredtext"},
"restructuredtext.confPath": "${workspaceFolder}/doc/main",
"spellright.language": [
@@ -48,12 +34,5 @@
"plaintext",
"python",
"restructuredtext",
],
"rewrap.wrappingColumn": 78,
"python.analysis.extraPaths": [
"jedi/src"
],
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "file:///home/david/work/pybricks/pybricks-api/.github/workflows/build.yml"
},
]
}
-1
View File
@@ -78,4 +78,3 @@ thermistor
toctree
TODO
UART
utf-8
-123
View File
@@ -2,129 +2,6 @@
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
## Unreleased
## 3.3.0 - 2023-11-24
### Changed
- Bump beta version to release version with no further changes.
## 3.3.0c1 - 2023-11-20
## Added
- Enabled tilt and orientation config for `MoveHub()`.
- Documented `Motor.close()`
## Fixed
- Fixed missing awaitable for `Remote.light` and LWP3 writes.
## 3.3.0b9 - 2023-10-26
### Changed
- Changed the beta feature for using the hub's gyro. Gyro control can now be
toggled using `use_gyro` instead of using a separate `GyroDriveBase` class.
- Documentation updates to match firmware 3.3.0b5--3.3.0b9 updates.
## Added
- Added `set` to `ubuiltins` module.
- Basic multitasking docs.
- Awaitable keyword for awaitable methods and functions.
## 3.3.0b5 - 2023-05-16
### Added
- Documented new `hub.ble` methods.
## 3.3.0b4 - 2023-04-21
### Added
- 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
### Changed
- Changed module TOC headings to make it easier to find things.
## 3.2.0c1 - 2022-12-09
### Changed
- Updated "front" side of the Technic Hub to be consistent with
the Prime Hub.
## 3.2.0b6 - 2022-12-02
### Added
- Documented ``Stop.NONE`` and ``Stop.COAST_SMART``.
- Documented ``ujson`` module.
- Added `done` and `stalled` methods for `DriveBase`.
### Changed
- Changed `PrimeHub.display.image()` to `PrimeHub.display.icon()` and renamed
its kwarg from `image` to `icon`.
- Improved presentation and docstrings of the ``ubuiltins`` and other
MicroPython modules
- Moved the random numbers example for Move Hub to the Move Hub page.
- Moved `done()`, `stalled()`, `load()` from `Control` to `Motor` object.
## 3.2.0b5 - 2022-11-11
### Fixed
- Fixed Jedi code completion for `Color` and `Icon` classes in `pybricks.parameters`.
## 3.2.0b4 - 2022-10-21
### Added
- Code auto-completion for `EssentialHub`.
- Added `System.storage` method.
### Fixed
- Fixed some type hints in `parameters` submodule.
## 3.2.0b1-r3 - 2022-06-26
### Fixed
- Fixed more type hints and improved compatibility with jedi.
## 3.2.0b1-r2 - 2022-06-24
### Changed
- Moved remaining type hints from `.pyi` files to the python stub modules, and
fixed numerous errors in the type hints throughout.
## 3.2.0b1-r1 - 2022-06-09
## Added
- Added `__init__.py` to `pybricks` package.
## 3.2.0b1 - 2022-06-02
### Added
- Code auto-completion for `hub.charger`, `hub.imu` and `hub.system`.
- Moved typing from several `.pyi` files to the actual python modules.
### Fixed
- Fixed code completion for `DCMotor` and `Motor` classes in MS Python VS Code extension.
- Fixed missing `DCMotor` type in `ev3devices`.
- Fixed type hint for `Motor.reset_angle()` in `pupdevices`.
### Changed
- Setter for acceleration can now also be used to set acceleration and
deceleration to different values, using a two-valued tuple.
## 3.1.0 - 2021-12-16
### Added
+5 -82
View File
@@ -32,91 +32,14 @@ will actually be implemented.
- pybricks.tools.wait: Add example of waiting.
- pybricks.pupdevices: Fix all sensor class ports.
- umath.sin: Fix spelling of Hypotenuse.
- If an import path makes no sense, just use the file path without
extensions:
- If an import path makes no sense, just use the file path without extensions:
- .vscode/settings: Fix file associations.
- The subject briefly describes _what_ was changed. Use a short full sentence
as in the examples above.
- The subject briefly describes _what_ was changed. Use a short full sentence as in the examples above.
- The body describes _why_ the change was made, e.g. `The word "sensor" was
spelled incorrectly`.
[commits]: https://github.com/pybricks/pybricks-api/commits/master
**General docstring principles:**
The stubs libraries in this repository have two different purposes:
1. Auto-generating documentation with Sphinx. For this purpose, the
documentation should be concise and clear.
2. Provide autocomplete and intellisense in code editors. For this purpose,
the code needs to be 100% correct. This way, computers can parse your code
correctly and tell you when something is wrong.
Since these objectives don't always align, we address these separately in the
stubs library:
1. The first line(s) of the docstring contain the function or method signature
as it should be displayed in the human-readable documentation.
2. The real function signature can be as complex as it needs to be to make it
correct for intellisense. Overloads can be uses if needed.
In the rare case where the docstring signature is the same as the typed
version, we'll still include it for consistency.
**Docstring details:**
Make sure to look at existing function signatures and docstrings for
inspiration when documenting new functionality. As an example, consider:
```python
def run_until_stalled(
self,
speed: Number,
then: Stop = Stop.COAST,
duty_limit: Optional[Number] = None,
) -> int:
"""
run_until_stalled(speed, then=Stop.COAST, duty_limit=None) -> int: deg
Runs the motor at a constant speed until it stalls.
Arguments:
speed (Number, deg/s): Speed of the motor.
then (Stop): What to do after coming to a standstill.
duty_limit (Number, %): Duty cycle limit during this
command. This is useful to avoid applying the full motor
torque to a geared or lever mechanism. If it is ``None``, the
duty limit won't be changed during this command.
Returns:
Angle at which the motor becomes stalled.
"""
```
The real method signature at the top contains the full detail, including the
type of each argument and return value.
The docstring starts with the signature. Use more than one signature if needed
to represent overloaded methods. The signatures are written in the way they
should be displayed in the docs:
- Argument types are omitted because they are also shown with the argument
description below.
- Default values should be given (``then=Stop.COAST``).
- The return type should be given (``-> int``). When applicable, include
the unit of the return value, so it becomes ``-> int: deg``
Then follows a concise description of what this method, function, or class
does.
Then follows a list of arguments:
- For each argument, include the expected type and unit if applicable, e.g.
``(int)`` or ``(Number, deg/s)``.
- Use ``Number`` when ``int`` and ``float`` are both allowed.
- If the description is long, use the indentation shown above.
- Make it readable. Instead
of ``Union[float, SupportsFloat, complex, SupportsComplex]``,
just say _float or complex_.
Then follows a description of the return value. The type is omitted here since
it is already include in the docstring signature.
**Development environment:**
@@ -126,8 +49,8 @@ Prerequisites:
- [Python 3][python]
- [Poetry][poetry]
Information on installing prerequisites can be found on the
[pybricks-micropython contributor's guide][contributing].
Information on installing prerequisites can be found on the [pybricks-micropython
wiki][wiki].
Initial setup:
@@ -167,4 +90,4 @@ Linting:
[git]: https://git-scm.com/
[python]: https://www.python.org/
[poetry]: https://python-poetry.org/
[contributing]: https://github.com/pybricks/pybricks-micropython/blob/master/CONTRIBUTING.md
[wiki]: https://github.com/pybricks-micropython/wiki
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018-2022 The Pybricks Authors
Copyright (c) 2018-2021 The Pybricks Authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
-5
View File
@@ -12,11 +12,6 @@ used to generate the `official documentation`_.
See the `contributor's guide <CONTRIBUTING.md>`_ for acceptable changes and
instructions to build the documentation locally.
You can use the API stubs in this repository for syntax highlighting and code
completion when programming the EV3 with VS Code. To enable, remove the
``"python.languageServer"="None"`` line in the ``.vscode/settings.json`` file
generated by the *LEGO® MINDSTORMS® EV3 MicroPython* extension.
For general discussion, please visit the `support`_ issue tracker.
.. _Pybricks package: pybricks
+3 -3
View File
@@ -11,13 +11,13 @@ TAG = main
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(TAG) $(O)
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) -t $(TAG) $(O)
.PHONY: help Makefile
diagrams:
@$(MAKE) -C "$(SOURCEDIR)"/diagrams_source clean
@$(MAKE) -C "$(SOURCEDIR)"/diagrams_source
@$(MAKE) -C "$(SOURCEDIR)"/diagram_source clean
@$(MAKE) -C "$(SOURCEDIR)"/diagram_source
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
-8
View File
@@ -40,11 +40,3 @@
::-webkit-scrollbar-thumb:hover {
background: #182026;
}
html.writer-html5 .rst-content dl.citation,
html.writer-html5 .rst-content dl.field-list,
html.writer-html5 .rst-content dl.footnote {
display: flex;
flex-direction: column;
grid-template-columns: unset;
}
@@ -41,7 +41,3 @@ span.caption-number:after {
.figure > a.reference.external::after {
content: none !important;
}
.wy-side-nav-search > div.version {
color: hsla(0, 0%, 100%, 0.75);
}
+114 -160
View File
@@ -27,20 +27,21 @@ from docutils import nodes
from docutils.parsers.rst.directives import flag
from docutils.parsers.rst import Directive
from sphinx.application import Sphinx
from sphinx.addnodes import pending_xref
from sphinx.environment import BuildEnvironment
from sphinx.util.nodes import make_refnode
import toml
TOP_DIR = os.path.abspath(os.path.join("..", ".."))
sys.path.insert(0, os.path.join(TOP_DIR, "src"))
sys.path.append(os.path.abspath("../common/extensions"))
TOP_DIR = os.path.abspath(os.path.join('..', '..'))
sys.path.insert(0, os.path.join(TOP_DIR, 'src'))
sys.path.append(os.path.abspath('../common/extensions'))
from pybricks.hubs import EV3Brick # noqa E402
from pybricks.media.ev3dev import Image # noqa E402
from pybricks._common import Speaker # noqa E402
# ON_RTD is whether we are on readthedocs.org
# this line of code grabbed from docs.readthedocs.org
ON_RTD = os.environ.get("READTHEDOCS", None) == "True"
ON_RTD = os.environ.get('READTHEDOCS', None) == 'True'
_pyproject = toml.load(os.path.join(TOP_DIR, "pyproject.toml"))
_pyproject = toml.load(os.path.join(TOP_DIR, 'pyproject.toml'))
# -- General configuration ------------------------------------------------
@@ -52,29 +53,27 @@ _pyproject = toml.load(os.path.join(TOP_DIR, "pyproject.toml"))
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.mathjax",
# Custom Pybricks extensions
"color",
"classlink",
"requirements",
"requirements-static",
"versionchanged",
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'color',
'classlink',
'requirements',
'requirements-static',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ["../common/_templates"]
templates_path = ['../common/_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = ".rst"
source_suffix = '.rst'
# The master toctree document.
master_doc = "index"
master_doc = 'index'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -83,17 +82,17 @@ master_doc = "index"
# The full version, including alpha/beta/rc tags.
release = "v" + _pyproject["tool"]["poetry"]["version"]
# The short X.Y version.
version = re.match(r"(v\d+\.\d+)", release)[0]
version = re.match(r'(v\d+\.\d+)', release)[0]
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "en"
language = None
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "xcode"
pygments_style = 'xcode'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
@@ -101,10 +100,10 @@ todo_include_todos = True
# Figure numbering
numfig = True
numfig_format = {
"figure": "Figure %s",
"table": "Table %s",
"code-block": "Listing %s",
"section": "Section %s",
'figure': 'Figure %s',
'table': 'Table %s',
'code-block': 'Listing %s',
'section': 'Section %s'
}
# Find cross-reference errors
@@ -112,46 +111,59 @@ nitpicky = True
# https://stackoverflow.com/a/30624034/1976323
nitpick_ignore = [
("py:class", "bool"),
("py:class", "bytearray"),
("py:class", "bytes"),
("py:class", "callable"),
("py:class", "dict"),
("py:class", "float"),
("py:class", "int"),
("py:class", "iter"),
("py:class", "list"),
("py:class", "object"),
("py:class", "str"),
("py:class", "tuple"),
("py:exc", "OSError"),
("py:exc", "RuntimeError"),
("py:exc", "TypeError"),
("py:exc", "ValueError"),
('py:class', 'bool'),
('py:class', 'bytearray'),
('py:class', 'bytes'),
('py:class', 'callable'),
('py:class', 'dict'),
('py:class', 'float'),
('py:class', 'int'),
('py:class', 'iter'),
('py:class', 'list'),
('py:class', 'object'),
('py:class', 'str'),
('py:class', 'tuple'),
('py:exc', 'OSError'),
('py:exc', 'RuntimeError'),
('py:exc', 'TypeError'),
('py:exc', 'ValueError'),
]
# not sure why, but this is needed for typing.IO in uselect
nitpick_ignore.append(("py:obj", "typing.IO"))
nitpick_ignore.append(('py:class', 'IO'))
# Workaround until change below is released.
# https://github.com/sphinx-doc/sphinx/commit/86091934db5ec593b4b0c982b7f08f3231ef995b
nitpick_ignore.extend([
('py:class', '0'),
('py:class', '1'),
('py:class', '2'),
('py:class', '3'),
('py:class', 'big'),
('py:class', 'little'),
])
# -- Autodoc options ------------------------------------------------------
autodoc_member_order = "bysource"
autodoc_member_order = 'bysource'
autodoc_default_options = {
"members": True,
"undoc-members": True,
'members': True,
'undoc-members': True,
}
autoclass_content = "both" # This ensures init arguments are not ignored
autoclass_content = 'both' # This ensures init arguments are not ignored
add_module_names = False # Hide module name
# -- Options for HTML output ----------------------------------------------
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
if ON_RTD:
html_theme = 'default'
else:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_context = {
"disclaimer": _DISCLAIMER,
'disclaimer': _DISCLAIMER,
}
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -164,15 +176,14 @@ html_context = {
# documentation.
#
html_theme_options = {
"style_external_links": True,
"logo_only": True,
"style_nav_header_background": "#0088ce", # Pybricks blue
'style_external_links': True,
'logo_only': True,
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["../common/_static"]
html_static_path = ['../common/_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
@@ -180,9 +191,9 @@ html_static_path = ["../common/_static"]
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
"**": [
"relations.html", # needs 'show_related': True theme option to display
"searchbox.html",
'**': [
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
]
}
@@ -192,7 +203,7 @@ html_scaled_image_link = False
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = "Pybricksdoc"
htmlhelp_basename = 'Pybricksdoc'
# -- Options for LaTeX output ---------------------------------------------
@@ -201,12 +212,14 @@ latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
"preamble": r"""
'preamble': r'''
\usepackage{CJKutf8}
\makeatletter
\fancypagestyle{normal}{
@@ -226,46 +239,54 @@ latex_elements = {
\renewcommand{\footrulewidth}{0.4pt}
}
\makeatother
"""
% {
"disclaimer": " ".join((_DISCLAIMER, "©", copyright)),
''' % {
'disclaimer': ' '.join((_DISCLAIMER, '©', copyright)),
},
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
"extraclassoptions": "openany,oneside",
"releasename": "Version",
'extraclassoptions': 'openany,oneside',
'releasename': 'Version',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, "".join([project, "-v", version, ".tex"]), _TITLE, author, "manual"),
(master_doc, ''.join([project, '-v', version, '.tex']), _TITLE,
author, 'manual'),
]
# -- Content control -----------------------------------------------------
exclude_patterns = [
"ev3devices.rst",
"hubs/ev3brick.rst",
"iodevices/analogsensor.rst",
"iodevices/dcmotor.rst",
"iodevices/ev3devsensor.rst",
"iodevices/i2cdevice.rst",
"iodevices/lumpdevice.rst",
"iodevices/uartdevice.rst",
"media.rst",
"messaging.rst",
"nxtdevices.rst",
"tools/datalog.rst",
'ev3devices.rst',
'hubs/ev3brick.rst',
'hubs/primehub.rst',
'geometry.rst',
'iodevices/analogsensor.rst',
'iodevices/dcmotor.rst',
'iodevices/ev3devsensor.rst',
'iodevices/i2cdevice.rst',
'iodevices/lumpdevice.rst',
'iodevices/lwp3device.rst',
'iodevices/uartdevice.rst',
'media.rst',
'messaging.rst',
'nxtdevices.rst',
'tools/datalog.rst'
]
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "pybricks", "Pybricks Documentation", [author], 1)]
man_pages = [
(master_doc, 'pybricks', 'Pybricks Documentation',
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
@@ -274,100 +295,33 @@ man_pages = [(master_doc, "pybricks", "Pybricks Documentation", [author], 1)]
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(
master_doc,
"Pybricks",
"Pybricks Documentation",
author,
"Pybricks",
"One line description of project.",
"Miscellaneous",
),
(master_doc, 'Pybricks', 'Pybricks Documentation',
author, 'Pybricks', 'One line description of project.',
'Miscellaneous'),
]
# -- .. availability:: directive
class AvailabilityDirective(Directive):
has_content = True
option_spec = {
"movehub": flag,
"cityhub": flag,
"technichub": flag,
"ev3dev-stretch": flag,
'movehub': flag,
'cityhub': flag,
'technichub': flag,
'ev3dev-stretch': flag,
}
def run(self):
if not self.options:
raise self.error("Must specify at least one platform.")
raise self.error('Must specify at least one platform.')
# TODO: make links to platform pages
return [
nodes.emphasis(text="Availability: "),
nodes.Text(", ".join(self.options)),
]
def on_missing_reference(
app: Sphinx, env: BuildEnvironment, node: pending_xref, contnode: nodes.Element
) -> nodes.Element:
# The Number type alias is on the Signals and Units page instead of on the
# pybricks.parameters page so normal resolution doesn't work
if node["reftype"] == "class" and node["reftarget"] == "Number":
return make_refnode(
app.builder, node["refdoc"], "signaltypes", "numbers", contnode
)
# 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²",
"mm",
"mm/s",
"mm/s²",
"%",
"mV",
"mA",
"ms",
"mNm",
"Hz",
"°C",
"J",
"Ω",
"N",
]:
try:
# If they match on raw source, we are dealing with argument types.
if unit == contnode.rawsource:
# Return as-is to suppress missing cross reference warning. We
# could make this more fancy by returning an xref node that links
# to the signals page.
return contnode
except AttributeError:
pass
# Return types are denoted as "int: deg"
try:
# Try to unpack the node.
ret_type, ret_unit = str(contnode).split(": ")
except ValueError:
# Not a valid format, so skip.
continue
# If it's a match, we could format the node so it looks a bit nicer.
# For now just keep the colon notation as is.
if unit == ret_unit:
return nodes.Text(f"{ret_type}: {ret_unit}")
return [nodes.emphasis(text='Availability: '),
nodes.Text(', '.join(self.options))]
def setup(app: Sphinx):
app.add_directive("availability", AvailabilityDirective)
app.connect("missing-reference", on_missing_reference)
app.add_directive('availability', AvailabilityDirective)
# -- Python domain hacks ---------------------------------------------------
+11 -13
View File
@@ -13,23 +13,21 @@ class PybricksClasslinkDirective(Directive):
link = name if len(self.arguments) == 1 else self.arguments[1]
html = (
'<a href="{0}.html">'.format(link.lower())
+ '<dl class="py class">'
+ "<dt>"
+ '<em class="property">class </em>'
+ '<code class="sig-name descname">'
+ name
+ "</code>"
+ "</dt>"
+ "<dd></dd>"
+ "</dl>"
+ "</a>"
'<a href="{0}.html">'.format(link.lower()) +
'<dl class="py class">' +
'<dt>' +
'<em class="property">class </em>' +
'<code class="sig-name descname">' + name + '</code>' +
'</dt>' +
'<dd></dd>' +
'</dl>' +
'</a>'
)
# Return the node
node = nodes.raw("", html, format="html")
node = nodes.raw('', html, format="html")
return [node]
def setup(app):
app.add_directive_to_domain("py", "pybricks-classlink", PybricksClasslinkDirective)
app.add_directive_to_domain('py', 'pybricks-classlink', PybricksClasslinkDirective)
+9 -8
View File
@@ -16,27 +16,28 @@ class PybricksColorDirective(Directive):
color = getattr(Color, name)
# Convert HSV to RGB
r, g, b = hsv_to_rgb(color.h / 360, color.s / 100, color.v / 100)
r, g, b = hsv_to_rgb(color.h/360, color.s/100, color.v/100)
# Convert RGB to HEX
rgbhex = "#{0:02x}{1:02x}{2:02x}".format(
round(r * 255), round(g * 255), round(b * 255)
rgbhex = '#{0:02x}{1:02x}{2:02x}'.format(
round(r*255),
round(g*255),
round(b*255)
)
# Render a small block of the given color
css = "background-color: {0}; color: {0}; width: 50px;".format(rgbhex)
if name == "WHITE":
css += (
"border-style: solid; border-width: 0.5px;" + "border-color: #666666;"
)
css += "border-style: solid; border-width: 0.5px;" + \
"border-color: #666666;"
html = '<div id="test" style="{0}">_</div>'.format(css)
# Return the node
node = nodes.raw("", html, format="html")
node = nodes.raw('', html, format="html")
return [node]
def setup(app):
app.add_directive_to_domain("py", "pybricks-color", PybricksColorDirective)
app.add_directive_to_domain('py', 'pybricks-color', PybricksColorDirective)
+31 -32
View File
@@ -10,10 +10,10 @@ FEATURES_SMALL = set()
# Medium feature set.
FEATURES_MEDIUM = FEATURES_SMALL | {
"pybricks-common-control",
"pybricks-iodevices",
"stm32-extra",
"stm32-float",
'pybricks-geometry',
'pybricks-iodevices',
'stm32-extra',
'stm32-float',
}
# Large feature set.
@@ -21,12 +21,11 @@ FEATURES_LARGE = FEATURES_MEDIUM | set()
# Features per hub.
HUB_FEATURES = {
"movehub": {"movehub"} | FEATURES_SMALL,
"cityhub": {"cityhub"} | FEATURES_MEDIUM,
"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,
'movehub': {'movehub'} | FEATURES_SMALL,
'cityhub': {'cityhub'} | FEATURES_MEDIUM,
'technichub': {'technichub'} | FEATURES_MEDIUM,
'primehub': {'primehub', 'inventorhub'} | FEATURES_LARGE,
'inventorhub': {'primehub', 'inventorhub'} | FEATURES_LARGE,
}
@@ -41,24 +40,25 @@ class PybricksRequirementsStaticDirective(Directive):
# CC BY-SA 4.0 via https://stackoverflow.com/a/63728208
env = self.state.document.settings.env
destdir = path.join(env.app.builder.outdir, "_images")
destdir = path.join(env.app.builder.outdir, '_images')
if not path.exists(destdir):
makedirs(destdir)
for hub in HUB_FEATURES:
uri = "compat_{0}.png".format(hub)
src_uri = path.join(env.app.builder.srcdir, "diagrams", uri)
build_uri = path.join(env.app.builder.outdir, "_images", uri)
copyfile(src_uri, build_uri)
for compat in ("true", "false"):
uri = 'compat_{0}_{1}_label.png'.format(hub, compat)
src_uri = path.join(env.app.builder.srcdir, 'images', uri)
build_uri = path.join(env.app.builder.outdir, '_images', uri)
copyfile(src_uri, build_uri)
# Get requirements from sphinx-directive.
requirements = set(self.arguments)
# Cell with image of a hub.
hub_cell = """
<th background="{0}_images/compat_{1}.png" class="requirements-table-th requirements-table-th">
{2}
</th>
<th><div class="align-default">
<img alt="" src="{0}_images/compat_{1}_{2}_label.png">
</div></th>
"""
# Determine how far up the tree we are to set correct image path.
@@ -67,19 +67,18 @@ class PybricksRequirementsStaticDirective(Directive):
depth_path = "../" * depth
# Table row with hub images.
compat_row = "".join(
[
hub_cell.format(
depth_path, hub, "" if requirements <= features else ""
)
for hub, features in HUB_FEATURES.items()
]
)
compat_row = "".join([
hub_cell.format(
depth_path,
hub,
"true" if requirements <= features else "false")
for hub, features in HUB_FEATURES.items()
])
# Generate full table.
html = """
<div class="wy-table-responsive">
<table class="docutils align-default requirements-table">
<table class="docutils align-default">
<tbody>
<tr>
{0}
@@ -87,16 +86,16 @@ class PybricksRequirementsStaticDirective(Directive):
</tbody>
</table>
</div>
""".format(
compat_row
)
""".format(compat_row)
# Return the node.
node = nodes.raw("", html, format="html")
node = nodes.raw('', html, format="html")
return [node]
def setup(app):
app.add_directive_to_domain(
"py", "pybricks-requirements-static", PybricksRequirementsStaticDirective
'py',
'pybricks-requirements-static',
PybricksRequirementsStaticDirective
)
-16
View File
@@ -42,19 +42,3 @@ SOFTWARE. */
margin-bottom: 0px;
}
.requirements-table {
width: 100%;
}
.requirements-table-th {
background-size:contain;
background-repeat: no-repeat;
text-align: right;
padding: 6px !important;
}
.requirements-table-th:after {
content: '';
display: block;
margin-top: 80%;
}
+14 -14
View File
@@ -29,25 +29,25 @@ from sphinx.util.osutil import copyfile
from sphinx.util import logging
CSS_FILE = "requirements.css"
JS_FILE = "requirements.js"
CSS_FILE = 'requirements.css'
JS_FILE = 'requirements.js'
class PybricksRequirementsDirective(Directive):
has_content = True
option_spec = {"header": directives.unchanged}
option_spec = {'header': directives.unchanged}
required_arguments = 0
optional_arguments = 10
def run(self):
node = nodes.container()
node["classes"].append("toggle-content")
node['classes'].append('toggle-content')
par = nodes.container()
par["classes"].append("toggle-header")
par['classes'].append('toggle-header')
content = ".. pybricks-requirements-static:: " + " ".join(self.arguments)
content = '.. pybricks-requirements-static:: ' + " ".join(self.arguments)
self.state.nested_parse(StringList([content]), self.content_offset, node)
@@ -60,20 +60,20 @@ def add_assets(app):
def copy_assets(app, exception):
if app.builder.name not in ["html", "readthedocs"] or exception:
if app.builder.name not in ['html', 'readthedocs'] or exception:
return
logger = logging.getLogger(__name__)
logger.info("Copying requirements stylesheet/javascript... ", nonl=True)
dest = os.path.join(app.builder.outdir, "_static", CSS_FILE)
logger.info('Copying requirements stylesheet/javascript... ', nonl=True)
dest = os.path.join(app.builder.outdir, '_static', CSS_FILE)
source = os.path.join(os.path.abspath(os.path.dirname(__file__)), CSS_FILE)
copyfile(source, dest)
dest = os.path.join(app.builder.outdir, "_static", JS_FILE)
dest = os.path.join(app.builder.outdir, '_static', JS_FILE)
source = os.path.join(os.path.abspath(os.path.dirname(__file__)), JS_FILE)
copyfile(source, dest)
logger.info("done")
logger.info('done')
def setup(app):
app.add_directive("pybricks-requirements", PybricksRequirementsDirective)
app.connect("builder-inited", add_assets)
app.connect("build-finished", copy_assets)
app.add_directive('pybricks-requirements', PybricksRequirementsDirective)
app.connect('builder-inited', add_assets)
app.connect('build-finished', copy_assets)
-31
View File
@@ -1,31 +0,0 @@
"""This directive hides the builtin directives
* versionchanged
* versionadded
* deprecated
when building documentation with the 'ide' tag.
"""
from docutils import nodes
from docutils.parsers.rst import Directive
class PybricksVersionDirective(Directive):
has_content = True
def run(self):
html = ""
node = nodes.raw("", html, format="html")
return [node]
def setup(app):
if "ide" in app.tags.tags:
app.add_directive_to_domain(
"py", "deprecated", PybricksVersionDirective, override=True
)
app.add_directive_to_domain(
"py", "versionadded", PybricksVersionDirective, override=True
)
app.add_directive_to_domain(
"py", "versionchanged", PybricksVersionDirective, override=True
)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

-62
View File
@@ -1,62 +0,0 @@
rm output/*
cp LPub3D/assem/main-*.png output/all.png
cp LPub3D/assem/main_1_ev3devices-*.png output/ev3device-all.png
cp LPub3D/assem/main_1_ev3devices_1_ev3device-color-*.png output/ev3device-color.png
cp LPub3D/assem/main_1_ev3devices_1_ev3device-ev3-*.png output/ev3device-ev3.png
cp LPub3D/assem/main_1_ev3devices_1_ev3device-gyro-*.png output/ev3device-gyro.png
cp LPub3D/assem/main_1_ev3devices_1_ev3device-infrared-*.png output/ev3device-infrared.png
cp LPub3D/assem/main_1_ev3devices_1_ev3device-motors-*.png output/ev3device-motors.png
cp LPub3D/assem/main_1_ev3devices_1_ev3device-touch-*.png output/ev3device-touch.png
cp LPub3D/assem/main_1_ev3devices_1_ev3device-ultrasonic-*.png output/ev3device-ultrasonic.png
cp LPub3D/assem/main_1_hubs_2_hubs-lwp3-*.png output/hub-lwp3.png
cp LPub3D/assem/main_1_hubs-*0_1_1*.png output/hub-spike-inventor.png
cp LPub3D/assem/main_1_hubs-*0_1_2*.png output/hub-all.png
cp LPub3D/assem/main_1_hubs_1_hub-city-*.png output/hub-city.png
cp LPub3D/assem/main_1_hubs_1_hub-essential-*35_-35_0_ABS.png output/hub-essential.png
cp LPub3D/assem/main_1_hubs_1_hub-essential-*45_45_0_ABS.png output/hub-essential-orientation.png
cp LPub3D/assem/main_1_hubs_1_hub-inventor-*35_-35_0_ABS.png output/hub-inventor.png
cp LPub3D/assem/main_1_hubs_1_hub-inventor-*45_45_0_ABS.png output/hub-inventor-orientation.png
cp LPub3D/assem/main_1_hubs_1_hub-move-*35_-35_0_ABS.png output/hub-move.png
cp LPub3D/assem/main_1_hubs_1_hub-move-*45_45_0_ABS.png output/hub-move-orientation.png
cp LPub3D/assem/main_1_hubs_1_hub-move-*35_-125_0_ABS.png output/hub-move-motor-a.png
cp LPub3D/assem/main_1_hubs_1_hub-move-*35_55_0_ABS.png output/hub-move-motor-b.png
cp LPub3D/assem/main_1_hubs_1_hub-prime-*35_-35_0_ABS.png output/hub-prime.png
cp LPub3D/assem/main_1_hubs_1_hub-prime-*45_45_0_ABS.png output/hub-prime-orientation.png
cp LPub3D/assem/main_1_hubs_1_hub-prime-*90_0_0_ABS.png output/hub-prime-display.png
cp LPub3D/assem/main_1_hubs_1_hub-technic-*35_-35_0_ABS.png output/hub-technic.png
cp LPub3D/assem/main_1_hubs_1_hub-technic-*45_45_0_ABS.png output/hub-technic-orientation.png
cp LPub3D/assem/main_1_iodevices-*.png output/iodevice-all.png
cp LPub3D/assem/main_1_iodevices_1_iodevice-dcmotor-*.png output/iodevice-dcmotor.png
cp LPub3D/assem/main_1_iodevices_1_iodevice-pupdevice-*.png output/iodevice-pupdevice.png
cp LPub3D/assem/main_1_iodevices_1_iodevice-rj12blue-*.png output/iodevice-rj12blue.png
cp LPub3D/assem/main_1_iodevices_1_iodevice-rj12brown-*.png output/iodevice-rj12brown.png
cp LPub3D/assem/main_1_iodevices_1_iodevice-rj12cyan-*.png output/iodevice-rj12cyan.png
cp LPub3D/assem/main_1_iodevices_1_iodevice-rj12green-*.png output/iodevice-rj12green.png
cp LPub3D/assem/main_1_iodevices_1_iodevice-rj12grey-*.png output/iodevice-rj12grey.png
cp LPub3D/assem/main_1_iodevices_1_iodevice-rj12pcbbox-*.png output/iodevice-rj12pcbbox.png
cp LPub3D/assem/main_1_nxtdevices-*.png output/nxtdevice-all.png
cp LPub3D/assem/main_1_nxtdevices_1_nxtdevice-color-*.png output/nxtdevice-color.png
cp LPub3D/assem/main_1_nxtdevices_1_nxtdevice-energy-*.png output/nxtdevice-energy.png
cp LPub3D/assem/main_1_nxtdevices_1_nxtdevice-light-*.png output/nxtdevice-light.png
cp LPub3D/assem/main_1_nxtdevices_1_nxtdevice-nxt-*.png output/nxtdevice-nxt.png
cp LPub3D/assem/main_1_nxtdevices_1_nxtdevice-sound-*.png output/nxtdevice-sound.png
cp LPub3D/assem/main_1_nxtdevices_1_nxtdevice-temperature-*.png output/nxtdevice-temperature.png
cp LPub3D/assem/main_1_nxtdevices_1_nxtdevice-touch-*.png output/nxtdevice-touch.png
cp LPub3D/assem/main_1_nxtdevices_1_nxtdevice-ultrasonic-*.png output/nxtdevice-ultrasonic.png
cp LPub3D/assem/main_1_pupdcmotors-*.png output/pupdevice-dcmotors.png
cp LPub3D/assem/main_1_pupdevices-*.png output/pupdevice-all.png
cp LPub3D/assem/main_1_pupdevices_1_pupdevice-color-*0_0.png output/pupdevice-color-front.png
cp LPub3D/assem/main_1_pupdevices_1_pupdevice-color-*ABS.png output/pupdevice-color.png
cp LPub3D/assem/main_1_pupdevices_1_pupdevice-colordistance-*.png output/pupdevice-colordistance.png
cp LPub3D/assem/main_1_pupdevices_1_pupdevice-force-*.png output/pupdevice-force.png
cp LPub3D/assem/main_1_pupdevices_1_pupdevice-infrared-*.png output/pupdevice-infrared.png
cp LPub3D/assem/main_1_pupdevices_1_pupdevice-light-*.png output/pupdevice-light.png
cp LPub3D/assem/main_1_pupdevices_1_pupdevice-lightmatrix-*.png output/pupdevice-lightmatrix.png
cp LPub3D/assem/main_1_pupdevices_1_pupdevice-pfmotor-*.png output/pupdevice-pfmotor.png
cp LPub3D/assem/main_1_pupdevices_1_pupdevice-remote-*.png output/pupdevice-remote.png
cp LPub3D/assem/main_1_pupdevices_1_pupdevice-tilt-*35_-35_0_ABS.png output/pupdevice-tilt.png
cp LPub3D/assem/main_1_pupdevices_1_pupdevice-tilt-*45_-135_0_ABS.png output/pupdevice-tilt-orientation.png
cp LPub3D/assem/main_1_pupdevices_1_pupdevice-ultrasonic-*0_0.png output/pupdevice-ultrasonic-front.png
cp LPub3D/assem/main_1_pupdevices_1_pupdevice-ultrasonic-*ABS.png output/pupdevice-ultrasonic.png
cp LPub3D/assem/main_1_pupmotors-*.png output/pupdevice-motors.png
cp LPub3D/assem/main_1_imu-orientation-*.png output/imu-orientation.png
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 727 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 623 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 650 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

+24 -31
View File
@@ -4,54 +4,47 @@
# Pybricks documentation build configuration file
#
import os
import sys
# General information about the project.
project = "pybricks"
copyright = "2018-2023 The Pybricks Authors"
author = ""
project = 'pybricks'
copyright = '2018-2021 The Pybricks Authors'
author = ''
_TITLE = "Pybricks Modules and Examples"
_DISCLAIMER = "LEGO, the LEGO logo, MINDSTORMS and the MINDSTORMS EV3 logo are\
_TITLE = 'Pybricks Modules and Examples'
_DISCLAIMER = 'LEGO, the LEGO logo, MINDSTORMS and the MINDSTORMS EV3 logo are\
trademarks and/or copyrights of the LEGO Group of companies \
which does not sponsor, authorize or endorse this site."
which does not sponsor, authorize or endorse this site.'
html_favicon = "../common/images/favicon.ico"
html_logo = "../common/images/pybricks-logo-rtd.png"
latex_logo = "../common/images/pybricks-logo-large.png"
html_favicon = '../common/images/favicon.ico'
html_logo = '../common/images/pybricks-logo-rtd.png'
latex_logo = '../common/images/pybricks-logo-large.png'
# Build main docs for RTD by default.
# Since tags cannot be passed via the TAG make variable on read the docs,
# add it manually.
if os.environ.get("READTHEDOCS", None) == "True":
tags.add("main") # noqa F821
if os.environ.get('READTHEDOCS', None) == 'True':
tags.add('main') # noqa F821
# HACK: this allows Number type alias to be imported by Sphinx
os.environ["SPHINX_BUILD"] = "True"
# Additional configuration of the IDE docs
if "ide" in tags.tags: # noqa F821
_DISCLAIMER = ""
# Addtional configuration of the IDE docs
if 'ide' in tags.tags: # noqa F821
_DISCLAIMER = ''
html_show_copyright = False
html_show_sphinx = False
html_css_files = ["css/ide.css"]
html_js_files = ["js/ide.js"]
html_css_files = ['css/ide.css']
html_js_files = ['js/ide.js']
imgmath_image_format = "svg"
imgmath_image_format = 'svg'
imgmath_use_preview = True # requires Sphinx v3
imgmath_latex_preamble = r"""
imgmath_latex_preamble = r'''
\usepackage{newtxsf}
"""
'''
exec(open(os.path.abspath("../common/conf.py")).read())
# Additional configuration of the IDE docs
if "ide" in tags.tags: # noqa F821
# Addtional configuration of the IDE docs
if 'ide' in tags.tags: # noqa F821
extensions.remove("sphinx.ext.mathjax") # noqa F821
extensions.append("sphinx.ext.imgmath") # noqa F821
html_theme_options["prev_next_buttons_location"] = None # noqa F821
# Build hub specific example scripts.
sys.path.append(os.path.abspath("../../examples/pup/hub_common"))
import make_examples # noqa F401, E402
extensions.remove('sphinx.ext.mathjax') # noqa F821
extensions.append('sphinx.ext.imgmath') # noqa F821
html_theme_options['prev_next_buttons_location'] = None # noqa F821
+25
View File
@@ -0,0 +1,25 @@
SRC_DIR = .
OUT_DIR = ../images
POSTFIX := _label
SVG := $(wildcard $(SRC_DIR)/*.svg)
DIAGRAMS := $(patsubst $(SRC_DIR)/%.svg,$(OUT_DIR)/%$(POSTFIX).png,$(SVG))
DIR := ${CURDIR}
all: $(DIAGRAMS)
clean:
rm -f $(DIAGRAMS)
$(OUT_DIR)/%$(POSTFIX).png: $(SRC_DIR)/%.svg
if inkscape --version | grep -q "Inkscape 0"; then \
inkscape --file=$(DIR)/$< --export-area-drawing --export-png=$(DIR)/$@; \
else \
inkscape \
--export-area-drawing \
--export-background=white \
--export-background-opacity=1.0 \
--export-file=$(DIR)/$@ \
$(DIR)/$<; \
fi

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Some files were not shown because too many files have changed in this diff Show More