Skip to content

Commit ea7fb10

Browse files
committed
Merge branch 'main' into fix-halfedge-before-on-boundary
2 parents 9d8cc6d + fb36991 commit ea7fb10

File tree

228 files changed

+907
-2949
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+907
-2949
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ insert_final_newline = true
88
indent_style = space
99
indent_size = 4
1010
charset = utf-8
11-
max_line_length = 180
11+
max_line_length = 120
1212

1313
[*.{bat,cmd,ps1}]
1414
end_of_line = crlf

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2727

2828
* Based all gltf data classes on `BaseGLTFDataClass`
2929
* Fixed `Color.__get___` AttributeError.
30+
* Fixed `RhinoSurface.curvature_at` not returning a Vector, but a Rhino SurfaceCurvature class object
3031
* Fixed `cylinder_to_rhino` conversion to match `compas.geometry.Cylinder` location.
3132
* Changed identification of cylinder brep face to non-zero in `compas_rhino.conversions.cylinder.Cylinder`.
3233
* Changed linter to `black`.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ 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. Auto-format your code using `black -l 180 <path_to_source_file>`.
40+
6. Auto-format your code using `black <path_to_source_file>`.
4141
7. Make sure all tests still pass:
4242

4343
```bash

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ include AUTHORS.md
1313
include CHANGELOG.md
1414
include requirements.txt
1515
include conftest.py
16+
include pyproject.toml
1617

1718
exclude requirements-dev.txt
1819
exclude pytest.ini .bumpversion.cfg .editorconfig

docs/devguide.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ 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.
77+
Please run `black <path_to_source_file>` to auto-format your code.
7878

7979
The command ``invoke lint`` runs the entire codebase through ``flake8``.
8080
As described in the `docs <https://flake8.pycqa.org/en/latest/manpage.html>`_,
@@ -88,7 +88,7 @@ https://flake8.pycqa.org/en/latest/user/error-codes.html
8888
The PEP-0008 style guide is available here:
8989
https://www.python.org/dev/peps/pep-0008/
9090

91-
Note that the maximum line length is set to 180 rather 79 in the ``setup.cfg`` of the repo.
91+
Note that the maximum line length is set to 120 rather 79 in the ``setup.cfg`` of the repo.
9292

9393

9494
Naming conventions

pyproject.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[tool.black]
2+
line-length = 120
3+
4+
[tool.pytest.ini_options]
5+
minversion = "6.0"
6+
testpaths = ["tests", "src/compas"]
7+
python_files = [
8+
"test_*.py",
9+
"tests.py"
10+
]
11+
addopts = "-ra --strict --doctest-modules --doctest-glob=*.rst --tb=short"
12+
doctest_optionflags= "NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ALLOW_UNICODE ALLOW_BYTES NUMBER"
13+
filterwarnings = "ignore::DeprecationWarning"
14+
15+
[tool.isort]
16+
line_length = 120
17+
multi_line_output = 3
18+
include_trailing_comma = true
19+
force_grid_wrap = 0
20+
use_parentheses = true
21+
force_single_line = true
22+
ensure_newline_before_comments = true
23+
known_first_party = "compas"
24+
default_section = "THIRDPARTY"
25+
forced_separate = "test_compas"
26+
skip = ["__init__.py"]

setup.cfg

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,13 @@
22
universal = 1
33

