Commit Graph
843 Commits
Author SHA1 Message Date
Laurens Valk f692e5a127 pybricks.iodevices: Drop EV3 specific devices.
Some of these could be brought back if we add Powered Up support.
2021-07-23 11:32:01 +02:00
Laurens Valk fbd843cb54 doc/main/index: Unify IDE and main build.
The `only` directive can be used to include content selectively. It cannot be used to select a different TOC, which is why we resorted to separate doc builds before.

Now that we have dropped EV3 references from the docs, we can use a single build and just customize the content on the landing page with the only directive.

The docs can now be built with:

# Main docs:
make -C doc html SPHINXOPTS=-tmain

# IDE docs:
make -C doc html SPHINXOPTS=-tide
2021-07-23 11:25:51 +02:00
Laurens Valk e4c7e5abeb doc/common/conf: Drop class method hack.
This can be traced back to 0013a74d72 and 92e3735d63.

It was used to work around things like

sound.beeps(number)
   Description

being incorrectly displayed as

classmethod sound.beeps(number)
   Description

But the current version of sphinx appears to display this correctly even without the hack. We want to reduce the number of hacks because they tend to break updates (https://github.com/pybricks/pybricks-api/issues/69#issuecomment-879822417).
2021-07-23 11:04:03 +02:00
Laurens Valk 8d521c1b1f doc/common/conf: Drop EV3 hack.
This is no longer required, perhaps not even for EV3. For example, PrimeHub.speaker looks as intended.

We want to reduce the number of hacks because they tend to break updates (https://github.com/pybricks/pybricks-api/issues/69#issuecomment-879822417).
2021-07-23 10:48:07 +02:00
Laurens Valk 1be7fce116 doc/main: Drop EV3 references.
To make the documentation easier to use and maintain, EV3 content will be hidden.

The stable 2.0 docs should be used for EV3 instead.
2021-07-23 10:41:34 +02:00
Laurens Valk 5ab81dc732 doc/main: Update landing page with link to EV3. 2021-07-21 19:27:45 +02:00
Laurens Valk 72e0d87f77 ubuiltins: Examples for common exceptions. 2021-07-21 14:53:56 +02:00
Laurens Valk 923e8caf84 ubuiltins: Organize exceptions. 2021-07-21 11:12:51 +02:00
Laurens Valk e8d47ffca1 uerrno: Document alongside OSError.
These are meant to be used together, so document them in the same place along with a practical example.
2021-07-19 15:03:10 +02:00
Laurens Valk 2c32d093d0 ubuiltins.bytes: Clarify range up to 255.
Be consistent and use <= for both. A bit more intuitive because the number 256 cannot be used in bytes objects.
2021-07-16 16:12:43 +02:00
Laurens Valk ba6d7ac3f5 ubuiltins: Fix unwanted ubuiltins prefix.
Fixes https://github.com/pybricks/pybricks-api/issues/71.
2021-07-16 16:07:55 +02:00
Laurens Valk 64ea5e341c ubuiltins: Sort classes and functions by use case. 2021-07-16 16:07:55 +02:00
Laurens Valk a0ea0d8ca0 ubuiltins: Document enumerate as a function.
Though it is technically its own type in MicroPython, this change follows the CPython documentation. Essentially this just drops the class prefix and leaves everything else unchanged.

This makes more sense when organizing this module by classes and functions. It's also a bit more logical since the equivalent example we provoide is a function definition, not a class definition.
2021-07-16 16:07:55 +02:00
Laurens Valk 29404babcf ubuiltins: Split out automodule.
List all functions and classes explicitly so we can organize them by category in later commits.

Also split out exceptions and uerrno to dedicated page because the builtins page was getting very long and hard to navigate.
2021-07-16 16:07:46 +02:00
Laurens Valk 3b1fd091f1 micropython: Add examples for memory stats. 2021-07-14 16:08:52 +02:00
Laurens Valk cd7d5be748 micropython.stack_info: Clean up docstring.
Reword to say how it useful, not how it is not useful.

Also fix return type.
2021-07-14 15:36:18 +02:00
Laurens Valk 97e368312e micropython.qstr_info: Clean up docstring.
Say the same with less words. Also add one line from elsewhere in the MicroPython docs to explain what this is about.
2021-07-14 15:32:28 +02:00
Laurens Valk 28af77fcfc micropython.mem_info: Clean up docstring.
Say the same with less words.
2021-07-14 15:31:41 +02:00
Laurens Valk 3ed6e2dd7d micropython.opt_level: Clarify docstring.
Just list what each level does instead of a complicated if-then bullet list. It's still shorter anyway.

Also add a note that this only applies to REPL code in case of Pybricks.
2021-07-14 15:13:26 +02:00
Laurens Valk 4c00c3209b micropython.const: Improve docstring, add example.
This merges the useful information from two different places:
- The original docstring for const.
- Writing MicroPython code for constrained devices.

Also reduce type to just int, because only ints are supported.
2021-07-14 14:48:59 +02:00
Laurens Valk c656eae2f3 micropython: Drop TConst type.
TConst does not exist, so adding it makes it a bit harder to read than needed. The const() "function" will take int or float, and the return value can be used as such, even if it is optimized out. This is described in the docstring, so we can leave out the additional type.

Also adds autofunctions in place of one auto module so we can move things around as needed. Also fix cross links with usys to get the build to pass before we update that module.
2021-07-14 14:13:18 +02:00
Laurens Valk 456dc28c1b .readthedocs: Add configuration file.
When this file is present, the settings in the online dashboard will be ignored.

This lets us explicitly set the Python version, in this case to 3.8 to match pyproject.toml.

Fixes https://github.com/pybricks/pybricks-api/issues/68.
2021-07-14 13:06:30 +02:00
Laurens Valk 238204d280 doc/main: Rename from doc/api.
The doc/api is a legacy name, which is confusing in the current use, since all build targets are now APIs.

Today we have:

doc/common: Common configuration and settings between all targets.

doc/main: Main Pybricks documentation at docs.pybricks.com.

doc/ide: Documentation shipped with the Pybricks Code IDE.
2021-07-14 11:39:20 +02:00
Laurens Valk 55aec445b1 CONTRIBUTING: Update commit message guidelines. 2021-07-14 11:39:20 +02:00
Laurens Valk 7f622927ff CHANGELOG: Add recent changes. 2021-07-14 11:39:20 +02:00
Laurens Valk 8384a10c2d doc/ide/index: Enable MicroPython modules. 2021-07-14 11:39:20 +02:00
Laurens Valk 619fa0c968 doc/main: Group MicroPython rst files.
They are easier to find when they are not mixed with Pybricks docs.
2021-07-14 11:39:25 +02:00
Laurens Valk 1fab46e67f doc/main/index: Clean up menu and builtins.
There is no ubuiltins module, so we shouldn't mention it.

Also reduce size of other module titles so they fit on one line in the
menu. This makes it easier to read and get an overview.
2021-07-14 11:39:20 +02:00
Laurens Valk 727ec3fe46 umath: Redo module docs.
This reworks the documentation for the umath module, as done previously as per https://github.com/pybricks/pybricks-api/pull/64 and https://github.com/pybricks/pybricks-api/issues/63

The presentation and docstrings are inspired by the Python 3 math module documentation instead of the MicroPython math module documentation. Functions are grouped roughly by use case.
2021-07-14 11:22:04 +02:00
Laurens Valk a0e4ffdb5c umath: Use umath for math.
Do this for all Powered Up examples.
2021-07-14 11:22:04 +02:00
Laurens Valk 9b8a66e3da pybricks.hubs.PrimeHub: Add system examples. 2021-07-14 09:43:34 +02:00
Laurens Valk 9944cf3adf pybricks.common.System: Add name() getter. 2021-07-14 09:43:20 +02:00
David Lechner 286079fe68 ubuiltins: add stubs and docs for ubuiltins module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner d492b04402 umath: add stubs and docs for umath module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner 818409f675 usys: add stubs and docs for usys module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner 9dd131142e uselect: add stubs and docs for uselect module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner f828d11f40 urandom: add stubs and docs for urandom module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner 532639b820 uio: add stubs and docs for uio module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner 0865a58632 uerrno: add uerrno module stubs and docs
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner 0eb0e160e9 micropython: Add stubs and docs for micropython module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner 7126431f9f pybricks: move into src/ directory
Moving the pybricks package into a src/ directory so that we can add
additional packages without polluting the top-level directory.
2021-07-14 09:41:30 +02:00
Laurens Valk 5a8baeff4c pybricks.hubs: Add system examples. 2021-07-07 09:58:51 +02:00
Laurens Valk a2801aff41 pybricks.hubs: Enable single button. 2021-07-07 09:47:28 +02:00
Laurens Valk 76432120c4 pybricks.common.System: Add shutdown method.
Also drop reset() and update reset_reason() after https://github.com/pybricks/support/issues/379
2021-07-07 09:47:35 +02:00
Laurens Valk 3ce741ac2b pybricks.common.System: Add initial documentation. 2021-07-07 09:47:28 +02:00
Laurens Valk ce1456cb92 @pybricks/ide-docs v1.5.0 @pybricks/ide-docs/v1.5.0 2021-07-01 15:56:32 +02:00
Laurens Valk f8cd3451ea pupdevices.Remote: Enable it.
Also add an example.
2021-06-30 17:14:25 +02:00
Laurens Valk cb84ca87c6 @pybricks/ide-docs v1.4.0 @pybricks/ide-docs/v1.4.0 2021-06-23 19:56:31 +02:00
Laurens Valk e1995f9d1b ide: Display note about beta version. 2021-06-23 19:50:51 +02:00
Laurens Valk 7f0b1489a2 ide: Re-enable 3.X features.
These were hidden for the 3.0 release, but we can re-enable them for
the beta release of 3.1.

Revert "v3: Drop parameters Side and Button."

This reverts commit 07c53e9a3d.

Revert "v3: Drop Remote control."

This reverts commit b600f5029e.

Revert "v3: Drop geometry module."

This reverts commit 5f767f3fee.

Revert "v3: Drop Prime Hub and Inventor Hub."

This reverts commit 8db7892f8c.

Revert "v3: Drop IMU documentation."

This reverts commit b325bf4bff.
2021-06-23 19:41:15 +02:00