Skip to content

Commit 08d040c

Browse files
author
Chen Kasirer
committed
Merge branch 'robot_artist_tools' of https://github.com/compas-dev/compas into robot_artist_tools
2 parents 7db223d + 5b12798 commit 08d040c

File tree

10 files changed

+393
-91
lines changed

10 files changed

+393
-91
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
* Added `Data.sha256` for computing a hash value of data objects, for example for comparisons during version control.
1515
* Added optional `path` parameter to `compas.rpc.Proxy` to allow for non-package calls.
1616
* Added Grasshopper component to call RPC functions.
17+
* Added alternative installation procedure for Blender on Windows.
1718
* Added `Mesh.to_lines` method and tests.
1819
* Added `Data.guid` to JSON serialization.
1920
* Added `Data.guid` to pickle state.
2021
* Added `Assembly.find_by_key` to locate parts by key.
22+
* Added `clear_edges` and `clear_nodes` to `NetworkArtist` for ghpython.
2123

2224
### Changed
2325

2426
* Set `jinja >= 3.0` to dev dependencies to fix docs build error.
2527
* Fixed removing of collections for `compas_plotters`.
28+
* Fixed bug in `compas_plotters.plotter.Plotter.add_from_list`.
2629
* Fixed bug in `compas.robots.Configuration`.
2730
* Rebuild part index after deserialization in `Assembly`.
2831
* Fixed bug in `compas.artists.colordict.ColorDict`.
2932
* Change `Mesh.mesh_dual` with option of including the boundary.
33+
* Fixed type error in `compas_rhino.conversions._shapes.box_to_rhino`.
34+
* Moved from `autopep8` to `black`
35+
* Fixed bug in `compas.utilities.linspace` for number series with high precision start and stop values.
36+
* Fixed uncentered viewbox in `Plotter.zoom_extents()`
3037
* Changed `RobotModelArtists.atteched_tool_models` to dictionary to support multiple tools.
3138

3239
### Removed

CONTRIBUTING.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ In short, this is how that works.
3737
```
3838

3939
5. Start making your changes to the **master** branch (or branch off of it).
40-
6. Make sure all tests still pass:
40+
6. Auto-format your code using `black -l 180 <path_to_source_file>`.
41+
7. Make sure all tests still pass:
4142

4243
```bash
4344
invoke test
4445
```
4546

46-
7. Add yourself to `AUTHORS.md`.
47-
8. Commit your changes and push your branch to GitHub.
48-
9. Create a [pull request](https://help.github.com/articles/about-pull-requests/) through the GitHub website.
47+
8. Add yourself to `AUTHORS.md`.
48+
9. Commit your changes and push your branch to GitHub.
49+
10. Create a [pull request](https://help.github.com/articles/about-pull-requests/) through the GitHub website.
4950

5051
During development, use [pyinvoke](http://docs.pyinvoke.org/) tasks on the
5152
command line to ease recurring operations:

docs/devguide.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ The procedure for submitting a PR is the following.
7474
Style guide
7575
===========
7676

77+
Please run `black -l 180 <path_to_source_file>` to auto-format your code.
78+
7779
The command ``invoke lint`` runs the entire codebase through ``flake8``.
7880
As described in the `docs <https://flake8.pycqa.org/en/latest/manpage.html>`_,
7981
``flake8`` includes lint checks provided by the PyFlakes project,

docs/gettingstarted/blender.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ It is important that the version of Python installed in the ``conda`` environmen
1212
the version of Python that was originally shipped with Blender. For Blender 2.83 LTS
1313
the version of the bundled Python is 3.7, and for 2.93 LTS it is 3.9.
1414

15+
.. note::
16+
17+
On windows, the standard installation procedure recently stopped working.
18+
For an alternative procedure see `Installation on Windows`_.
19+
1520

