.
+
+
+
+- :material-shape-outline:{ .lg .middle } **Geometry Tutorial**
+
+ ---
+
+ If you're still just exploring,
+ you may want to continue with the basic geometry tutorial.
+
+ [:octicons-arrow-right-24: Geometry Tutorial](basics.geometry.md)
+
+- :material-tools:{ .lg .middle } **Workflows**
+
+ ---
+
+ If you have a specific AEC application in mind,
+ perhaps the AEC workflows on the COMPAS website can help you get started.
+
+ [:octicons-arrow-right-24: Workflows](https://compas.dev/documentation/workflows)
+
+- :material-code-braces:{ .lg .middle } **Developer Guide**
+
+ ---
+
+ If you're a developer and want to develop your own tools, or you want to contribute to COMPAS,
+ go to the developer guide.
+
+ [:octicons-arrow-right-24: Developer Guide](../devguide/index.md)
+
+
diff --git a/docs/userguide/whatsnext.rst b/docs/userguide/whatsnext.rst
deleted file mode 100644
index a104da29e58e..000000000000
--- a/docs/userguide/whatsnext.rst
+++ /dev/null
@@ -1,33 +0,0 @@
-********************************************************************************
-What's Next
-********************************************************************************
-
-.. rst-class:: lead
-
-If you have successfully installed COMPAS and managed to run the samples in :doc:`/userguide/firststeps`,
-you are ready for the next challenge. Where to go from here depends on what you want to do.
-In any case, enjoy!, And if you have any questions, please don't hesitate to ask on the forum: https://forum.compas-framework.org.
-
-.. grid:: 1 2 2 2
- :gutter: 4
-
- .. grid-item-card:: Geometry Tutorial
-
- If you're still just exploring,
- you may want to continue with the basic geometry tutorial.
- +++
- :doc:`/userguide/basics.geometry`
-
- .. grid-item-card:: Workflows
-
- If you have a specific AEC application in mind,
- perhaps the AEC workflows on the COMPAS website can help you get started.
- +++
- `Workflows `_
-
- .. grid-item-card:: Developer guide
-
- If you're a developer and want to develop your own tools, or you want to contribute to COMPAS,
- go tod the developer guide.
- +++
- :doc:`/devguide/index`
diff --git a/docs/write_rst.py b/docs/write_rst.py
deleted file mode 100644
index e2619aabde3e..000000000000
--- a/docs/write_rst.py
+++ /dev/null
@@ -1,152 +0,0 @@
-# from pathlib import Path
-from compas import datastructures as module
-
-TPL = """
-********************************************************************************
-{currentmodule}
-********************************************************************************
-
-.. currentmodule:: {currentmodule}
-
-.. rst-class:: lead
-
-{lead}
-{sections}
-
-"""
-
-SECTION = """
-{title}
-{line}
-
-{summary}
-
-.. autosummary::
- :toctree: generated/
- :nosignatures:
-
-{items}
-"""
-
-__newall__ = {
- "functions": [],
- "classes": [],
- "errors": [],
- "numpy": [],
- "pluggables": [],
- "plugins": [],
-}
-
-for name in module.__all__:
- obj = getattr(module, name)
-
- if name.endswith("_numpy"):
- __newall__["numpy"].append(name)
- continue
-
- if issubclass(type(obj), Exception):
- __newall__["errors"].append(name)
- continue
-
- if hasattr(obj, "__pluggable__"):
- __newall__["pluggables"].append(name)
- continue
-
- if hasattr(obj, "__plugin__"):
- __newall__["plugins"].append(name)
- continue
-
- if isinstance(obj, type):
- __newall__["classes"].append(name)
- else:
- __newall__["functions"].append(name)
-
-
-currentmodule = module.__name__
-
-lead = module.__doc__
-
-classes = ""
-for name in sorted(__newall__["classes"]):
- classes += " {name}\n".format(name=name)
-
-if classes:
- classes = SECTION.format(
- title="Classes",
- line="=" * len("Classes"),
- summary="",
- items=classes,
- )
-
-errors = ""
-for name in sorted(__newall__["errors"]):
- errors += " {name}\n".format(name=name)
-
-if errors:
- errors = SECTION.format(
- title="Exceptions",
- line="=" * len("Exceptions"),
- summary="",
- items=errors,
- )
-
-functions = ""
-for name in sorted(__newall__["functions"]):
- functions += " {name}\n".format(name=name)
-
-if functions:
- functions = SECTION.format(
- title="Functions",
- line="=" * len("Functions"),
- summary="",
- items=functions,
- )
-
-numpy = ""
-for name in sorted(__newall__["numpy"]):
- numpy += " {name}\n".format(name=name)
-
-if numpy:
- numpy = SECTION.format(
- title="Functions using Numpy",
- line="=" * len("Functions using Numpy"),
- summary="In environments where numpy is not available, these functions can still be accessed through RPC.",
- items=numpy,
- )
-
-pluggables = ""
-for name in sorted(__newall__["pluggables"]):
- pluggables += " {name}\n".format(name=name)
-
-if pluggables:
- pluggables = SECTION.format(
- title="Pluggables",
- line="=" * len("Pluggables"),
- summary="Pluggables are functions that don't have an actual implementation, but receive an implementation from a plugin.",
- items=pluggables,
- )
-
-plugins = ""
-for name in sorted(__newall__["plugins"]):
- plugins += " {name}\n".format(name=name)
-
-if plugins:
- plugins = SECTION.format(
- title="Plugins",
- line="=" * len("Plugins"),
- summary="Plugins provide implementations for pluggables. You can use the plugin directly, or through the pluggable.",
- items=plugins,
- )
-
-sections = "".join([classes, errors, functions, numpy, pluggables, plugins])
-
-# docs = Path(__file__).parent
-
-with open("/Users/vanmelet/Code/compas/docs/api/{name}.rst".format(name=module.__name__), "w") as f:
- f.write(
- TPL.format(
- currentmodule=currentmodule,
- lead=lead,
- sections=sections,
- )
- )
diff --git a/mkdocs.yml b/mkdocs.yml
new file mode 100644
index 000000000000..0e2d3249476f
--- /dev/null
+++ b/mkdocs.yml
@@ -0,0 +1,205 @@
+site_name: COMPAS
+site_description: An open-source framework for computational research in Architecture, Engineering, Fabrication, and Construction
+site_url: https://compas.dev/compas
+repo_url: https://github.com/compas-dev/compas
+repo_name: compas-dev/compas
+edit_uri: edit/main/docs/
+copyright: Copyright © COMPAS Association
+
+theme:
+ name: material
+ logo: images/COMPAS.png
+ favicon: images/COMPAS.png
+ palette:
+ - media: "(prefers-color-scheme)"
+ toggle:
+ icon: material/brightness-auto
+ name: Switch to light mode
+ - media: "(prefers-color-scheme: light)"
+ scheme: default
+ primary: deep purple
+ accent: deep purple
+ toggle:
+ icon: material/brightness-7
+ name: Switch to dark mode
+ - media: "(prefers-color-scheme: dark)"
+ scheme: slate
+ primary: deep purple
+ accent: deep purple
+ toggle:
+ icon: material/brightness-4
+ name: Switch to system preference
+ features:
+ - navigation.instant
+ - navigation.instant.progress
+ - navigation.tabs
+ - navigation.tabs.sticky
+ - navigation.sections
+ - navigation.indexes
+ - navigation.top
+ - navigation.footer
+ - toc.follow
+ - search.suggest
+ - search.highlight
+ - search.share
+ - content.code.copy
+ - content.code.annotate
+ - content.action.edit
+ - content.tabs.link
+ icon:
+ repo: fontawesome/brands/github
+
+plugins:
+ - search
+ - mkdocstrings:
+ default_handler: python
+ handlers:
+ python:
+ paths: [src]
+ options:
+ docstring_style: numpy
+ docstring_section_style: spacy
+ show_source: true
+ show_root_heading: true
+ show_root_full_path: false
+ show_symbol_type_heading: true
+ show_symbol_type_toc: true
+ members_order: source
+ merge_init_into_class: true
+ separate_signature: true
+ signature_crossrefs: true
+ show_signature_annotations: true
+ inherited_members: false
+ filters:
+ - "!^_"
+ - "^__init__$"
+
+markdown_extensions:
+ - admonition
+ - pymdownx.details
+ - pymdownx.superfences:
+ custom_fences:
+ - name: mermaid
+ class: mermaid
+ format: !!python/name:pymdownx.superfences.fence_code_format
+ - pymdownx.highlight:
+ anchor_linenums: true
+ line_spans: __span
+ pygments_lang_class: true
+ - pymdownx.inlinehilite
+ - pymdownx.snippets
+ - pymdownx.tabbed:
+ alternate_style: true
+ - pymdownx.arithmatex:
+ generic: true
+ - pymdownx.emoji:
+ emoji_index: !!python/name:material.extensions.emoji.twemoji
+ emoji_generator: !!python/name:material.extensions.emoji.to_svg
+ - tables
+ - attr_list
+ - md_in_html
+ - def_list
+ - footnotes
+ - toc:
+ permalink: true
+ toc_depth: 3
+
+extra:
+ social:
+ - icon: fontawesome/brands/github
+ link: https://github.com/compas-dev/compas
+ name: COMPAS on GitHub
+ - icon: fontawesome/brands/discourse
+ link: https://forum.compas-framework.org/
+ name: COMPAS Forum
+ - icon: fontawesome/brands/python
+ link: https://pypi.org/project/compas/
+ name: COMPAS on PyPI
+ generator: false
+
+extra_javascript:
+ - javascripts/mathjax.js
+ - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js
+
+extra_css:
+ - stylesheets/extra.css
+
+nav:
+ - Home: index.md
+ - User Guide:
+ - userguide/index.md
+ - Getting Started:
+ - Introduction: userguide/introduction.md
+ - Installation: userguide/installation.md
+ - First Steps: userguide/firststeps.md
+ - What's Next: userguide/whatsnext.md
+ - "Basics: Geometry":
+ - Overview: userguide/basics.geometry.md
+ - Points and Vectors: userguide/basics.geometry.points_and_vectors.md
+ - Planes and Frames: userguide/basics.geometry.planes_and_frames.md
+ - Transformations: userguide/basics.geometry.transformations.md
+ - Polygons and Polyhedrons: userguide/basics.geometry.polygons_and_polyhedrons.md
+ - Curves and Surfaces: userguide/basics.geometry.curves_and_surfaces.md
+ - Breps: userguide/basics.geometry.breps.md
+ - Intersections: userguide/basics.geometry.intersections.md
+ - Distance and Membership: userguide/basics.geometry.distance_and_membership.md
+ - Solids: userguide/basics.geometry.solids.md
+ - "Basics: Data Structures":
+ - Overview: userguide/basics.datastructures.md
+ - Graphs: userguide/basics.datastructures.graphs.md
+ - Meshes: userguide/basics.datastructures.meshes.md
+ - Cells: userguide/basics.datastructures.cells.md
+ - VolMeshes: userguide/basics.datastructures.volmeshes.md
+ - CellNetworks: userguide/basics.datastructures.cellnetwork.md
+ - Trees: userguide/basics.datastructures.trees.md
+ - "Basics: Visualisation": userguide/basics.visualisation.md
+ - "Basics: Colors": userguide/basics.colors.md
+ - "Advanced: Tolerance": userguide/advanced.tolerance.md
+ - "Advanced: Serialisation": userguide/advanced.serialisation.md
+ - "Advanced: RPC": userguide/advanced.rpc.md
+ - "Advanced: Hash Trees": userguide/advanced.hashtree.md
+ - "Advanced: Pluggables": userguide/advanced.pluggables.md
+ - "CAD: Rhino": userguide/cad.rhino.md
+ - "CAD: Rhino 8": userguide/cad.rhino8.md
+ - "CAD: Grasshopper": userguide/cad.grasshopper.md
+ - "CAD: Blender": userguide/cad.blender.md
+ - "CAD: Other": userguide/cad.other.md
+ - Releases: userguide/releases.md
+ - Citing: userguide/citing.md
+ - License: userguide/license.md
+ - Developer Guide:
+ - devguide/index.md
+ - Development Basics:
+ - Setup: devguide/setup.md
+ - Workflow: devguide/workflow.md
+ - Code Style: devguide/code.md
+ - Documentation: devguide/documentation.md
+ - Advanced Topics:
+ - Extensions: devguide/extensions.md
+ - Plugins: devguide/plugins.md
+ - GH Components: devguide/ghcomponent.md
+ - Data Types: devguide/dtypes.md
+ - API Reference:
+ - api/index.md
+ - compas:
+ - compas.colors: api/compas.colors.md
+ - compas.data: api/compas.data.md
+ - compas.datastructures: api/compas.datastructures.md
+ - compas.files: api/compas.files.md
+ - compas.geometry: api/compas.geometry.md
+ - compas.itertools: api/compas.itertools.md
+ - compas.plugins: api/compas.plugins.md
+ - compas.rpc: api/compas.rpc.md
+ - compas.scene: api/compas.scene.md
+ - compas.tolerance: api/compas.tolerance.md
+ - compas_blender:
+ - compas_blender.conversions: api/compas_blender.conversions.md
+ - compas_blender.geometry: api/compas_blender.geometry.md
+ - compas_blender.scene: api/compas_blender.scene.md
+ - compas_ghpython:
+ - compas_ghpython.components: api/compas_ghpython.components.md
+ - compas_ghpython.scene: api/compas_ghpython.scene.md
+ - compas_rhino:
+ - compas_rhino.conversions: api/compas_rhino.conversions.md
+ - compas_rhino.geometry: api/compas_rhino.geometry.md
+ - compas_rhino.scene: api/compas_rhino.scene.md
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 4d04ffd7c474..5f10339354f6 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -4,9 +4,11 @@ build
bump-my-version
compas_invocations2
invoke >=0.14
+mkdocs >=1.6
+mkdocs-material >=9.5
+mkdocstrings[python] >=0.27
pytest-cov
pythonnet
ruff
-sphinx_compas2_theme
twine
wheel
\ No newline at end of file
diff --git a/src/compas/__init__.py b/src/compas/__init__.py
index edc2cfc21805..b0af82f84164 100644
--- a/src/compas/__init__.py
+++ b/src/compas/__init__.py
@@ -168,12 +168,12 @@ def get(filename):
The ``compas.get`` function is meant to be used in combination with the static
constructors of the data structures.
- .. code-block:: python
+ ```python
+ import compas
+ from compas.datastructures import Mesh
- import compas
- from compas.datastructures import Mesh
-
- mesh = Mesh.from_obj(compas.get("faces.obj"))
+ mesh = Mesh.from_obj(compas.get("faces.obj"))
+ ```
"""
filename = filename.strip("/")
@@ -210,12 +210,12 @@ def get_bunny(localstorage=None):
Therefore, the returned path should be used in combination with the ``PLY``
file reader, or with the ``from_ply`` constructor function for meshes.
- .. code-block:: python
-
- import compas
- from compas.datastructures import Mesh
+ ```python
+ import compas
+ from compas.datastructures import Mesh
- mesh = Mesh.from_ply(compas.get_bunny())
+ mesh = Mesh.from_ply(compas.get_bunny())
+ ```
"""
import tarfile
diff --git a/src/compas/geometry/_core/_algebra.py b/src/compas/geometry/_core/_algebra.py
index 902bd29bf724..be4c6a9ca276 100644
--- a/src/compas/geometry/_core/_algebra.py
+++ b/src/compas/geometry/_core/_algebra.py
@@ -2227,12 +2227,12 @@ def matrix_from_basis_vectors(xaxis, yaxis):
Notes
-----
- .. code-block:: none
-
- [ x0 y0 z0 0 ]
- [ x1 y1 z1 0 ]
- [ x2 y2 z2 0 ]
- [ 0 0 0 1 ]
+ ```
+ [ x0 y0 z0 0 ]
+ [ x1 y1 z1 0 ]
+ [ x2 y2 z2 0 ]
+ [ 0 0 0 1 ]
+ ```
Examples
--------
@@ -2306,12 +2306,12 @@ def matrix_from_translation(translation):
Notes
-----
- .. code-block:: none
-
- [ . . . 0 ]
- [ . . . 1 ]
- [ . . . 2 ]
- [ . . . . ]
+ ```
+ [ . . . 0 ]
+ [ . . . 1 ]
+ [ . . . 2 ]
+ [ . . . . ]
+ ```
Examples
--------
@@ -2472,12 +2472,12 @@ def matrix_from_perspective_entries(perspective):
Notes
-----
- .. code-block:: none
-
- [ . . . . ]
- [ . . . . ]
- [ . . . . ]
- [ 0 1 2 3 ]
+ ```
+ [ . . . . ]
+ [ . . . . ]
+ [ . . . . ]
+ [ 0 1 2 3 ]
+ ```
"""
M = identity_matrix(4)
@@ -2503,12 +2503,12 @@ def matrix_from_shear_entries(shear_entries):
Notes
-----
- .. code-block:: none
-
- [ . 0 1 . ]
- [ . . 2 . ]
- [ . . . . ]
- [ . . . . ]
+ ```
+ [ . 0 1 . ]
+ [ . . 2 . ]
+ [ . . . . ]
+ [ . . . . ]
+ ```
Examples
--------
@@ -2597,12 +2597,12 @@ def matrix_from_scale_factors(scale_factors):
Notes
-----
- .. code-block:: python
-
- [ 0 . . . ]
- [ . 1 . . ]
- [ . . 2 . ]
- [ . . . . ]
+ ```
+ [ 0 . . . ]
+ [ . 1 . . ]
+ [ . . 2 . ]
+ [ . . . . ]
+ ```
Examples
--------
@@ -2760,13 +2760,12 @@ def close(value1, value2, tol=1e-05):
Warnings
--------
- .. deprecated:: 2.0
- Will be removed in 2.1
- Use :func:`TOL.is_close` instead.
+ Deprecated since version 2.0. Will be removed in 2.1.
+ Use `TOL.is_close` instead.
The tolerance value used by this function is an absolute tolerance.
It is more accurate to use a combination of absolute and relative tolerance.
- Therefor, use :func:`TOL.is_close` instead.
+ Therefore, use `TOL.is_close` instead.
"""
return TOL.is_close(value1, value2, rtol=0.0, atol=tol)
@@ -2793,13 +2792,12 @@ def allclose(l1, l2, tol=None):
Warnings
--------
- .. deprecated:: 2.0
- Will be removed in 2.1
- Use :func:`TOL.is_close` instead.
+ Deprecated since version 2.0. Will be removed in 2.1.
+ Use `TOL.is_allclose` instead.
The tolerance value used by this function is an absolute tolerance.
It is more accurate to use a combination of absolute and relative tolerance.
- Therefor, use :func:`TOL.is_allclose` instead.
+ Therefore, use `TOL.is_allclose` instead.
Notes
-----
diff --git a/src/compas/rpc/server.py b/src/compas/rpc/server.py
index e570f0f437a0..42c737b70b7d 100644
--- a/src/compas/rpc/server.py
+++ b/src/compas/rpc/server.py
@@ -20,25 +20,25 @@ class Server(SimpleXMLRPCServer):
Examples
--------
- .. code-block:: python
+ ```python
+ # service.py
- # service.py
+ from compas.rpc import Server
+ from compas.rpc import Dispatcher
- from compas.rpc import Server
- from compas.rpc import Dispatcher
+ class DefaultService(Dispatcher):
+ pass
- class DefaultService(Dispatcher):
- pass
+ if __name__ == "__main__":
+ server = Server(("localhost", 8888))
- if __name__ == "__main__":
- server = Server(("localhost", 8888))
-
- server.register_function(server.ping)
- server.register_function(server.remote_shutdown)
- server.register_instance(DefaultService())
- server.serve_forever()
+ server.register_function(server.ping)
+ server.register_function(server.remote_shutdown)
+ server.register_instance(DefaultService())
+ server.serve_forever()
+ ```
"""
diff --git a/src/compas/scene/meshobject.py b/src/compas/scene/meshobject.py
index 9c51e072d53d..c053777b09ff 100644
--- a/src/compas/scene/meshobject.py
+++ b/src/compas/scene/meshobject.py
@@ -162,8 +162,7 @@ def draw_faces(self):
def draw_mesh(self, *args, **kwargs):
"""Draw the mesh of the mesh.
- .. deprecated:: 1.14.1
- Use :meth:`~MeshObject.draw` instead.
+ Deprecated since version 1.14.1. Use `draw` instead.
Returns
-------
diff --git a/src/compas/utilities/azync.py b/src/compas/utilities/azync.py
index 147cd50cb240..518ff082aa63 100644
--- a/src/compas/utilities/azync.py
+++ b/src/compas/utilities/azync.py
@@ -73,23 +73,23 @@ def await_callback(async_func, callback_name="callback", errback_name=None, *arg
The following example shows how to await an async function (``do_async_stuff`` in
the example), using this utility:
- .. code-block:: python
+ ```python
+ from compas.utilities import await_callback
- from compas.utilities import await_callback
+ def do_async_stuff(callback):
+ from threading import Thread
- def do_async_stuff(callback):
- from threading import Thread
+ def runner(cb):
+ print("doing async stuff")
+ # ..
+ cb("done")
- def runner(cb):
- print("doing async stuff")
- # ..
- cb("done")
+ Thread(target=runner, args=(callback,)).start()
- Thread(target=runner, args=(callback,)).start()
-
- result = await_callback(do_async_stuff)
+ result = await_callback(do_async_stuff)
+ ```
"""
wait_event = threading.Event()
diff --git a/src/compas/utilities/decorators.py b/src/compas/utilities/decorators.py
index b39bf31df553..cbcb3eef3d57 100644
--- a/src/compas/utilities/decorators.py
+++ b/src/compas/utilities/decorators.py
@@ -104,15 +104,15 @@ def print_profile(func):
Examples
--------
- .. code-block:: python
-
- @print_profile
- def f(n):
- return sum(for i in range(n))
-
- print(f(100))
- print(f.__doc__)
- print(f.__name__)
+ ```python
+ @print_profile
+ def f(n):
+ return sum(for i in range(n))
+
+ print(f(100))
+ print(f.__doc__)
+ print(f.__name__)
+ ```
"""
diff --git a/src/compas/utilities/remote.py b/src/compas/utilities/remote.py
index c8ec7eddbd28..eeae6ba9011b 100644
--- a/src/compas/utilities/remote.py
+++ b/src/compas/utilities/remote.py
@@ -24,16 +24,16 @@ def download_file_from_remote(source, target, overwrite=True):
Examples
--------
- .. code-block:: python
+ ```python
+ import os
+ import compas
+ from compas.utilities.remote import download_file_from_remote
- import os
- import compas
- from compas.utilities.remote import download_file_from_remote
+ source = "https://raw.githubusercontent.com/compas-dev/compas/main/data/faces.obj"
+ target = os.path.join(compas.APPDATA, "data", "faces.obj")
- source = "https://raw.githubusercontent.com/compas-dev/compas/main/data/faces.obj"
- target = os.path.join(compas.APPDATA, "data", "faces.obj")
-
- download_file_from_remote(source, target)
+ download_file_from_remote(source, target)
+ ```
"""
parent = os.path.abspath(os.path.dirname(target))
diff --git a/src/compas_blender/install.py b/src/compas_blender/install.py
index 359abc6206c8..5aded8166f8c 100644
--- a/src/compas_blender/install.py
+++ b/src/compas_blender/install.py
@@ -28,15 +28,15 @@ def install(version=None, packages=None, clean=False):
Examples
--------
- .. code-block:: python
+ ```python
+ import compas_blender.install
- import compas_blender.install
+ compas_blender.install.install()
+ ```
- compas_blender.install.install()
-
- .. code-block:: bash
-
- python -m compas_blender.install
+ ```bash
+ python -m compas_blender.install
+ ```
"""
version = compas_blender._check_blender_version(version)
diff --git a/src/compas_ghpython/drawing.py b/src/compas_ghpython/drawing.py
index 5a8d43a078e9..700000f38333 100644
--- a/src/compas_ghpython/drawing.py
+++ b/src/compas_ghpython/drawing.py
@@ -64,11 +64,11 @@ def draw_points(points):
Notes
-----
- .. code-block:: python
-
- Schema({
- 'pos': lambda x: len(x) == 3)
- })
+ ```python
+ Schema({
+ 'pos': lambda x: len(x) == 3)
+ })
+ ```
"""
rg_points = []
@@ -92,12 +92,12 @@ def draw_lines(lines):
Notes
-----
- .. code-block:: python
-
- Schema({
- 'start': lambda x: len(x) == 3),
- 'end': lambda x: len(x) == 3),
- })
+ ```python
+ Schema({
+ 'start': lambda x: len(x) == 3),
+ 'end': lambda x: len(x) == 3),
+ })
+ ```
"""
rg_lines = []
@@ -122,13 +122,13 @@ def draw_geodesics(geodesics):
Notes
-----
- .. code-block:: python
-
- Schema({
- 'start': lambda x: len(x) == 3),
- 'end': lambda x: len(x) == 3),
- 'srf': str
- })
+ ```python
+ Schema({
+ 'start': lambda x: len(x) == 3),
+ 'end': lambda x: len(x) == 3),
+ 'srf': str
+ })
+ ```
"""
rg_geodesics = []
@@ -155,9 +155,9 @@ def draw_polylines(polylines):
Notes
-----
- .. code-block:: python
-
- Schema({"points": lambda x: all(len(y) == 3 for y in x)})
+ ```python
+ Schema({"points": lambda x: all(len(y) == 3 for y in x)})
+ ```
"""
rg_polylines = []
@@ -184,9 +184,9 @@ def draw_faces(faces):
Notes
-----
- .. code-block:: python
-
- Schema({"points": lambda x: all(len(y) == 3 for y in x), Optional("vertexcolors", default=None): lambda x: all(len(y) == 3 for y in x)})
+ ```python
+ Schema({"points": lambda x: all(len(y) == 3 for y in x), Optional("vertexcolors", default=None): lambda x: all(len(y) == 3 for y in x)})
+ ```
"""
meshes = []
@@ -235,9 +235,9 @@ def draw_cylinders(cylinders, cap=False):
Notes
-----
- .. code-block:: python
-
- Schema({"start": lambda x: len(x) == 3, "end": lambda x: len(x) == 3, "radius": And(Or(int, float), lambda x: x > 0)})
+ ```python
+ Schema({"start": lambda x: len(x) == 3, "end": lambda x: len(x) == 3, "radius": And(Or(int, float), lambda x: x > 0)})
+ ```
"""
rg_cylinders = []
@@ -281,9 +281,9 @@ def draw_pipes(pipes, cap=2, fit=1.0):
Notes
-----
- .. code-block:: python
-
- Schema({"points": lambda x: all(len(y) == 3 for y in x), "radius": And(Or(int, float), lambda x: x > 0)})
+ ```python
+ Schema({"points": lambda x: all(len(y) == 3 for y in x), "radius": And(Or(int, float), lambda x: x > 0)})
+ ```
"""
abs_tol = TOL
@@ -317,9 +317,9 @@ def draw_spheres(spheres):
Notes
-----
- .. code-block:: python
-
- Schema({"pos": lambda x: len(x) == 3, "radius": And(Or(int, float), lambda x: x > 0)})
+ ```python
+ Schema({"pos": lambda x: len(x) == 3, "radius": And(Or(int, float), lambda x: x > 0)})
+ ```
"""
rg_sheres = []
@@ -432,9 +432,9 @@ def draw_circles(circles):
Notes
-----
- .. code-block:: python
-
- Schema({"plane": lambda x: len(x[0]) == 3 and len(x[1]) == 3, "radius": And(Or(int, float), lambda x: x > 0)})
+ ```python
+ Schema({"plane": lambda x: len(x[0]) == 3 and len(x[1]) == 3, "radius": And(Or(int, float), lambda x: x > 0)})
+ ```
"""
rg_circles = []
diff --git a/src/compas_rhino/conduits/base.py b/src/compas_rhino/conduits/base.py
index 9a37013a1504..d3aeb3aff3b9 100644
--- a/src/compas_rhino/conduits/base.py
+++ b/src/compas_rhino/conduits/base.py
@@ -39,11 +39,11 @@ def enabled(self):
Examples
--------
- .. code-block:: python
-
- with conduit.enabled():
- for i in range(10):
- conduit.redraw(k=1)
+ ```python
+ with conduit.enabled():
+ for i in range(10):
+ conduit.redraw(k=1)
+ ```
"""
self.enable()
diff --git a/src/compas_rhino/conduits/faces.py b/src/compas_rhino/conduits/faces.py
index 2743f35f8184..4246d29a3240 100644
--- a/src/compas_rhino/conduits/faces.py
+++ b/src/compas_rhino/conduits/faces.py
@@ -36,16 +36,16 @@ class FacesConduit(BaseConduit):
Examples
--------
- .. code-block:: python
+ ```python
+ from compas.geometry import Polyhedron
+ from compas_rhino.conduits import FacesConduit
- from compas.geometry import Polyhedron
- from compas_rhino.conduits import FacesConduit
+ polyhedron = Polyhedron.generate(6)
+ conduit = FacesConduit(polyhedron.vertices, polyhedron.faces)
- polyhedron = Polyhedron.generate(6)
- conduit = FacesConduit(polyhedron.vertices, polyhedron.faces)
-
- with conduit.enabled():
- conduit.redraw(pause=5.0)
+ with conduit.enabled():
+ conduit.redraw(pause=5.0)
+ ```
"""
diff --git a/src/compas_rhino/conduits/labels.py b/src/compas_rhino/conduits/labels.py
index e36c17397d46..cd2b706c900b 100644
--- a/src/compas_rhino/conduits/labels.py
+++ b/src/compas_rhino/conduits/labels.py
@@ -42,19 +42,19 @@ class LabelsConduit(BaseConduit):
Examples
--------
- .. code-block:: python
+ ```python
+ from random import randint
+ from compas_rhino.conduits import LabelsConduit
- from random import randint
- from compas_rhino.conduits import LabelsConduit
+ labels = [([1.0 * randint(0, 100), 1.0 * randint(0, 100), 0.0], str(i)) for i in range(100)]
- labels = [([1.0 * randint(0, 100), 1.0 * randint(0, 100), 0.0], str(i)) for i in range(100)]
+ conduit = LabelsConduit(labels)
- conduit = LabelsConduit(labels)
-
- with conduit.enabled():
- for i in range(100):
- conduit.labels = [([1.0 * randint(0, 100), 1.0 * randint(0, 100), 0.0], str(i)) for i in range(100)]
- conduit.redraw(pause=0.1)
+ with conduit.enabled():
+ for i in range(100):
+ conduit.labels = [([1.0 * randint(0, 100), 1.0 * randint(0, 100), 0.0], str(i)) for i in range(100)]
+ conduit.redraw(pause=0.1)
+ ```
"""
diff --git a/src/compas_rhino/conduits/lines.py b/src/compas_rhino/conduits/lines.py
index 300f351f427e..b7a56f7a4de6 100644
--- a/src/compas_rhino/conduits/lines.py
+++ b/src/compas_rhino/conduits/lines.py
@@ -41,19 +41,19 @@ class LinesConduit(BaseConduit):
Examples
--------
- .. code-block:: python
-
- from random import randint
-
- points = [(1.0 * randint(0, 30), 1.0 * randint(0, 30), 0.0) for _ in range(100)]
- lines = [(points[i], points[i + 1]) for i in range(99)]
- conduit = LinesConduit(lines)
-
- with conduit.enabled():
- for i in range(100):
- points = [(1.0 * randint(0, 30), 1.0 * randint(0, 30), 0.0) for _ in range(100)]
- conduit.lines = [(points[i], points[i + 1]) for i in range(99)]
- conduit.redraw(pause=0.1)
+ ```python
+ from random import randint
+
+ points = [(1.0 * randint(0, 30), 1.0 * randint(0, 30), 0.0) for _ in range(100)]
+ lines = [(points[i], points[i + 1]) for i in range(99)]
+ conduit = LinesConduit(lines)
+
+ with conduit.enabled():
+ for i in range(100):
+ points = [(1.0 * randint(0, 30), 1.0 * randint(0, 30), 0.0) for _ in range(100)]
+ conduit.lines = [(points[i], points[i + 1]) for i in range(99)]
+ conduit.redraw(pause=0.1)
+ ```
"""
diff --git a/src/compas_rhino/conduits/points.py b/src/compas_rhino/conduits/points.py
index fe850924a5ab..b5ff7b6bd375 100644
--- a/src/compas_rhino/conduits/points.py
+++ b/src/compas_rhino/conduits/points.py
@@ -41,18 +41,18 @@ class PointsConduit(BaseConduit):
Examples
--------
- .. code-block:: python
-
- from random import randint
- from compas_rhino.conduits import PointsConduit
-
- points = [(1.0 * randint(0, 30), 1.0 * randint(0, 30), 0.0) for _ in range(100)]
- conduit = PointsConduit(points)
-
- with conduit.enabled():
- for i in range(100):
- conduit.points = [(1.0 * randint(0, 30), 1.0 * randint(0, 30), 0.0) for _ in range(100)]
- conduit.redraw(pause=0.1)
+ ```python
+ from random import randint
+ from compas_rhino.conduits import PointsConduit
+
+ points = [(1.0 * randint(0, 30), 1.0 * randint(0, 30), 0.0) for _ in range(100)]
+ conduit = PointsConduit(points)
+
+ with conduit.enabled():
+ for i in range(100):
+ conduit.points = [(1.0 * randint(0, 30), 1.0 * randint(0, 30), 0.0) for _ in range(100)]
+ conduit.redraw(pause=0.1)
+ ```
"""
diff --git a/src/compas_rhino/drawing.py b/src/compas_rhino/drawing.py
index b4b99a83da0f..2795a2b6f0d0 100644
--- a/src/compas_rhino/drawing.py
+++ b/src/compas_rhino/drawing.py
@@ -81,19 +81,19 @@ def draw_labels(labels, **kwargs):
-----
A label dict has the following schema:
- .. code-block:: python
-
- Schema(
- {
- "pos": And(list, lambda x: len(x) == 3),
- "text": And(str, len),
- Optional("name", default=""): str,
- Optional("color", default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
- Optional("layer", default=None): str,
- Optional("fontsize", default=10): Or(int, float),
- Optional("font", default="Arial Regular"): str,
- }
- )
+ ```python
+ Schema(
+ {
+ "pos": And(list, lambda x: len(x) == 3),
+ "text": And(str, len),
+ Optional("name", default=""): str,
+ Optional("color", default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
+ Optional("layer", default=None): str,
+ Optional("fontsize", default=10): Or(int, float),
+ Optional("font", default="Arial Regular"): str,
+ }
+ )
+ ```
"""
guids = []
@@ -148,16 +148,16 @@ def draw_points(points, **kwargs):
-----
A point dict has the following schema:
- .. code-block:: python
-
- Schema(
- {
- "pos": And(list, lambda x: len(x) == 3),
- Optional("name", default=""): str,
- Optional("color", default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
- Optional("layer", default=None): str,
- }
- )
+ ```python
+ Schema(
+ {
+ "pos": And(list, lambda x: len(x) == 3),
+ Optional("name", default=""): str,
+ Optional("color", default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
+ Optional("layer", default=None): str,
+ }
+ )
+ ```
"""
guids = []
@@ -207,19 +207,19 @@ def draw_lines(lines, **kwargs):
-----
A line dict has the following schema:
- .. code-block:: python
-
- Schema(
- {
- "start": And(list, lambda x: len(x) == 3),
- "end": And(list, lambda x: len(x) == 3),
- Optional("name", default=""): str,
- Optional("color", default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
- Optional("layer", default=None): str,
- Optional("arrow", default=None): str,
- Optional("width", default=None): Or(int, float),
- }
- )
+ ```python
+ Schema(
+ {
+ "start": And(list, lambda x: len(x) == 3),
+ "end": And(list, lambda x: len(x) == 3),
+ Optional("name", default=""): str,
+ Optional("color", default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
+ Optional("layer", default=None): str,
+ Optional("arrow", default=None): str,
+ Optional("width", default=None): Or(int, float),
+ }
+ )
+ ```
"""
guids = []
@@ -279,19 +279,19 @@ def draw_geodesics(geodesics, **kwargs):
-----
A geodesic dict has the following schema:
- .. code-block:: python
-
- Schema(
- {
- "start": And(list, lambda x: len(x) == 3),
- "end": And(list, lambda x: len(x) == 3),
- "srf": Or(str, System.Guid),
- Optional("name", default=""): str,
- Optional("color", default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
- Optional("layer", default=None): str,
- Optional("arrow", default=None): str,
- }
- )
+ ```python
+ Schema(
+ {
+ "start": And(list, lambda x: len(x) == 3),
+ "end": And(list, lambda x: len(x) == 3),
+ "srf": Or(str, System.Guid),
+ Optional("name", default=""): str,
+ Optional("color", default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
+ Optional("layer", default=None): str,
+ Optional("arrow", default=None): str,
+ }
+ )
+ ```
"""
guids = []
@@ -349,15 +349,15 @@ def draw_polylines(polylines, **kwargs):
-----
A polyline dict has the following schema:
- .. code-block:: python
-
- Schema({
- 'points': And(list, lambda x: all(len(point) == 3 for point in x),
- Optional('name', default=''): str,
- Optional('color', default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
- Optional('layer', default=None): str,
- Optional('arrow', default=None): str
- })
+ ```python
+ Schema({
+ 'points': And(list, lambda x: all(len(point) == 3 for point in x),
+ Optional('name', default=''): str,
+ Optional('color', default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
+ Optional('layer', default=None): str,
+ Optional('arrow', default=None): str
+ })
+ ```
"""
guids = []
@@ -420,14 +420,14 @@ def draw_breps(faces, u=10, v=10, join=False, **kwargs):
-----
A brep dict has the following schema:
- .. code-block:: python
-
- Schema({
- 'points': And(list, lambda x: len(x) > 3 and all(len(point) == 3 for point in x),
- Optional('name', default=''): str,
- Optional('color', default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
- Optional('layer', default=None): str,
- })
+ ```python
+ Schema({
+ 'points': And(list, lambda x: len(x) > 3 and all(len(point) == 3 for point in x),
+ Optional('name', default=''): str,
+ Optional('color', default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
+ Optional('layer', default=None): str,
+ })
+ ```
Examples
--------
@@ -528,18 +528,18 @@ def draw_cylinders(cylinders, cap=False, **kwargs):
-----
A cylinder dict has the following schema:
- .. code-block:: python
-
- Schema(
- {
- "start": And(list, lambda x: len(x) == 3),
- "end": And(list, lambda x: len(x) == 3),
- "radius": And(Or(int, float), lambda x: x > 0.0),
- Optional("name", default=""): str,
- Optional("color", default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
- Optional("layer", default=None): str,
- }
- )
+ ```python
+ Schema(
+ {
+ "start": And(list, lambda x: len(x) == 3),
+ "end": And(list, lambda x: len(x) == 3),
+ "radius": And(Or(int, float), lambda x: x > 0.0),
+ Optional("name", default=""): str,
+ Optional("color", default=None): (lambda x: len(x) == 3 and all(0 <= y <= 255 for y in x)),
+ Optional("layer", default=None): str,
+ }
+ )
+ ```
"""
guids = []
@@ -609,17 +609,17 @@ def draw_pipes(pipes, cap=2, fit=1.0, **kwargs):
-----
A pipe dict has the following schema:
- .. code-block:: python
-
- Schema(
- {
- "points": And(list, lambda x: all(len(y) == 3 for y in x)),
- "radius": And(Or(int, float), lambda x: x > 0.0),
- Optional("name", default=""): str,
- Optional("color", default=None): And(lambda x: len(x) == 3, all(0 <= y <= 255 for y in x)),
- Optional("layer", default=None): str,
- }
- )
+ ```python
+ Schema(
+ {
+ "points": And(list, lambda x: all(len(y) == 3 for y in x)),
+ "radius": And(Or(int, float), lambda x: x > 0.0),
+ Optional("name", default=""): str,
+ Optional("color", default=None): And(lambda x: len(x) == 3, all(0 <= y <= 255 for y in x)),
+ Optional("layer", default=None): str,
+ }
+ )
+ ```
"""
guids = []
@@ -680,17 +680,17 @@ def draw_spheres(spheres, **kwargs):
-----
A sphere dict has the following schema:
- .. code-block:: python
-
- Schema(
- {
- "pos": And(list, lambda x: len(x) == 3),
- "radius": And(Or(int, float), lambda x: x > 0.0),
- Optional("name", default=""): str,
- Optional("color", default=None): And(lambda x: len(x) == 3, all(0 <= y <= 255 for y in x)),
- Optional("layer", default=None): str,
- }
- )
+ ```python
+ Schema(
+ {
+ "pos": And(list, lambda x: len(x) == 3),
+ "radius": And(Or(int, float), lambda x: x > 0.0),
+ Optional("name", default=""): str,
+ Optional("color", default=None): And(lambda x: len(x) == 3, all(0 <= y <= 255 for y in x)),
+ Optional("layer", default=None): str,
+ }
+ )
+ ```
"""
guids = []
@@ -816,16 +816,16 @@ def draw_faces(faces, **kwargs):
-----
A face dict has the following schema:
- .. code-block:: python
-
- Schema(
- {
- "points": And(len, lambda x: all(len(y) == 3 for y in x)),
- Optional("name", default=""): str,
- Optional("color", default=None): And(lambda x: len(x) == 3, all(0 <= y <= 255 for y in x)),
- Optional("vertexcolors", default=None): And(len, lambda x: all(0 <= y <= 255 for y in x)),
- }
- )
+ ```python
+ Schema(
+ {
+ "points": And(len, lambda x: all(len(y) == 3 for y in x)),
+ Optional("name", default=""): str,
+ Optional("color", default=None): And(lambda x: len(x) == 3, all(0 <= y <= 255 for y in x)),
+ Optional("vertexcolors", default=None): And(len, lambda x: all(0 <= y <= 255 for y in x)),
+ }
+ )
+ ```
"""
guids = []
@@ -896,17 +896,17 @@ def draw_circles(circles, **kwargs):
-----
A circle dict has the following schema:
- .. code-block:: python
-
- Schema(
- {
- "plane": lambda x: len(x[0]) == 3 and len(x[1]) == 3,
- "radius": And(Or(int, float), lambda x: x > 0),
- Optional("name", default=""): str,
- Optional("color", default=None): And(lambda x: len(x) == 3, all(0 <= y <= 255 for y in x)),
- Optional("layer", default=None): str,
- }
- )
+ ```python
+ Schema(
+ {
+ "plane": lambda x: len(x[0]) == 3 and len(x[1]) == 3,
+ "radius": And(Or(int, float), lambda x: x > 0),
+ Optional("name", default=""): str,
+ Optional("color", default=None): And(lambda x: len(x) == 3, all(0 <= y <= 255 for y in x)),
+ Optional("layer", default=None): str,
+ }
+ )
+ ```
"""
guids = []
@@ -958,16 +958,16 @@ def draw_curves(curves, **kwargs):
-----
A curve dict has the following schema:
- .. code-block:: python
-
- Schema(
- {
- "curve": compas.geometry.Rhino.Geometry.Curve,
- Optional("name", default=""): str,
- Optional("color", default=None): And(lambda x: len(x) == 3, all(0 <= y <= 255 for y in x)),
- Optional("layer", default=None): str,
- }
- )
+ ```python
+ Schema(
+ {
+ "curve": compas.geometry.Rhino.Geometry.Curve,
+ Optional("name", default=""): str,
+ Optional("color", default=None): And(lambda x: len(x) == 3, all(0 <= y <= 255 for y in x)),
+ Optional("layer", default=None): str,
+ }
+ )
+ ```
"""
guids = []
@@ -1016,16 +1016,16 @@ def draw_surfaces(surfaces, **kwargs):
-----
A surface dict has the following schema:
- .. code-block:: python
-
- Schema(
- {
- "surface": compas.geometry.Surface,
- Optional("name", default=""): str,
- Optional("color", default=None): And(lambda x: len(x) == 3, all(0 <= y <= 255 for y in x)),
- Optional("layer", default=None): str,
- }
- )
+ ```python
+ Schema(
+ {
+ "surface": compas.geometry.Surface,
+ Optional("name", default=""): str,
+ Optional("color", default=None): And(lambda x: len(x) == 3, all(0 <= y <= 255 for y in x)),
+ Optional("layer", default=None): str,
+ }
+ )
+ ```
"""
guids = []
diff --git a/src/compas_rhino/geometry/curves/curve.py b/src/compas_rhino/geometry/curves/curve.py
index a3df7109fa78..e58095dc57a1 100644
--- a/src/compas_rhino/geometry/curves/curve.py
+++ b/src/compas_rhino/geometry/curves/curve.py
@@ -137,8 +137,7 @@ def from_rhino(cls, native_curve):
Warnings
--------
- .. deprecated:: 2.3
- Use `from_native` instead.
+ Deprecated since version 2.3. Use `from_native` instead.
"""
return cls(native_curve)
diff --git a/src/compas_rhino/geometry/surfaces/surface.py b/src/compas_rhino/geometry/surfaces/surface.py
index eb66ca6e8366..e8874dfa9013 100644
--- a/src/compas_rhino/geometry/surfaces/surface.py
+++ b/src/compas_rhino/geometry/surfaces/surface.py
@@ -112,8 +112,7 @@ def from_rhino(cls, native_surface):
Warnings
--------
- .. deprecated:: 2.3
- Use `from_native` instead.
+ Deprecated since version 2.3. Use `from_native` instead.
"""
return cls(native_surface)
diff --git a/src/compas_rhino/install.py b/src/compas_rhino/install.py
index c66fd865dfdb..4679bfb6c380 100644
--- a/src/compas_rhino/install.py
+++ b/src/compas_rhino/install.py
@@ -30,15 +30,15 @@ def install(version=None, packages=None, clean=False):
Examples
--------
- .. code-block:: python
+ ```python
+ import compas_rhino.install
- import compas_rhino.install
+ compas_rhino.install.install()
+ ```
- compas_rhino.install.install()
-
- .. code-block:: bash
-
- python -m compas_rhino.install
+ ```bash
+ python -m compas_rhino.install
+ ```
"""
version = compas_rhino._check_rhino_version(version)
diff --git a/src/compas_rhino/install_plugin.py b/src/compas_rhino/install_plugin.py
index 42fefe6a0517..c518a6e4a047 100644
--- a/src/compas_rhino/install_plugin.py
+++ b/src/compas_rhino/install_plugin.py
@@ -32,9 +32,9 @@ def install_plugin(plugin, version=None):
--------
Assuming the plugin folder is at the following location on your computer
- .. code-block:: none
-
- ~/Code/compas_xxx/ui/Rhino/XXX
+ ```
+ ~/Code/compas_xxx/ui/Rhino/XXX
+ ```
and contains at least a "dev" folder with a ``__plugin__.py`` file with
@@ -43,17 +43,17 @@ def install_plugin(plugin, version=None):
it can be installed with the following command,
- .. code-block:: bash
-
- cd ~/Code/compas_xxx
- python -m compas_rhino.install_plugin ui/Rhino/XXX
+ ```bash
+ cd ~/Code/compas_xxx
+ python -m compas_rhino.install_plugin ui/Rhino/XXX
+ ```
or the following, if the plugin should be installed for Rhino 7.
- .. code-block:: bash
-
- cd ~/Code/compas_xxx
- python -m compas_rhino.install_plugin -v 7.0 ui/Rhino/XXX
+ ```bash
+ cd ~/Code/compas_xxx
+ python -m compas_rhino.install_plugin -v 7.0 ui/Rhino/XXX
+ ```
"""
if not os.path.isdir(plugin):
diff --git a/src/compas_rhino/install_with_pip.py b/src/compas_rhino/install_with_pip.py
index b332e466ade8..bf5df86bbcb7 100644
--- a/src/compas_rhino/install_with_pip.py
+++ b/src/compas_rhino/install_with_pip.py
@@ -80,14 +80,14 @@ def install_in_rhino_with_pip(
This function is made available as a command line script under the name `install_in_rhino`.
On the command line you can use the following syntax
- .. code-block:: bash
-
- install_in_rhino requests numpy
- install_in_rhino -r requirements.txt --env myenv --upgrade
- install_in_rhino . --env myenv
- install_in_rhino .. --env myenv
- install_in_rhino -r requirements.txt --env myenv --no-deps
- install_in_rhino requests --env myenv --clear
+ ```bash
+ install_in_rhino requests numpy
+ install_in_rhino -r requirements.txt --env myenv --upgrade
+ install_in_rhino . --env myenv
+ install_in_rhino .. --env myenv
+ install_in_rhino -r requirements.txt --env myenv --no-deps
+ install_in_rhino requests --env myenv --clear
+ ```
"""
diff --git a/src/compas_rhino/layers.py b/src/compas_rhino/layers.py
index a449fcc6af9a..3e15aa12ae12 100644
--- a/src/compas_rhino/layers.py
+++ b/src/compas_rhino/layers.py
@@ -82,9 +82,9 @@ def create_layers_from_path(path, separator="::"):
* Datastructures
* Mesh
- .. code-block:: python
-
- create_layers_from_path("COMPAS::Datastructures::Mesh")
+ ```python
+ create_layers_from_path("COMPAS::Datastructures::Mesh")
+ ```
"""
names = path.split(separator)
@@ -123,16 +123,16 @@ def create_layers_from_paths(names, separator="::"):
* Point
* Vector
- .. code-block:: python
-
- create_layers_from_paths(
- [
- "COMPAS::Datastructures::Mesh",
- "COMPAS::Datastructures::Graph",
- "COMPAS::Geometry::Point",
- "COMPAS::Geometry::Vector",
- ]
- )
+ ```python
+ create_layers_from_paths(
+ [
+ "COMPAS::Datastructures::Mesh",
+ "COMPAS::Datastructures::Graph",
+ "COMPAS::Geometry::Point",
+ "COMPAS::Geometry::Vector",
+ ]
+ )
+ ```
"""
for name in names:
@@ -155,19 +155,19 @@ def create_layers_from_dict(layers):
Examples
--------
- .. code-block:: python
-
- layers = {
- "COMPAS",
- {
- "layers": {
- "Datastructures": {"color": (255, 0, 0), "layers": {"Mesh": {}, "Graph": {}}},
- "Geometry": {"color": (0, 0, 255), "layers": {"Point": {}, "Vector": {}}},
- }
- },
- }
-
- create_layers_from_dict(layers)
+ ```python
+ layers = {
+ "COMPAS",
+ {
+ "layers": {
+ "Datastructures": {"color": (255, 0, 0), "layers": {"Mesh": {}, "Graph": {}}},
+ "Geometry": {"color": (0, 0, 255), "layers": {"Point": {}, "Vector": {}}},
+ }
+ },
+ }
+
+ create_layers_from_dict(layers)
+ ```
"""
@@ -306,14 +306,14 @@ def delete_layers(layers):
Examples
--------
- .. code-block:: python
-
- layers = {"COMPAS": {"layers": {"Datastructures": {"layers": {"Mesh": {}, "Graph": {}}}}}}
+ ```python
+ layers = {"COMPAS": {"layers": {"Datastructures": {"layers": {"Mesh": {}, "Graph": {}}}}}}
- create_layers(layers)
+ create_layers(layers)
- delete_layers(["COMPAS::Datastructures::Graph"])
- delete_layers({"COMPAS": {"layers": {"Datastructures": {"layers": {"Mesh": {}}}}}})
+ delete_layers(["COMPAS::Datastructures::Graph"])
+ delete_layers({"COMPAS": {"layers": {"Datastructures": {"layers": {"Mesh": {}}}}}})
+ ```
"""
to_delete = []
diff --git a/src/compas_rhino/objects.py b/src/compas_rhino/objects.py
index dae80f58712c..5acd3a94279f 100644
--- a/src/compas_rhino/objects.py
+++ b/src/compas_rhino/objects.py
@@ -38,8 +38,7 @@ def get_point_coordinates(guids):
Warnings
--------
- .. deprecated:: 2.3
- Use `compas_rhino.conversions` instead.
+ Deprecated since version 2.3. Use `compas_rhino.conversions` instead.
"""
warnings.warn("This function will be removed in v2.3. Please use `compas_rhino.conversions` instead.", DeprecationWarning, stacklevel=2)
@@ -67,8 +66,7 @@ def get_line_coordinates(guids):
Warnings
--------
- .. deprecated:: 2.3
- Use `compas_rhino.conversions` instead.
+ Deprecated since version 2.3. Use `compas_rhino.conversions` instead.
"""
warnings.warn("This function will be removed in v2.3. Please use `compas_rhino.conversions` instead.", DeprecationWarning, stacklevel=2)
@@ -100,8 +98,7 @@ def get_polyline_coordinates(guids):
Warnings
--------
- .. deprecated:: 2.3
- Use `compas_rhino.conversions` instead.
+ Deprecated since version 2.3. Use `compas_rhino.conversions` instead.
"""
warnings.warn("This function will be removed in v2.3. Please use `compas_rhino.conversions` instead.", DeprecationWarning, stacklevel=2)
@@ -137,8 +134,7 @@ def get_polygon_coordinates(guids):
Warnings
--------
- .. deprecated:: 2.3
- Use `compas_rhino.conversions` instead.
+ Deprecated since version 2.3. Use `compas_rhino.conversions` instead.
"""
warnings.warn("This function will be removed in v2.3. Please use `compas_rhino.conversions` instead.", DeprecationWarning, stacklevel=2)
diff --git a/src/compas_rhino/uninstall.py b/src/compas_rhino/uninstall.py
index cb4e4a656efe..806796804c81 100644
--- a/src/compas_rhino/uninstall.py
+++ b/src/compas_rhino/uninstall.py
@@ -27,15 +27,15 @@ def uninstall(version=None, packages=None):
Examples
--------
- .. code-block:: python
+ ```python
+ import compas_rhino
- import compas_rhino
+ compas_rhino.uninstall()
+ ```
- compas_rhino.uninstall()
-
- .. code-block:: bash
-
- python -m compas_rhino.uninstall
+ ```bash
+ python -m compas_rhino.uninstall
+ ```
"""
version = compas_rhino._check_rhino_version(version)
diff --git a/src/compas_rhino/uninstall_plugin.py b/src/compas_rhino/uninstall_plugin.py
index 21c61566ac1b..8add5637e89b 100644
--- a/src/compas_rhino/uninstall_plugin.py
+++ b/src/compas_rhino/uninstall_plugin.py
@@ -25,9 +25,9 @@ def uninstall_plugin(plugin, version=None):
Examples
--------
- .. code-block:: bash
-
- python -m compas_rhino.uninstall_plugin XXX
+ ```bash
+ python -m compas_rhino.uninstall_plugin XXX
+ ```
"""
version = compas_rhino._check_rhino_version(version)
diff --git a/src/roslibpy b/src/roslibpy
new file mode 120000
index 000000000000..b6ed9e24c7a6
--- /dev/null
+++ b/src/roslibpy
@@ -0,0 +1 @@
+/Users/jelle/Library/Application Support/McNeel/Rhinoceros/7.0/scripts/roslibpy
\ No newline at end of file
diff --git a/tasks.py b/tasks.py
index 7286febdb086..66ba7898fdfa 100644
--- a/tasks.py
+++ b/tasks.py
@@ -3,19 +3,31 @@
import os
from compas_invocations2 import build
-from compas_invocations2 import docs
from compas_invocations2 import style
from compas_invocations2 import tests
from compas_invocations2 import grasshopper
+from invoke import task
from invoke.collection import Collection
+
+@task
+def docs(ctx):
+ """Build documentation with MkDocs."""
+ ctx.run("mkdocs build --strict")
+
+
+@task
+def serve(ctx):
+ """Serve documentation locally with live reload."""
+ ctx.run("mkdocs serve")
+
+
ns = Collection(
- docs.help,
+ docs,
+ serve,
style.check,
style.lint,
style.format,
- docs.docs,
- docs.linkcheck,
tests.test,
tests.testdocs,
tests.testcodeblocks,
diff --git a/tests/compas/donttest_api_completeness.py b/tests/compas/donttest_api_completeness.py
deleted file mode 100644
index e782572a9e5d..000000000000
--- a/tests/compas/donttest_api_completeness.py
+++ /dev/null
@@ -1,116 +0,0 @@
-# from __future__ import absolute_import
-
-# import os
-# import pytest
-# import shutil
-# import subprocess
-# import importlib
-# import inspect
-# import compas
-
-
-# def get_names_in_module(module_name):
-# exceptions = ["absolute_import", "division", "print_function"]
-# module = importlib.import_module(module_name)
-# all_names = module.__all__ if hasattr(module, "__all__") else dir(module)
-# return sorted(
-# [
-# i
-# for i in all_names
-# if not i.startswith("_") and i not in exceptions and not inspect.ismodule(getattr(module, i))
-# ]
-# )
-
-
-# @pytest.fixture
-# def compas_api():
-# if compas.IPY:
-# return
-
-# modules = [
-# "compas.data",
-# "compas.datastructures",
-# "compas.files",
-# "compas.geometry",
-# "compas.numerical",
-# "compas.plugins",
-# "compas.robots",
-# "compas.rpc",
-# "compas.topology",
-# "compas.utilities",
-# ]
-# api = {}
-# for module_name in modules:
-# api[module_name] = get_names_in_module(module_name)
-# return api
-
-
-# @pytest.fixture
-# def compas_stubs():
-# if compas.IPY:
-# return
-
-# env = compas._os.prepare_environment()
-
-# HERE = os.path.dirname(__file__)
-# HOME = os.path.abspath(os.path.join(HERE, "../.."))
-# TEMP = os.path.abspath(os.path.join(HOME, "temp/stubs"))
-# DOCS = os.path.abspath(os.path.join(HOME, "docs"))
-# API = os.path.abspath(os.path.join(DOCS, "reference"))
-
-# shutil.rmtree(TEMP, ignore_errors=True)
-
-# _, _, filenames = next(os.walk(API))
-# stubs = []
-# for name in filenames:
-# if name == "compas.rst" or not name.startswith("compas."):
-# continue
-# stub = os.path.abspath(os.path.join(API, name))
-# subprocess.call("sphinx-autogen -o {} {}".format(TEMP, stub), shell=True, env=env)
-
-# _, _, filenames = next(os.walk(TEMP))
-
-# shutil.rmtree(TEMP, ignore_errors=True)
-
-# stubs = {}
-# for name in filenames:
-# parts = name.split(".")
-# if len(parts) != 4:
-# continue
-# package = parts[0]
-# module = parts[1]
-# item = parts[2]
-# if package == "compas":
-# packmod = "{}.{}".format(package, module)
-# if packmod not in stubs:
-# stubs[packmod] = []
-# stubs[packmod].append(item)
-
-# return stubs
-
-
-# def test_compas_api_stubs(compas_api, compas_stubs):
-# if compas.IPY:
-# return
-
-# for packmod in compas_api:
-# parts = packmod.split(".")
-# if len(parts) != 2:
-# continue
-# assert packmod in compas_stubs
-# for name in compas_api[packmod]:
-# if name in [
-# "BaseMesh",
-# "BaseGraph",
-# "BaseVolMesh",
-# "Datastructure",
-# "Graph",
-# "HalfEdge",
-# "HalfFace",
-# ]:
-# continue
-# if parts[1] == "plugins":
-# continue
-# if parts[1] == "utilities":
-# continue
-# assert name in compas_stubs[packmod]
diff --git a/tests/compas/stubs.py b/tests/compas/stubs.py
deleted file mode 100644
index bcd330aa34be..000000000000
--- a/tests/compas/stubs.py
+++ /dev/null
@@ -1,84 +0,0 @@
-import os
-import shutil
-import subprocess
-import compas
-
-from donttest_api_stability import get_names_in_module
-
-
-def compas_api():
- modules = [
- "compas.scene",
- "compas.data",
- "compas.datastructures",
- "compas.files",
- "compas.geometry",
- "compas.numerical",
- "compas.plugins",
- "compas.rpc",
- "compas.topology",
- "compas.utilities",
- ]
- api = {}
- for module_name in modules:
- api[module_name] = get_names_in_module(module_name)
- return api
-
-
-def compas_stubs():
- env = compas._os.prepare_environment()
-
- HERE = os.path.dirname(__file__)
- HOME = os.path.abspath(os.path.join(HERE, "../.."))
- TEMP = os.path.abspath(os.path.join(HOME, "temp/stubs"))
- DOCS = os.path.abspath(os.path.join(HOME, "docs"))
- API = os.path.abspath(os.path.join(DOCS, "reference"))
-
- shutil.rmtree(TEMP, ignore_errors=True)
-
- _, _, filenames = next(os.walk(API))
- stubs = []
- for name in filenames:
- if name == "compas.rst" or not name.startswith("compas."):
- continue
- stub = os.path.abspath(os.path.join(API, name))
- subprocess.call("sphinx-autogen -o {} {}".format(TEMP, stub), shell=True, env=env)
-
- _, _, filenames = next(os.walk(TEMP))
-
- shutil.rmtree(TEMP, ignore_errors=True)
-
- stubs = {}
- for name in filenames:
- parts = name.split(".")
- if len(parts) != 4:
- continue
- package = parts[0]
- module = parts[1]
- item = parts[2]
- if package == "compas":
- packmod = "{}.{}".format(package, module)
- if packmod not in stubs:
- stubs[packmod] = []
- stubs[packmod].append(item)
-
- return stubs
-
-
-def check_compas_stubs(api, stubs):
- for packmod in api:
- parts = packmod.split(".")
- if len(parts) != 2:
- continue
- assert packmod in stubs
- for name in api[packmod]:
- if name not in stubs[packmod]:
- print(packmod, name)
-
-
-# ==============================================================================
-# Main
-# ==============================================================================
-
-# if __name__ == "__main__":
-# check_compas_stubs(compas_api(), compas_stubs())