Skip to content

Commit b53cf34

Browse files
author
andrewtliew
committed
- More/tidying numerical docstrings.
- devo_numba tidied. - parallel=False on many Numba functions, as is an experimental argument. - hpc.core created, opencl and cuda to be sorted still.
1 parent 7786c2d commit b53cf34

File tree

27 files changed

+903
-715
lines changed

27 files changed

+903
-715
lines changed

src/compas/hpc/__init__.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
.. autosummary::
2929
:toctree: generated/
3030
31+
sum_vectors_numba
3132
norm_vector_numba
3233
norm_vectors_numba
3334
length_vector_numba
@@ -58,18 +59,26 @@
5859
cross_vectors_xy_numba
5960
dot_vectors_numba
6061
dot_vectors_xy_numba
62+
vector_component_numba
63+
vector_component_xy_numba
6164
multiply_matrices_numba
6265
multiply_matrix_vector_numba
66+
transpose_matrix_numba
67+
orthonormalise_vectors_numba
68+
plane_from_points_numba
69+
circle_from_points_numba
6370
6471
65-
cuda
72+
solvers
6673
====
6774
6875
.. autosummary::
6976
:toctree: generated/
7077
78+
devo_numba
7179
72-
euler
80+
81+
core
7382
=====
7483
7584
.. autosummary::
@@ -89,22 +98,16 @@
8998
kill_job
9099
sync_folder_to_euler
91100
92-
93-
opencl
94-
======
95-
96-
.. autosummary::
97-
:toctree: generated/
98-
99-
100101
"""
101102

102103
from .geometry import *
103-
from .euler import *
104+
from .core import *
104105
from .algorithms import *
106+
from .solvers import *
105107

106108
from .geometry import __all__ as a
107-
from .euler import __all__ as b
109+
from .core import __all__ as b
108110
from .algorithms import __all__ as c
111+
from .solvers import __all__ as d
109112

110-
__all__ = a + b + c
113+
__all__ = a + b + c + d

src/compas/hpc/algorithms/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .drx_numba import drx_numba
1+
from .drx_numba import *
22

33
from .drx_numba import __all__ as a
44

src/compas/hpc/algorithms/drx_numba.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from __future__ import print_function
21
from __future__ import absolute_import
2+
from __future__ import division
3+
from __future__ import print_function
34

45
from numpy import arccos
56
from numpy import array
@@ -24,10 +25,10 @@
2425
from time import time
2526

2627

27-
__author__ = ['Andrew Liew <[email protected]>']
28-
__copyright__ = 'Copyright 2017, BLOCK Research Group - ETH Zurich'
29-
__license__ = 'MIT License'
30-
__email__ = '[email protected]'
28+
__author__ = ['Andrew Liew <[email protected]>']
29+
__copyright__ = 'Copyright 2017, BLOCK Research Group - ETH Zurich'
30+
__license__ = 'MIT License'
31+
__email__ = '[email protected]'
3132

3233

3334
__all__ = [
@@ -38,15 +39,17 @@
3839
def drx_numba(network, factor=1.0, tol=0.1, steps=10000, summary=0, update=False):
3940
""" Run Numba accelerated dynamic relaxation analysis.
4041
41-
Parameters:
42+
Parameters
43+
----------
4244
network (obj): Network to analyse.
4345
factor (float): Convergence factor.
4446
tol (float): Tolerance value.
4547
steps (int): Maximum number of steps.
4648
summary (int): Print summary at end.
4749
update (bool): Update the co-ordinates of the Network.
4850
49-
Returns:
51+
Returns
52+
-------
5053
array: Vertex co-ordinates.
5154
array: Edge forces.
5255
array: Edge lengths.
@@ -118,12 +121,13 @@ def drx_numba(network, factor=1.0, tol=0.1, steps=10000, summary=0, update=False
118121
return X, f, l
119122

120123

121-
@jit(nogil=True, nopython=True)
124+
@jit(nogil=True, nopython=True, parallel=False)
122125
def drx_solver(tol, steps, factor, u, v, X, ks, l0, f0, ind_c, ind_t, rows, cols, vals, P, S, B, M, summary,
123126
inds, indi, indf, EIx, EIy, beams):
124127
""" Numba accelerated dynamic relaxation solver.
125128
126-
Parameters:
129+
Parameters
130+
----------
127131
tol (float): Tolerance limit.
128132
steps (int): Maximum number of steps.
129133
factor (float): Convergence factor.
@@ -150,7 +154,8 @@ def drx_solver(tol, steps, factor, u, v, X, ks, l0, f0, ind_c, ind_t, rows, cols
150154
EIy (array): Nodal EIy flexural stiffnesses.
151155
beams (int): Beam analysis on: 1 or off: 0.
152156
153-
Returns:
157+
Returns
158+
-------
154159
array: Updated nodal co-ordinates.
155160
"""
156161
m = len(u)
@@ -269,7 +274,7 @@ def drx_solver(tol, steps, factor, u, v, X, ks, l0, f0, ind_c, ind_t, rows, cols
269274

270275

271276
# ==============================================================================
272-
# Testing
277+
# Main
273278
# ==============================================================================
274279

275280
if __name__ == "__main__":

src/compas/hpc/core/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from .euler_ import *
2+
3+
from .euler_ import __all__ as a
4+
5+
__all__ = a

src/compas/hpc/core/cuda_/__init__.py

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from .euler import *
2+
23
from .euler import __all__ as a
34

45
__all__ = a

0 commit comments

Comments
 (0)