1621
Installation
1722
============
@@ -178,3 +183,37 @@ Alternatively, you can create a new environment and simply install entire COMPAS
178183
conda activate blender
179184
pip install compas
180185
python -m compas_blender.install
186+
187+
188+
Installation on Windows
189+
=======================
190+
191+
On Windows, the procedure described above no longer works.
192+
However, an alternative procedure is still possible.
193+
Note that since this procedure is based on installing COMPAS directly using the `python` and `pip` executables shipped with Blender,
194+
it is limited to packages that can be installed from the Python Package Index (PyPI).
195+
196+
The basic command will install `compas` and `compas_blender` (and `compas_rhino` and `compas_ghpython`) for the default version of Blender (2.93),
197+
if that version can be found in the default installation location.
198+
199+
.. code-block:: bash
200+
201+
python -m compas_blender.install_windows
202+
203+
Install for a different version.
204+
205+
.. code-block:: bash
206+
207+
python -m compas_blender.install_windows -v 3.1
208+
209+
Install additional packages.
210+
211+
.. code-block:: bash
212+
213+
python -m compas_blender.install_windows -p compas_cloud
214+
215+
Install with `pip` configuration options.
216+
217+
.. code-block:: bash
218+
219+
python -m compas_blender.install_windows --force-reinstall --no-deps

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
autopep8
1+
black
22
attrs >=17.4
33
bump2version >=1.0.1
44
check-manifest >=0.36

src/compas/utilities/itertools.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616

1717

1818
__all__ = [
19-
'normalize_values',
20-
'remap_values',
21-
'meshgrid',
22-
'linspace',
23-
'flatten',
24-
'pairwise',
25-
'window',
26-
'iterable_like',
27-
'grouper'
19+
"normalize_values",
20+
"remap_values",
21+
"meshgrid",
22+
"linspace",
23+
"flatten",
24+
"pairwise",
25+
"window",
26+
"iterable_like",
27+
"grouper",
2828
]
2929

3030

@@ -57,12 +57,14 @@ def normalize_values(values, new_min=0.0, new_max=1.0):
5757
"""
5858
old_max = max(values)
5959
old_min = min(values)
60-
old_range = (old_max - old_min)
61-
new_range = (new_max - new_min)
60+
old_range = old_max - old_min
61+
new_range = new_max - new_min
6262
return [(((value - old_min) * new_range) / old_range) + new_min for value in values]
6363

6464

65-
def remap_values(values, target_min=0.0, target_max=1.0, original_min=None, original_max=None):
65+
def remap_values(
66+
values, target_min=0.0, target_max=1.0, original_min=None, original_max=None
67+
):
6668
"""Maps a list of numbers from one domain to another.
6769
6870
Parameters
@@ -94,7 +96,7 @@ def remap_values(values, target_min=0.0, target_max=1.0, original_min=None, orig
9496
return [target_min + ((value - original_min) * ratio) for value in values]
9597

9698

97-
def meshgrid(x, y, indexing='xy'):
99+
def meshgrid(x, y, indexing="xy"):
98100
"""Construct coordinate matrices from two coordinate vectors.
99101
100102
Parameters
@@ -153,7 +155,7 @@ def meshgrid(x, y, indexing='xy'):
153155
"""
154156
x = list(x)
155157
y = list(y)
156-
if indexing == 'xy':
158+
if indexing == "xy":
157159
X = [[x[j] for j in range(len(x))] for i in range(len(y))]
158160
Y = [[y[i] for j in range(len(x))] for i in range(len(y))]
159161
else:
@@ -193,8 +195,9 @@ def linspace(start, stop, num=50):
193195
194196
"""
195197
step = (stop - start) / (num - 1)
196-
for i in range(num):
198+
for i in range(num - 1):
197199
yield start + i * step
200+
yield float(stop)
198201

199202

200203
def flatten(list_of_lists):
@@ -364,8 +367,7 @@ def padnone(iterable):
364367

365368

366369
def grouper(iterable, n, fillvalue=None):
367-
"""Collect data into fixed-length chunks or blocks.
368-
"""
370+
"""Collect data into fixed-length chunks or blocks."""
369371
args = [iter(iterable)] * n
370372
return zip_longest(*args, fillvalue=fillvalue)
371373

0 commit comments

Comments
 (0)