abpytools.utils package¶
Submodules¶
abpytools.utils.abpytools_exceptions module¶
abpytools.utils.data_loader module¶
abpytools.utils.downloads module¶
-
abpytools.utils.downloads.
download
(url, verbose, user_agent='wswp', num_retries=2, decoding_format='utf-8', timeout=5)[source]¶ Function to download contents from a given url
- Input:
url: str string with the url to download from
user_agent: str Default ‘wswp’
num_retries: int Number of times to retry downloading if there is an error
verbose: bool Print out url and errors
decoding: “utf-8”
- Output:
- returns: str string with contents of given url
abpytools.utils.math_utils module¶
-
class
abpytools.utils.math_utils.
Matrix2D
¶ Bases:
abpytools.utils.math_utils.Matrix2D_backend
-
shape
¶
-
values
¶ Returns data as a list of lists
-
-
class
abpytools.utils.math_utils.
Matrix2D_backend
¶ Bases:
object
Cython class to manipulate double precision 2D matrix
-
n_cols
¶
-
n_rows
¶
-
size_
¶
-
-
class
abpytools.utils.math_utils.
Vector
¶ Bases:
object
Lightweight Cython vector class implementation that stores data as C arrays and uses these to perform calculations
-
add
()¶ Elementwise addition between two vectors.
- Args:
- other:
Returns:
-
dot_product
()¶ Vector dot product. Args:
other (Vector): a Vector object to calculate the dot product withReturns: the dot product between two vectors
-
exp
()¶
-
multiply
()¶ Elementwise multiplication between two vectors.
- Args:
- other:
Returns:
-
norm
()¶
-
size
¶
-
subtract
()¶ Elementwise subtraction between two vectors.
- Args:
- other:
Returns:
-
values
¶ Returns:
-
-
abpytools.utils.math_utils.
dot_product_
()¶ Python API to use Cython dot_product implementation.
- Args:
- u list: Python list representing vector u v list: Python list representing vector v
Returns: Dot product of u and v