Skip to content

Commit 04be792

Browse files
author
andrewtliew
committed
- Docstrings and future imports.
1 parent 6f1ffb5 commit 04be792

File tree

10 files changed

+89
-85
lines changed

10 files changed

+89
-85
lines changed

src/compas/hpc/core/euler/euler.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def load_euler_module(client, module):
7575
-------
7676
None
7777
"""
78-
ssh.server_command(client=client, command='module load {0}; module list'.format(module))
78+
ssh.server_command(client=client, command='module load {0}: module list'.format(module))
7979

8080

8181
# def loaded_euler_modules(client):
@@ -98,8 +98,8 @@ def recieve_file_from_euler(username, remote_file, local_file):
9898
Parameters
9999
----------
100100
username (str): Username.
101-
remote_file (str); Path of remote file to recieve.
102-
local_file (str); Path to save local file as.
101+
remote_file (str): Path of remote file to recieve.
102+
local_file (str): Path to save local file as.
103103
104104
Returns
105105
-------
@@ -114,7 +114,7 @@ def send_file_to_euler(username, local_file):
114114
Parameters
115115
----------
116116
username (str): Username.
117-
local_file (str); Path of local file to send.
117+
local_file (str): Path of local file to send.
118118
119119
Returns
120120
-------
@@ -129,7 +129,7 @@ def send_folder_to_euler(username, local_folder):
129129
Parameters
130130
----------
131131
username (str): Username.
132-
local_folder (str); Path of local folder to send.
132+
local_folder (str): Path of local folder to send.
133133
134134
Returns
135135
-------
@@ -236,7 +236,7 @@ def submit_job(client, command, time='60', output='output.txt', cpus=1):
236236
None
237237
"""
238238
n = min([24, int(cpus)])
239-
cmd = 'export OMP_NUM_THREADS={0}; bsub -n {0} -W {1} -oo {2} {3}; bbjobs'.format(n, int(time), output, command)
239+
cmd = 'export OMP_NUM_THREADS={0}: bsub -n {0} -W {1} -oo {2} {3}: bbjobs'.format(n, int(time), output, command)
240240
ssh.server_command(client=client, command=cmd)
241241

242242

@@ -250,8 +250,8 @@ def sync_folder_to_euler(username, local_folder, remote_folder):
250250
Parameters
251251
----------
252252
username (str): Username.
253-
local_folder (str); Path of local folder to sync.
254-
remote_folder (str); Path of remote folder to sync.
253+
local_folder (str): Path of local folder to sync.
254+
remote_folder (str): Path of remote folder to sync.
255255
256256
Returns
257257
-------

src/compas/numerical/algorithms/dr.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
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 copy import deepcopy
56

67
from compas.geometry import norm_vectors
78
from compas.topology import adjacency_from_edges
89

910

10-
__author__ = ['Tom Van Mele <[email protected]>']
11-
__copyright__ = 'Copyright 2017, Block Research Group - ETH Zurich'
12-
__license__ = 'MIT License'
13-
__email__ = '[email protected]'
11+
__author__ = ['Tom Van Mele <[email protected]>']
12+
__copyright__ = 'Copyright 2017, Block Research Group - ETH Zurich'
13+
__license__ = 'MIT License'
14+
__email__ = '[email protected]'
1415

1516

