ams.core.service.NumHstack#

class ams.core.service.NumHstack(u: Callable, ref: Callable, args: dict = None, name: str = None, tex_name: str = None, unit: str = None, info: str = None, vtype: Type = None, rfun: Callable = None, rargs: dict = None, no_parse: bool = False, sparse: bool = False)[source]#

Repeat an array along the second axis nc times or the length of reference array, using NumPy's hstack function, where nc is the column number of the reference array, np.hstack([u.v[:, np.newaxis] * ref.shape[1]], **kwargs).

Parameters:
uCallable

Input array.

refCallable

Reference array used to determine the number of repetitions.

namestr, optional

Instance name.

tex_namestr, optional

TeX name.

unitstr, optional

Unit.

infostr, optional

Description.

vtypeType, optional

Variable type.

modelstr, optional

Model name.

sparse: bool, optional

True to return output as scipy csr_matrix.

__init__(u: Callable, ref: Callable, args: dict = None, name: str = None, tex_name: str = None, unit: str = None, info: str = None, vtype: Type = None, rfun: Callable = None, rargs: dict = None, no_parse: bool = False, sparse: bool = False)[source]#

Methods

assign_memory(n)

Assign memory for self.v and set the array to zero.

get_names()

Return name in a list

parse()

Parse the parameter.

update()

Update the Parameter value.

Attributes

class_name

Return the class name

n

Return the count of values in self.v.

shape

Return the shape of the service.

size

Return the size.

v

Value of the service.

v0

v1