44
[flake8]
5-
max-line-length = 180
5+
max-line-length = 120
66
exclude = */migrations/*
77
extend-ignore = E203
88

99
[doc8]
10-
max-line-length = 180
10+
max-line-length = 120
1111
ignore = D001
1212

1313
[pydocstyle]
1414
convention = numpy
15-
16-
[tool:pytest]
17-
testpaths =
18-
tests
19-
src/compas
20-
norecursedirs =
21-
migrations
22-
python_files =
23-
test_*.py
24-
*_test.py
25-
tests.py
26-
addopts =
27-
-ra
28-
--strict
29-
--doctest-glob=\*.rst
30-
--tb=short
31-
doctest_optionflags =
32-
NORMALIZE_WHITESPACE
33-
IGNORE_EXCEPTION_DETAIL
34-
ALLOW_UNICODE
35-
ALLOW_BYTES
36-
NUMBER
37-
38-
[isort]
39-
force_single_line = True
40-
line_length = 180
41-
known_first_party = compas
42-
default_section = THIRDPARTY
43-
forced_separate = test_compas
44-
skip = migrations, __init__.py

src/compas/__init__.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,7 @@ def get(filename):
240240
if os.path.exists(localpath):
241241
return localpath
242242
else:
243-
return "https://raw.githubusercontent.com/compas-dev/compas/main/src/compas/data/samples/{}".format(
244-
filename
245-
)
243+
return "https://raw.githubusercontent.com/compas-dev/compas/main/src/compas/data/samples/{}".format(filename)
246244

247245

248246
def get_bunny(localstorage=None):
@@ -288,14 +286,10 @@ def get_bunny(localstorage=None):
288286
os.makedirs(localstorage)
289287

290288
if not os.path.isdir(localstorage):
291-
raise Exception(
292-
"Local storage location does not exist: {}".format(localstorage)
293-
)
289+
raise Exception("Local storage location does not exist: {}".format(localstorage))
294290

295291
if not os.access(localstorage, os.W_OK):
296-
raise Exception(
297-
"Local storage location is not writable: {}".format(localstorage)
298-
)
292+
raise Exception("Local storage location is not writable: {}".format(localstorage))
299293

300294
bunny = compas._os.absjoin(localstorage, "bunny/reconstruction/bun_zipper.ply")
301295
destination = compas._os.absjoin(localstorage, "bunny.tar.gz")

src/compas/__main__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@
2323
print("Yay! COMPAS is installed correctly!")
2424
print()
2525
print("COMPAS: {}".format(compas.__version__))
26-
print(
27-
"Python: {} ({})".format(
28-
platform.python_version(), platform.python_implementation()
29-
)
30-
)
26+
print("Python: {} ({})".format(platform.python_version(), platform.python_implementation()))
3127

3228
if pkg_resources:
3329
working_set = pkg_resources.working_set

src/compas/_os.py

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ def select_python(python_executable):
194194
either `python` or `pythonw`.
195195
"""
196196
if PYTHON_DIRECTORY and os.path.exists(PYTHON_DIRECTORY):
197-
python_executables = (
198-
[python_executable] if python_executable else ["pythonw", "python"]
199-
)
197+
python_executables = [python_executable] if python_executable else ["pythonw", "python"]
200198

201199
for python_exe in python_executables:
202200
python = os.path.join(PYTHON_DIRECTORY, python_exe)
@@ -284,9 +282,7 @@ def _realpath_ipy_win(path):
284282
parent_path = os.path.join(path, "..")
285283

286284
args = 'dir /c "{}" /Al'.format(parent_path)
287-
process = subprocess.Popen(
288-
args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
289-
)
285+
process = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
290286

291287
output, _error = process.communicate()
292288
matches = SYMLINK_REGEX.finditer(output)
@@ -302,9 +298,7 @@ def _realpath_ipy_win(path):
302298

303299
def _realpath_ipy_posix(path):
304300
args = 'readlink -f "{}"'.format(path)
305-
process = subprocess.Popen(
306-
args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
307-
)
301+
process = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
308302
output, _error = process.communicate()
309303
return output
310304

@@ -323,14 +317,8 @@ def _polyfill_symlinks(symlinks, raise_on_error):
323317
mklink_cmd.write("ECHO ret=%symlink_result%\n")
324318
for i, (source, link_name) in enumerate(symlinks):
325319
dir_symlink_arg = "/D" if os.path.isdir(source) else ""
326-
mklink_cmd.write(
327-
"mklink {} {}\n".format(
328-
dir_symlink_arg, subprocess.list2cmdline([link_name, source])
329-
)
330-
)
331-
mklink_cmd.write(
332-
"IF %ERRORLEVEL% EQU 0 SET /A symlink_result += {} \n".format(2**i)
333-
)
320+
mklink_cmd.write("mklink {} {}\n".format(dir_symlink_arg, subprocess.list2cmdline([link_name, source])))
321+
mklink_cmd.write("IF %ERRORLEVEL% EQU 0 SET /A symlink_result += {} \n".format(2**i))
334322

335323
mklink_cmd.write("EXIT /B %symlink_result%\n")
336324

@@ -547,9 +535,7 @@ def _run_command_as_admin(command, arguments):
547535

548536
with open(temp_path, "w") as remove_symlink_cmd:
549537
remove_symlink_cmd.write("@echo off\n")
550-
remove_symlink_cmd.write(
551-
"{} {}\n".format(command, subprocess.list2cmdline(arguments))
552-
)
538+
remove_symlink_cmd.write("{} {}\n".format(command, subprocess.list2cmdline(arguments)))
553539

554540
_run_as_admin([temp_path])
555541

@@ -588,10 +574,7 @@ def _run_as_admin(command):
588574
ctypes.windll.kernel32.WaitForSingleObject(process_handle, INFINITE)
589575

590576
ret = ctypes.wintypes.DWORD()
591-
if (
592-
ctypes.windll.kernel32.GetExitCodeProcess(process_handle, ctypes.byref(ret))
593-
== 0
594-
):
577+
if ctypes.windll.kernel32.GetExitCodeProcess(process_handle, ctypes.byref(ret)) == 0:
595578
raise RuntimeError("Failed to retrieve exit code")
596579

597580
return ret.value

0 commit comments

Comments
 (0)