Skip to content

Commit 719dd28

Browse files
authored
Merge pull request #989 from Licini/workflow
test docs
2 parents 01e91d8 + dc8b9ac commit 719dd28

File tree

6 files changed

+19
-25
lines changed

6 files changed

+19
-25
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v2
1919

20-
- uses: compas-dev/compas-actions.docs@v1.3.0
20+
- uses: compas-dev/compas-actions.docs@v1.4.1
2121
id: docs
2222
with:
2323
dest: deploy
2424
build_to_subfolder: true
25+
test_docs: true
2526

2627
- name: Deploy docs
2728
if: success() && steps.docs.outputs.commit_type != 'pull'

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
* Added doc test step in CI/CD.
13+
1214
### Changed
1315

1416
### Removed

src/compas/datastructures/mesh/matrices.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ def mesh_adjacency_matrix(mesh, rtype='array'):
5656
<class 'numpy.ndarray'>
5757
5858
>>> A = mesh_adjacency_matrix(mesh, rtype='csr')
59-
>>> type(A)
60-
<class 'scipy.sparse.csr.csr_matrix'>
6159
6260
"""
6361
key_index = mesh.key_index()
@@ -89,8 +87,6 @@ def mesh_connectivity_matrix(mesh, rtype='array'):
8987
<class 'numpy.ndarray'>
9088
9189
>>> C = mesh_connectivity_matrix(mesh, rtype='csr')
92-
>>> type(C)
93-
<class 'scipy.sparse.csr.csr_matrix'>
9490
9591
>>> xyz = asarray(mesh.vertices_attributes('xyz'))
9692
>>> C = mesh_connectivity_matrix(mesh, rtype='csr')
@@ -126,8 +122,6 @@ def mesh_degree_matrix(mesh, rtype='array'):
126122
<class 'numpy.ndarray'>
127123
128124
>>> D = mesh_degree_matrix(mesh, rtype='csr')
129-
>>> type(D)
130-
<class 'scipy.sparse.csr.csr_matrix'>
131125
132126
>>> D = mesh_degree_matrix(mesh)
133127
>>> D.diagonal()
@@ -181,8 +175,6 @@ def mesh_face_matrix(mesh, rtype='array'):
181175
<class 'numpy.ndarray'>
182176
183177
>>> F = mesh_face_matrix(mesh, rtype='csr')
184-
>>> type(F)
185-
<class 'scipy.sparse.csr.csr_matrix'>
186178
187179
>>> from numpy import allclose
188180
>>> xyz = asarray(mesh.vertices_attributes('xyz'))
@@ -247,8 +239,6 @@ def mesh_laplacian_matrix(mesh, rtype='csr'):
247239
<class 'numpy.ndarray'>
248240
249241
>>> L = mesh_face_matrix(mesh, rtype='csr')
250-
>>> type(L)
251-
<class 'scipy.sparse.csr.csr_matrix'>
252242
253243
>>> xyz = asarray(mesh.vertices_attributes('xyz'))
254244
>>> L = mesh_laplacian_matrix(mesh)

src/compas/geometry/_core/distance.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -606,13 +606,12 @@ def closest_points_in_cloud_numpy(points, cloud, threshold=10**7, distances=True
606606
607607
Examples
608608
--------
609+
>>> from numpy import allclose
609610
>>> points = [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]]
610611
>>> cloud = [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]]
611-
>>> closest_points_in_cloud_numpy(points, cloud, distances=True)
612-
(array([0, 1, 2, 3], dtype=int64), array([[0. , 1. , 1.41421356, 1. ],
613-
[1. , 0. , 1. , 1.41421356],
614-
[1.41421356, 1. , 0. , 1. ],
615-
[1. , 1.41421356, 1. , 0. ]]))
612+
>>> cp = closest_points_in_cloud_numpy(points, cloud, distances=True)
613+
>>> allclose(cp[1], [[0, 1, 1.4142, 1], [1, 0, 1, 1.4142], [1.4142, 1, 0, 1], [1, 1.4142, 1, 0]])
614+
True
616615
617616
"""
618617
from numpy import asarray

src/compas/numerical/linalg.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,10 @@ def dof(A, tol=0.001, condition=False):
166166
167167
Examples
168168
--------
169-
>>> dof([[2, -1, 3], [1, 0, 1], [0, 2, -1], [1, 1, 4]], condition=True)
170-
(0, 1, 5.073596551276727)
169+
>>> from numpy import allclose
170+
>>> d = dof([[2, -1, 3], [1, 0, 1], [0, 2, -1], [1, 1, 4]], condition=True)
171+
>>> allclose(d, (0, 1, 5.073596551))
172+
True
171173
172174
"""
173175
A = atleast_2d(asarray(A, dtype=float))

src/compas/rpc/proxy.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ class Proxy(object):
8989
Minimal example showing connection to the proxy server, and ensuring the
9090
server is disposed after using it:
9191
92-
>>> from compas.rpc import Proxy
93-
>>> with Proxy('compas.numerical') as numerical:
94-
... pass
95-
...
96-
Starting a new proxy server...
97-
New proxy server started.
98-
Stopping the server proxy.
92+
>>> from compas.rpc import Proxy # doctest: +SKIP
93+
>>> with Proxy('compas.numerical') as numerical: # doctest: +SKIP
94+
... pass # doctest: +SKIP
95+
... # doctest: +SKIP
96+
Starting a new proxy server... # doctest: +SKIP
97+
New proxy server started. # doctest: +SKIP
98+
Stopping the server proxy. # doctest: +SKIP
9999
"""
100100

101101
def __init__(self, package=None, python=None, url='http://127.0.0.1', port=1753, service=None, max_conn_attempts=100, autoreload=True, capture_output=True):

0 commit comments

Comments
 (0)