1617
__all__ = [

src/compas/numerical/algorithms/dr_numpy.py

Lines changed: 6 additions & 5 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
import sys
56

@@ -20,10 +21,10 @@
2021
from compas.numerical import normrow
2122

2223

23-
__author__ = ['Tom Van Mele <[email protected]>']
24-
__copyright__ = 'Copyright 2017, Block Research Group - ETH Zurich'
25-
__license__ = 'MIT License'
26-
__email__ = '[email protected]'
24+
__author__ = ['Tom Van Mele <[email protected]>']
25+
__copyright__ = 'Copyright 2017, Block Research Group - ETH Zurich'
26+
__license__ = 'MIT License'
27+
__email__ = '[email protected]'
2728

2829

2930
__all__ = [

src/compas/numerical/algorithms/drx_numpy.py

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

55
import sys
66

@@ -30,10 +30,10 @@
3030
from time import time
3131

3232

33-
__author__ = ['Andrew Liew <[email protected]>']
34-
__copyright__ = 'Copyright 2017, Block Research Group - ETH Zurich'
35-
__license__ = 'MIT License'
36-
__email__ = '[email protected]'
33+
__author__ = ['Andrew Liew <[email protected]>']
34+
__copyright__ = 'Copyright 2017, Block Research Group - ETH Zurich'
35+
__license__ = 'MIT License'
36+
__email__ = '[email protected]'
3737

3838

3939
__all__ = [

src/compas/numerical/algorithms/fd.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
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

5-
__author__ = ['Tom Van Mele', ]
6-
__copyright__ = 'Copyright 2017, Block Research Group - ETH Zurich'
7-
__license__ = 'MIT'
8-
__email__ = '[email protected]'
6+
__author__ = ['Tom Van Mele', ]
7+
__copyright__ = 'Copyright 2017, Block Research Group - ETH Zurich'
8+
__license__ = 'MIT'
9+
__email__ = '[email protected]'
910

1011

1112
__all__ = [
@@ -40,7 +41,6 @@ def fd(vertices, edges, fixed, q, loads):
4041
4142
``xyz, q, f, l, r`` as arrays.
4243
43-
4444
Example
4545
-------
4646
.. plot::

src/compas/numerical/algorithms/fd_cpp.py

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

55
import os
66
import ctypes
@@ -16,7 +16,7 @@
1616

1717

1818
__author__ = ['Tom Van Mele', ]
19-
__copyright__ = 'Copyright 2016 - Block Research Group, ETH Zurich'
19+
__copyright__ = 'Copyright 2017 - Block Research Group, ETH Zurich'
2020
__license__ = 'MIT License'
2121
__email__ = '[email protected]'
2222

src/compas/numerical/algorithms/fd_numpy.py

Lines changed: 6 additions & 5 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
import sys
56

@@ -16,10 +17,10 @@
1617
from compas.numerical import normrow
1718

1819

19-
__author__ = ['Tom Van Mele', ]
20-
__copyright__ = 'Copyright 2017, Block Research Group - ETH Zurich'
21-
__license__ = 'MIT'
22-
__email__ = '[email protected]'
20+
__author__ = ['Tom Van Mele', ]
21+
__copyright__ = 'Copyright 2017, Block Research Group - ETH Zurich'
22+
__license__ = 'MIT'
23+
__email__ = '[email protected]'
2324

2425

2526
__all__ = [

src/compas/numerical/algorithms/pca_numpy.py

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

45
import sys
56

@@ -12,10 +13,10 @@
1213
raise
1314

1415

15-
__author__ = ['Tom Van Mele <[email protected]>']
16-
__copyright__ = 'Copyright 2016, BLOCK Research Group - ETH Zurich'
17-
__license__ = 'MIT License'
18-
__email__ = '[email protected]'
16+
__author__ = ['Tom Van Mele <[email protected]>']
17+
__copyright__ = 'Copyright 2017, BLOCK Research Group - ETH Zurich'
18+
__license__ = 'MIT License'
19+
__email__ = '[email protected]'
1920

2021

2122
__all__ = [

src/compas/numerical/linalg.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,6 @@ def wrapper(*args):
408408
def _chofactor(A):
409409
"""Returns the Cholesky factorisation/decomposition matrix.
410410
411-
Note
412-
----
413-
Random data inserted in the entries not used by Cholesky factorisation.
414-
415411
Parameters
416412
----------
417413
A (array): Matrix A represented as an (m x m) array.
@@ -428,6 +424,10 @@ def _chofactor(A):
428424
429425
\mathbf{A} = \mathbf{L} \mathbf{L}^{\mathrm{T}}
430426
427+
Note
428+
----
429+
Random data inserted in the entries not used by Cholesky factorisation.
430+
431431
Examples
432432
--------
433433
>>> _chofactor(array([[25, 15, -5], [15, 18, 0], [-5, 0, 11]]))
@@ -534,10 +534,6 @@ def normrow(A):
534534
def normalizerow(A, do_nan_to_num=True):
535535
"""Normalise the rows of matrix A.
536536
537-
Note
538-
----
539-
Tiling is not necessary, because of NumPy's broadcasting behaviour.
540-
541537
Parameters
542538
----------
543539
A (array): Matrix A represented as an (m x n) array.
@@ -550,6 +546,10 @@ def normalizerow(A, do_nan_to_num=True):
550546
Normalises the row vectors of A by the normrows, i.e. creates an array of
551547
vectors where the row vectors have length of unity.
552548
549+
Note
550+
----
551+
Tiling is not necessary, because of NumPy's broadcasting behaviour.
552+
553553
Examples
554554
--------
555555
>>> normalizerow(array([[2, -1, 3,], [1, 0, 1], [0, 2, -1]]))
@@ -642,10 +642,6 @@ def solve_with_known(A, b, x, known):
642642
def spsolve_with_known(A, b, x, known):
643643
"""Solve (sparse) a system of linear equations with part of solution known.
644644
645-
Note
646-
----
647-
Same function as solve_with_known, but for sparse matrix A.
648-
649645
Parameters
650646
----------
651647
A (array): Coefficient matrix (sparse) represented as an (m x n) array.
@@ -663,6 +659,10 @@ def spsolve_with_known(A, b, x, known):
663659
664660
\mathbf{A} \mathbf{x} = \mathbf{b}
665661
662+
Note
663+
----
664+
Same function as solve_with_known, but for sparse matrix A.
665+
666666
Examples
667667
--------
668668
>>> A = array([[2, 1, 3], [2, 6, 8], [6, 8, 18]])

0 commit comments

Comments
 (0)