API

Global variables

peng.constants.FP_ATOL = 1e-11

Absolute tolerance used in equality comparisons

Type:float
peng.constants.FP_RTOL = 1e-11

Relative tolerance used in equality comparisons

Type:float

Named tuples

peng.functions.EngPower(suffix, exp)

Constructor for engineering notation suffix.

peng.NumComp(mant, exp)

Constructor for number components representation.

peng.wave_core.Point(indep_var, dep_var)

Constructor for a waveform data point.

The first item is the independent variable data and the second item is the dependent variable data

Functions

peng.functions.no_exp(number)

Convert number to string guaranteeing result is not in scientific notation.

Parameters:number (integer or float) – Number to convert
Return type:string
Raises:RuntimeError (Argument `number` is not valid)
peng.functions.peng(number, frac_length, rjust=True)

Convert a number to engineering notation.

The absolute value of the number (if it is not exactly zero) is bounded to the interval [1E-24, 1E+24)

Parameters:
  • number (integer or float) – Number to convert
  • frac_length (NonNegativeInteger) – Number of digits of fractional part
  • rjust (boolean) – Flag that indicates whether the number is right-justified (True) or not (False)
Return type:

string

Raises:
  • RuntimeError (Argument `frac_length` is not valid)
  • RuntimeError (Argument `number` is not valid)
  • RuntimeError (Argument `rjust` is not valid)

The supported engineering suffixes are:

Exponent Name Suffix
1E-24 yocto y
1E-21 zepto z
1E-18 atto a
1E-15 femto f
1E-12 pico p
1E-9 nano n
1E-6 micro u
1E-3 milli m
1E+0    
1E+3 kilo k
1E+6 mega M
1E+9 giga G
1E+12 tera T
1E+15 peta P
1E+18 exa E
1E+21 zetta Z
1E+24 yotta Y

For example:

>>> import peng
>>> peng.peng(1235.6789E3, 3, False)
'1.236M'
peng.functions.peng_float(snum)

Return floating point equivalent of a number represented in engineering notation.

Parameters:snum (EngineeringNotationNumber) – Number
Return type:string
Raises:RuntimeError (Argument `snum` is not valid)

For example:

>>> import peng
>>> peng.peng_float(peng.peng(1235.6789E3, 3, False))
1236000.0
peng.functions.peng_frac(snum)

Return the fractional part of a number represented in engineering notation.

Parameters:snum (EngineeringNotationNumber) – Number
Return type:integer
Raises:RuntimeError (Argument `snum` is not valid)

For example:

>>> import peng
>>> peng.peng_frac(peng.peng(1235.6789E3, 3, False))
236
peng.functions.peng_int(snum)

Return the integer part of a number represented in engineering notation.

Parameters:snum (EngineeringNotationNumber) – Number
Return type:integer
Raises:RuntimeError (Argument `snum` is not valid)

For example:

>>> import peng
>>> peng.peng_int(peng.peng(1235.6789E3, 3, False))
1
peng.functions.peng_mant(snum)

Return the mantissa of a number represented in engineering notation.

Parameters:snum (EngineeringNotationNumber) – Number
Return type:float
Raises:RuntimeError (Argument `snum` is not valid)

For example:

>>> import peng
>>> peng.peng_mant(peng.peng(1235.6789E3, 3, False))
1.236
peng.functions.peng_power(snum)

Return engineering suffix and its floating point equivalent of a number.

peng.peng() lists the correspondence between suffix and floating point exponent.

Parameters:snum (EngineeringNotationNumber) – Number
Return type:named tuple in which the first item is the engineering suffix and the second item is the floating point equivalent of the suffix when the number is represented in engineering notation.
Raises:RuntimeError (Argument `snum` is not valid)

For example:

>>> import peng
>>> peng.peng_power(peng.peng(1235.6789E3, 3, False))
EngPower(suffix='M', exp=1000000.0)
peng.functions.peng_suffix(snum)

Return the suffix of a number represented in engineering notation.

Parameters:snum (EngineeringNotationNumber) – Number
Return type:string
Raises:RuntimeError (Argument `snum` is not valid)

For example:

>>> import peng
>>> peng.peng_suffix(peng.peng(1235.6789E3, 3, False))
'M'
peng.functions.peng_suffix_math(suffix, offset)

Return engineering suffix from a starting suffix and an number of suffixes offset.

Parameters:
Return type:

string

Raises:
  • RuntimeError (Argument `offset` is not valid)
  • RuntimeError (Argument `suffix` is not valid)
  • ValueError (Argument `offset` is not valid)

For example:

>>> import peng
>>> peng.peng_suffix_math('u', 6)
'T'
peng.functions.pprint_vector(vector, limit=False, width=None, indent=0, eng=False, frac_length=3)

Format a list of numbers (vector) or a Numpy vector for printing.

If the argument vector is None the string 'None' is returned

Parameters:
  • vector (list of integers or floats, Numpy vector or None) – Vector to pretty print or None
  • limit (boolean) – Flag that indicates whether at most 6 vector items are printed (all vector items if its length is equal or less than 6, first and last 3 vector items if it is not) (True), or the entire vector is printed (False)
  • width (integer or None) – Number of available characters per line. If None the vector is printed in one line
  • indent (boolean) – Flag that indicates whether all subsequent lines after the first one are indented (True) or not (False). Only relevant if width is not None
  • eng (boolean) – Flag that indicates whether engineering notation is used (True) or not (False)
  • frac_length (integer) – Number of digits of fractional part (only applicable if eng is True)
Raises:

ValueError (Argument `width` is too small)

Return type:

string

For example:

>>> from __future__ import print_function
>>> import peng
>>> header = 'Vector: '
>>> data = [1e-3, 20e-6, 300e+6, 4e-12, 5.25e3, -6e-9, 700, 8, 9]
>>> print(
...     header+peng.pprint_vector(
...         data,
...         width=30,
...         eng=True,
...         frac_length=1,
...         limit=True,
...         indent=len(header)
...     )
... )
Vector: [    1.0m,   20.0u,  300.0M,
                     ...
           700.0 ,    8.0 ,    9.0  ]
>>> print(
...     header+peng.pprint_vector(
...         data,
...         width=30,
...         eng=True,
...         frac_length=0,
...         indent=len(header)
...     )
... )
Vector: [    1m,   20u,  300M,    4p,
             5k,   -6n,  700 ,    8 ,
             9  ]
>>> print(peng.pprint_vector(data, eng=True, frac_length=0))
[    1m,   20u,  300M,    4p,    5k,   -6n,  700 ,    8 ,    9  ]
>>> print(peng.pprint_vector(data, limit=True))
[ 0.001, 2e-05, 300000000.0, ..., 700, 8, 9 ]
peng.touchstone.read_touchstone(fname)

Read a Touchstone file.

According to the specification a data line can have at most values for four complex parameters (plus potentially the frequency point), however this function is able to process malformed files as long as they have the correct number of data points (points x nports x nports where points represents the number of frequency points and nports represents the number of ports in the file). Per the Touchstone specification noise data is only supported for two-port files

Parameters:fname (FileNameExists) – Touchstone file name
Return type:dictionary with the following structure:
Raises:
  • OSError (File [fname] could not be found)
  • RuntimeError (Argument `fname` is not valid)
  • RuntimeError (File [fname] does not have a valid extension)
  • RuntimeError (File [fname] has no data)
  • RuntimeError (First non-comment line is not the option line)
  • RuntimeError (Frequency must increase)
  • RuntimeError (Illegal data in line [lineno])
  • RuntimeError (Illegal option line)
  • RuntimeError (Malformed data)
  • RuntimeError (Malformed noise data)
  • RuntimeError (Noise frequency must increase)

Note

The returned parameter(s) are complex numbers in real and imaginary format regardless of the format used in the Touchstone file. Similarly, the returned frequency vector unit is Hertz regardless of the unit used in the Touchstone file

peng.touchstone.write_touchstone(fname, options, data, noise=None, frac_length=10, exp_length=2)

Write a Touchstone file.

Parameter data is first resized to an points x nports x nports where points represents the number of frequency points and nports represents the number of ports in the file; then parameter data is written to file in scientific notation

Parameters:
  • fname – Touchstone file name
  • options (TouchstoneOptions) – Touchstone file options
  • data (TouchstoneData) – Touchstone file parameter data
  • noise (TouchstoneNoiseData) – Touchstone file parameter noise data (only supported in two-port files)
  • frac_length (non-negative integer) – Number of digits to use in fractional part of data
  • exp_length (positive integer) – Number of digits to use in exponent
Raises:
  • RuntimeError (Argument `data` is not valid)
  • RuntimeError (Argument `exp_length` is not valid)
  • RuntimeError (Argument `fname` is not valid)
  • RuntimeError (Argument `frac_length` is not valid)
  • RuntimeError (Argument `noise` is not valid)
  • RuntimeError (Argument `options` is not valid)
  • RuntimeError (File [fname] does not have a valid extension)
  • RuntimeError (Malformed data)
  • RuntimeError (Noise data only supported in two-port files)
peng.functions.remove_extra_delims(expr, ldelim='(', rdelim=')')

Remove unnecessary delimiters in mathematical expressions.

Delimiters (parenthesis, brackets, etc.) may be removed either because there are multiple consecutive delimiters enclosing a single expressions or because the delimiters are implied by operator precedence rules. Function names must start with a letter and then can contain alphanumeric characters and a maximum of one underscore

Parameters:
  • expr (string) – Mathematical expression
  • ldelim (string) – Single character left delimiter
  • rdelim (string) – Single character right delimiter
Return type:

string

Raises:
  • RuntimeError (Argument `expr` is not valid)
  • RuntimeError (Argument `ldelim` is not valid)
  • RuntimeError (Argument `rdelim` is not valid)
  • RuntimeError (Function name *[function_name]* is not valid)
  • RuntimeError (Mismatched delimiters)
peng.functions.round_mantissa(arg, decimals=0)

Round floating point number(s) mantissa to given number of digits.

Integers are not altered. The mantissa used is that of the floating point number(s) when expressed in normalized scientific notation

Parameters:
  • arg (integer, float, Numpy vector of integers or floats, or None) – Input data
  • decimals (integer) – Number of digits to round the fractional part of the mantissa to.
Return type:

same as arg

For example:

>>> import peng
>>> peng.round_mantissa(012345678E-6, 3)
12.35
>>> peng.round_mantissa(5, 3)
5
peng.functions.to_scientific_string(number, frac_length=None, exp_length=None, sign_always=False)

Convert number or number string to a number string in scientific notation.

Full precision is maintained if the number is represented as a string

Parameters:
  • number (number or string) – Number to convert
  • frac_length (integer or None) – Number of digits of fractional part, None indicates that the fractional part of the number should not be limited
  • exp_length (integer or None) – Number of digits of the exponent; the actual length of the exponent takes precedence if it is longer
  • sign_always (boolean) – Flag that indicates whether the sign always precedes the number for both non-negative and negative numbers (True) or only for negative numbers (False)
Return type:

string

For example:

>>> import peng
>>> peng.to_scientific_string(333)
'3.33E+2'
>>> peng.to_scientific_string(0.00101)
'1.01E-3'
>>> peng.to_scientific_string(99.999, 1, 2, True)
'+1.0E+02'
peng.functions.to_scientific_tuple(number)

Return mantissa and exponent of a number in scientific notation.

Full precision is maintained if the number is represented as a string

Parameters:number (integer, float or string) – Number
Return type:named tuple in which the first item is the mantissa (string) and the second item is the exponent (integer) of the number when expressed in scientific notation

For example:

>>> import peng
>>> peng.to_scientific_tuple('135.56E-8')
NumComp(mant='1.3556', exp=-6)
>>> peng.to_scientific_tuple(0.0000013556)
NumComp(mant='1.3556', exp=-6)

Waveform pseudo-type

Class

class peng.wave_core.Waveform(indep_vector, dep_vector, dep_name, indep_scale='LINEAR', dep_scale='LINEAR', indep_units='', dep_units='', interp='CONTINUOUS')

Bases: object

Create a waveform.

A waveform is an object that binds together an independent variable vector with a corresponding dependent variable vector and other relevant meta data (independent and dependent variable scale, units and type of function to be used for interpolating between given independent variable data points).

All standard mathematical operators (+, -, *, //, %, **, <<, >>, &, ^, |) are supported between waveform objects and between a number (integer, float or complex) and a waveform object. An integer dependent variable vector preserves its type through any operation unless an interpolated dependent variable item results in a floating point value.

Additionally waveform slicing, iteration and data point membership in the waveform are supported. The object(s) expected, returned or tested against are 2-item tuples that meet the characteristics of the peng.Point named tuple

Parameters:
  • indep_vector (IncreasingRealNumpyVector) – Independent variable vector
  • dep_vector (NumberNumpyVector) – Dependent variable vector
  • dep_name (NonNullString) – Independent variable name
  • indep_scale (WaveScaleOption) – Independent variable scale
  • dep_scale (WaveScaleOption) – Dependent variable scale
  • indep_units (string) – Independent variable units
  • dep_units (string) – Dependent variable units
  • interp (WaveInterpOption) – Interpolation function used between dependent variable vector elements
Return type:

peng.Waveform()

Raises:
  • RuntimeError (Argument `dep_name` is not valid)
  • RuntimeError (Argument `dep_scale` is not valid)
  • RuntimeError (Argument `dep_units` is not valid)
  • RuntimeError (Argument `dep_vector` is not valid)
  • RuntimeError (Argument `indep_scale` is not valid)
  • RuntimeError (Argument `indep_units` is not valid)
  • RuntimeError (Argument `indep_vector` is not valid)
  • RuntimeError (Argument `interp` is not valid)
  • ValueError (Independent and dependent vectors must have the same number of elements)

Note

Waveforms are “homogenized” before they are used in mathematical operations, comparisons, or any other manipulation involving two waveforms. First a new independent variable vector is created, which is the ordered set resulting from the intersection of the independent variable vectors of the two waveforms. An exception is raised if there is no overlap (null intersection) between the two independent variable vectors. Then the dependent variable vector of each waveform is regenerated for the new independent variable vector, computing values for elements that are not in the waveform’s independent variable vector using the specified waveform’s interpolation function.

The two waveforms must have identical independent variable scale, dependent variable scale, independent variable units, dependent variable units and interpolation function.

__add__(other)

Add dependent variable vectors of two waveforms or a waveform and a number.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector_a = np.array([4, 5, 6])
>>> dep_vector_b = np.array([8, 2, 4])
>>> obj_a = peng.Waveform(indep_vector, dep_vector_a, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector_b, 'obj_b')
>>> print(obj_a+obj_b)
Waveform: obj_a+obj_b
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 12, 7, 10 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Data type not supported)
__and__(other)

Bit-wise logic and waveform operation.

The logic operation is done on the dependent variable vectors of two waveforms or the dependent variable vector of a waveform and a number.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector_a = np.array([4, 5, 6])
>>> dep_vector_b = np.array([8, 2, 4])
>>> obj_a = peng.Waveform(indep_vector, dep_vector_a, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector_b, 'obj_b')
>>> print(obj_a&obj_b)
Waveform: obj_a&obj_b
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 0, 0, 4 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:
  • RuntimeError (Independent variable ranges do not overlap)
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Complex operands not supported)
  • TypeError (Data type not supported)
__bool__()

Test if the waveform dependent variable is zero for all its elements.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector = np.array([4, 5, 6])
>>> obj = peng.Waveform(indep_vector, dep_vector, 'obj_a')
>>> if obj:
...     print('Boolean test returned: True')
... else:
...     print('Boolean test returned: False')
Boolean test returned: True
>>> dep_vector = np.zeros(3)
>>> obj = peng.Waveform(indep_vector, dep_vector, 'obj_a')
>>> if obj:
...     print('Boolean test returned: True')
... else:
...     print('Boolean test returned: False')
Boolean test returned: False
__contains__(item)

Test if an item is a data point in the waveform.

An item is in a waveform when it is a tuple with the characteristics of the peng.Point named tuple and its independent and dependent values match a waveform’s data point with peng.FP_ATOL absolute tolerance and peng.FP_RTOL relative tolerance

Parameters:item (any) – Object
__copy__()

Copy object.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector = np.array([4, 5, 6])
>>> obj_a = peng.Waveform(indep_vector, dep_vector, 'obj_a')
>>> obj_b = copy.copy(obj_a)
>>> obj_a == obj_b
True
>>> obj_a is obj_b
False
__delitem__(key)

Delete a waveform slice.

Parameters:key (integer or slice object) – Slice key
Raises:Same exceptions as an invalid Numpy array slicing operation
__div__(other)

Divide the dependent variable vector of a waveform.

The division may be by the dependent variable vector of another waveform, the dependent variable vector of a waveform by a number, or a number by the dependent variable vector of a waveform. In the latter case a peng.Waveform() object is returned with the result.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector_a = np.array([4, 5, 6])
>>> dep_vector_b = np.array([8.0, 2.0, 4.0])
>>> obj_a = peng.Waveform(indep_vector, dep_vector_a, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector_b, 'obj_b')
>>> print(obj_a/obj_b)
Waveform: obj_a/obj_b
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 0.5, 2.5, 1.5 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Data type not supported)
__eq__(other)

Test waveform equality.

Two waveforms are equal if their independent variable vectors are the same with peng.FP_ATOL absolute tolerance and peng.FP_RTOL relative tolerance, their dependent variable vectors are the same with peng.FP_ATOL absolute tolerance and peng.FP_RTOL relative tolerance, their independent variable scales are the same, their dependent variable scales are the same, their independent variable units are the same, their dependent variable units are the same and they have the same interpolation function. Thus if two waveforms are constructed such that they are identical but for their variable name, they are considered equal.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector = np.array([4, 5, 6])
>>> obj_a = peng.Waveform(indep_vector, dep_vector, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector, 'obj_b')
>>> obj_a == obj_b
True
>>> obj_a != obj_b
False
>>> dep_vector = obj_a.dep_vector+5
>>> obj_b = peng.Waveform(indep_vector, dep_vector, 'obj_b')
>>> obj_a == obj_b
False
>>> obj_a != obj_b
True

A waveform is considered equal to a real number when its dependent variable vector is equal to that number for all of its elements. For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector = 12.5*np.ones(len(indep_vector))
>>> obj = peng.Waveform(indep_vector, dep_vector, 'obj_a')
>>> 5 == obj
False
>>> obj == 12.5
True
__floordiv__(other)

Integer-divide the dependent variable vector of a waveform.

The integer division may be by the dependent variable vector of another waveform, the dependent variable vector of a waveform by a number, or a number by the dependent variable vector of a waveform. In the latter case a peng.Waveform() object is returned with the result.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector_a = np.array([4, 5, 6])
>>> dep_vector_b = np.array([8, 2, 4])
>>> obj_a = peng.Waveform(indep_vector, dep_vector_a, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector_b, 'obj_b')
>>> print(obj_a//obj_b)
Waveform: obj_a//obj_b
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 0, 2, 1 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:
  • RuntimeError (Independent variable ranges do not overlap)
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Complex operands not supported)
  • TypeError (Data type not supported)
__ge__(other)

Test whether waveform is greater or equal than another waveform or real number.

A waveform is greater than or equal to another waveform or a number if all elements of its dependent variable vector are greater than or equal to, element-by-element, the elements of the dependent variable vector of another waveform or a real number with peng.FP_ATOL absolute tolerance and peng.FP_RTOL relative tolerance

Raises:
  • RuntimeError (Independent variable ranges do not overlap)
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Complex operands not supported)
  • TypeError (Data type not supported)
__getitem__(key)

Slice waveform.

Parameters:key (integer or slice object) – Slice key
Returns:peng.Point named tuple or list of peng.Point named tuples
Raises:Same exceptions as an invalid Numpy array slicing operation
__gt__(other)

Test whether waveform is greater than another waveform or real number.

A waveform is greater than another waveform or a number if all elements of its dependent variable vector are greater than, element-by-element, the elements of the dependent variable vector of another waveform or a real number with peng.FP_ATOL absolute tolerance and peng.FP_RTOL relative tolerance

Raises:
  • RuntimeError (Independent variable ranges do not overlap)
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Complex operands not supported)
  • TypeError (Data type not supported)
__invert__()

Bit-wise inversion of the dependent variable vector of a waveform.

For example:

>>> import math, numpy, peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector = np.array([6, 5, 4])
>>> obj = peng.Waveform(indep_vector, dep_vector, 'obj')
>>> print(~obj)
Waveform: ~obj
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ -7, -6, -5 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:TypeError (Complex operand not supported)
__iter__()

Return an iterable over the independent and dependent variable vectors.

Each item returned by an iterator is a peng.Point named tuple

Return type:iterable
__le__(other)

Test whether waveform is less than or equal to another waveform or real number.

A waveform is less than or equal to another waveform or a number if all elements of its dependent variable vector are less than or equal to, element-by-element, the elements of the dependent variable vector of another waveform or a real number with peng.FP_ATOL absolute tolerance and peng.FP_RTOL relative tolerance

Raises:
  • RuntimeError (Independent variable ranges do not overlap)
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Complex operands not supported)
  • TypeError (Data type not supported)
__len__()

Return number of elements in independent (or dependent) variable vector.

__lshift__(other)

Left shift the dependent variable vector of a waveform.

The shift amount be set by the dependent variable vector of another waveform or a number.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector_a = np.array([4, 5, 6])
>>> dep_vector_b = np.array([8, 2, 4])
>>> obj_a = peng.Waveform(indep_vector, dep_vector_a, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector_b, 'obj_b')
>>> print(obj_a<<obj_b)
Waveform: obj_a<<obj_b
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 1024, 20, 96 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:
  • RuntimeError (Independent variable ranges do not overlap)
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Complex operands not supported)
  • TypeError (Data type not supported)
__lt__(other)

Test whether a waveform is less than another waveform or real number.

A waveform is less than another waveform or a number if all elements of its dependent variable vector are less than, element-by-element, the elements of the dependent variable vector of another waveform or a real number with peng.FP_ATOL absolute tolerance and peng.FP_RTOL relative tolerance

Raises:
  • RuntimeError (Independent variable ranges do not overlap)
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Complex operands not supported)
  • TypeError (Data type not supported)
__mod__(other)

Division reminder.

The division reminder may be computed between the dependent variable vectors of two waveforms, between the dependent variable vector of a waveform and a number, or a number by the dependent variable vector of a waveform. In the latter case a peng.Waveform() object is returned with the result.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector_a = np.array([4, 5, 6])
>>> dep_vector_b = np.array([8, 2, 4])
>>> obj_a = peng.Waveform(indep_vector, dep_vector_a, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector_b, 'obj_b')
>>> print(obj_a%obj_b)
Waveform: obj_a%obj_b
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 4, 1, 2 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:
  • RuntimeError (Independent variable ranges do not overlap)
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Complex operands not supported)
  • TypeError (Data type not supported)
__mul__(other)

Multiply the dependent variable vector of a waveform.

The multiplication may be computed element-by-element using another the dependent variable vector of another waveform or a number.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector_a = np.array([4, 5, 6])
>>> dep_vector_b = np.array([8, 2, 4])
>>> obj_a = peng.Waveform(indep_vector, dep_vector_a, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector_b, 'obj_b')
>>> print(obj_a*obj_b)
Waveform: obj_a*obj_b
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 32, 10, 24 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Data type not supported)
__ne__(other)

Test waveform inequality.

Two waveforms are considered unequal if their independent variable vectors are different with peng.FP_ATOL absolute tolerance and peng.FP_RTOL relative tolerance, and/or their dependent variable vectors are different with peng.FP_ATOL absolute tolerance and peng.FP_RTOL relative tolerance, and/or their independent variable scales are not the same, and/or their dependent variable scales are not the, and/or their independent variable units are not the same, and/or their dependent variable units are not the same and/or they do not have the same interpolation function.

A waveform is considered unequal to a real number when its dependent variable is not equal to that number at least in one element.

__neg__()

Multiply the dependent variable vector by -1.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector = np.array([4, -5, 6])
>>> obj = peng.Waveform(indep_vector, dep_vector, 'obj')
>>> print(-obj)
Waveform: -obj
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ -4, 5, -6 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
__nonzero__()

Test if the waveform dependent vector is zero for all its elements.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector = np.array([4, 5, 6])
>>> obj = peng.Waveform(indep_vector, dep_vector, 'obj_a')
>>> if obj:
...     print('Boolean test returned: True')
... else:
...     print('Boolean test returned: False')
Boolean test returned: True
>>> dep_vector = np.zeros(3)
>>> obj = peng.Waveform(indep_vector, dep_vector, 'obj_a')
>>> if obj:
...     print('Boolean test returned: True')
... else:
...     print('Boolean test returned: False')
Boolean test returned: False
__or__(other)

Bit-wise logic or the dependent variable of a waveform.

The other operand may be the dependent variable vector of another waveform or a number.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector_a = np.array([4, 5, 6])
>>> dep_vector_b = np.array([8, 2, 4])
>>> obj_a = peng.Waveform(indep_vector, dep_vector_a, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector_b, 'obj_b')
>>> print(obj_a|obj_b)
Waveform: obj_a|obj_b
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 12, 7, 6 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:
  • RuntimeError (Independent variable ranges do not overlap)
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Complex operands not supported)
  • TypeError (Data type not supported)
__pos__()

Multiply the dependent variable vector of a waveform by +1.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector = np.array([4, 5, 6])
>>> obj = peng.Waveform(indep_vector, dep_vector, 'obj')
>>> print(+obj)
Waveform: obj
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 4, 5, 6 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
__pow__(other)

Raise the dependent variable vector of a waveform to a power exponent.

The exponent specified by the dependent variable vector of another waveform, the dependent variable vector of a waveform to the power specified by a number, or a number by the power specified by the dependent variable vector of a waveform. In the latter case a peng.Waveform() object is returned with the result.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector_a = np.array([4, 5, 6])
>>> dep_vector_b = np.array([8, 2, 4])
>>> obj_a = peng.Waveform(indep_vector, dep_vector_a, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector_b, 'obj_b')
>>> print(obj_a**obj_b)
Waveform: obj_a**obj_b
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 65536, 25, 1296 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:
  • RuntimeError (Independent variable ranges do not overlap)
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Data type not supported)
  • ValueError (Integers to negative integer powers are not allowed)
__radd__(other)

Reflected addition.

See peng.Waveform.__add__() for more details

__rand__(other)

Reflected bit-wise logic and.

See peng.Waveform.__and__() for more details

__repr__()

Return a string with the expression needed to re-create the object.

For example:

>>> import numpy as np
>>> import peng
>>> obj = peng.Waveform(
...     np.array([1, 2, 3]),
...     np.array([4, 5, 6]),
...     'test'
... )
>>> repr(obj)
"peng.Waveform(indep_vector=array([1, 2, 3]), dep_vector=array([4, 5, 6]), dep_name='test', indep_scale='LINEAR', dep_scale='LINEAR', indep_units='', dep_units='', interp='CONTINUOUS')"
__rfloordiv__(other)

Reflected floor (integer) division.

See peng.Waveform.__floordiv__() for more details

__rlshift__(other)

Reflected left shift.

See peng.Waveform.__lshift__() for more details

__rmod__(other)

Reflected division.

See peng.Waveform.__mod__() for more details

__rmul__(other)

Reflected multiplication.

See peng.Waveform.__mul__() for more details

__ror__(other)

Reflected bit-wise logic or.

See peng.Waveform.__or__() for more details

__rpow__(other)

Reflected power.

See peng.Waveform.__pow__() for more details

__rrshift__(other)

Reflected right shift.

See peng.Waveform.__rshift__() for more details

__rshift__(other)

Right shift the dependent variable vector of a waveform.

The shift amount be set by the dependent variable vector of another waveform or a number.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector_a = np.array([4, 5, 6])
>>> dep_vector_b = np.array([1, 2, 1])
>>> obj_a = peng.Waveform(indep_vector, dep_vector_a, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector_b, 'obj_b')
>>> print(obj_a>>obj_b)
Waveform: obj_a>>obj_b
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 2, 1, 3 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:
  • RuntimeError (Independent variable ranges do not overlap)
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Complex operands not supported)
  • TypeError (Data type not supported)
__rsub__(other)

Reflected subtraction.

See peng.Waveform.__sub__() for more details

__rtruediv__(other)

Reflected true (floating) division.

See peng.Waveform.__truediv__() for more details

__rxor__(other)

Reflected bit-wise logic exclusive or .

See peng.Waveform.__xor__() for more details

__setitem__(key, value)

Assign a waveform slice.

Parameters:
  • key (integer or slice object) – Slice key
  • value (2-item tuple or list of 2-item tuples) – Slice value
Raises:
  • Argument value is not valid
  • Same exceptions as an invalid Numpy array slicing operation
__str__()

Return a string with a detailed description of the object’s contents.

For example:

>>> from __future__ import print_function
>>> import numpy as np
>>> import peng
>>> obj = peng.Waveform(
...     np.array([1, 2, 3]),
...     np.array([4, 5, 6]),
...     'test'
... )
>>> print(obj)
Waveform: test
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 4, 5, 6 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
__sub__(other)

Subtract two waveforms, waveform by a number or a number by a waveform.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector_a = np.array([4, 5, 6])
>>> dep_vector_b = np.array([8, 2, 4])
>>> obj_a = peng.Waveform(indep_vector, dep_vector_a, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector_b, 'obj_b')
>>> print(obj_a-obj_b)
Waveform: obj_a-obj_b
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ -4, 3, 2 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Data type not supported)
__truediv__(other)

Divide (true division) the dependent variable vector of a waveform.

The division may be between the dependent variable vector of a waveform by the dependent variable vector of another waveform, the dependent variable vector of a waveform by a number, or a number by the dependent variable vector of a waveform. In the latter case a peng.Waveform() object is returned with the result.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector_a = np.array([4, 5, 6])
>>> dep_vector_b = np.array([8.0, 2.0, 4.0])
>>> obj_a = peng.Waveform(indep_vector, dep_vector_a, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector_b, 'obj_b')
>>> print(obj_a/obj_b)
Waveform: obj_a/obj_b
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 0.5, 2.5, 1.5 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Data type not supported)
__xor__(other)

Bit-wise logic exclusive or waveform operation.

For example:

>>> import numpy as np
>>> import peng
>>> indep_vector = np.array([1, 2, 3])
>>> dep_vector_a = np.array([4, 5, 6])
>>> dep_vector_b = np.array([8, 2, 4])
>>> obj_a = peng.Waveform(indep_vector, dep_vector_a, 'obj_a')
>>> obj_b = peng.Waveform(indep_vector, dep_vector_b, 'obj_b')
>>> print(obj_a^obj_b)
Waveform: obj_a^obj_b
Independent variable: [ 1, 2, 3 ]
Dependent variable: [ 12, 7, 2 ]
Independent variable scale: LINEAR
Dependent variable scale: LINEAR
Independent variable units: (None)
Dependent variable units: (None)
Interpolating function: CONTINUOUS
Raises:
  • RuntimeError (Independent variable ranges do not overlap)
  • RuntimeError (Waveforms are not compatible)
  • TypeError (Complex operands not supported)
  • TypeError (Data type not supported)
complex

Returns True if dependent variable is complex, False otherwise

dep_scale

Gets or sets the waveform dependent variable scale

Type:WaveScaleOption
Raises:(when assigned) RuntimeError (Argument `dep_scale` is not valid)
dep_units

Gets or sets the waveform dependent variable units

Type:string
Raises:(when assigned) RuntimeError (Argument `dep_units` is not valid)
dep_vector

Gets or sets the waveform dependent variable vector

Type:NumberNumpyVector
Raises:

(when assigned)

  • RuntimeError (Argument `dep_vector` is not valid)
  • ValueError (Independent and dependent vectors must have the same number of elements)
indep_scale

Gets or sets the waveform independent variable scale

Type:WaveScaleOption
Raises:(when assigned) RuntimeError (Argument `indep_scale` is not valid)
indep_units

Gets or sets the waveform independent variable units

Type:string
Raises:(when assigned) RuntimeError (Argument `indep_units` is not valid)
indep_vector

Gets the waveform independent variable vector

Type:IncreasingRealNumpyVector
Raises:

(when assigned)

  • RuntimeError (Argument `indep_vector` is not valid)
  • ValueError (Independent and dependent vectors must have the same number of elements)
interp

Gets or sets the interpolation function used between dependent variable vector elements

Type:WaveInterpOption
Raises:(when assigned) RuntimeError (Argument `interp` is not valid)
real

Returns True if dependent variable is real, False otherwise

vectors

Gets or sets the independent and dependent variable vectors. The first tuple item is the independent variable vector and the second tuple item is the dependent variable vector

Type:WaveVectors
Raises:(when assigned) RuntimeError (Argument `vectors` is not valid)

Functions

peng.wave_functions.acos(wave)

Return the arc cosine of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:
  • RuntimeError (Argument `wave` is not valid)
  • ValueError (Math domain error)
peng.wave_functions.acosh(wave)

Return the hyperbolic arc cosine of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:
  • RuntimeError (Argument `wave` is not valid)
  • ValueError (Math domain error)
peng.wave_functions.asin(wave)

Return the arc sine of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:
  • RuntimeError (Argument `wave` is not valid)
  • ValueError (Math domain error)
peng.wave_functions.asinh(wave)

Return the hyperbolic arc sine of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.atan(wave)

Return the arc tangent of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.atanh(wave)

Return the hyperbolic arc tangent of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:
  • RuntimeError (Argument `wave` is not valid)
  • ValueError (Math domain error)
peng.wave_functions.average(wave, indep_min=None, indep_max=None)

Return the running average of a waveform’s dependent variable vector.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
peng.wave_functions.ceil(wave)

Return the ceiling of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.cos(wave)

Return the cosine of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.cosh(wave)

Return the hyperbolic cosine of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.db(wave)

Return a waveform’s dependent variable vector expressed in decibels.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:
  • RuntimeError (Argument `wave` is not valid)
  • ValueError (Math domain error)
peng.wave_functions.derivative(wave, indep_min=None, indep_max=None)

Return the numerical derivative of a waveform’s dependent variable vector.

The method used is the backwards differences method

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

float

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
peng.wave_functions.exp(wave)

Return the natural exponent of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.fft(wave, npoints=None, indep_min=None, indep_max=None)

Return the Fast Fourier Transform of a waveform.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • npoints (positive integer) – Number of points to use in the transform. If npoints is less than the size of the independent variable vector the waveform is truncated; if npoints is greater than the size of the independent variable vector, the waveform is zero-padded
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `npoints` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
  • RuntimeError (Non-uniform sampling)
peng.wave_functions.fftdb(wave, npoints=None, indep_min=None, indep_max=None)

Return the Fast Fourier Transform of a waveform.

The dependent variable vector of the returned waveform is expressed in decibels

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • npoints (positive integer) – Number of points to use in the transform. If npoints is less than the size of the independent variable vector the waveform is truncated; if npoints is greater than the size of the independent variable vector, the waveform is zero-padded
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `npoints` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
  • RuntimeError (Non-uniform sampling)
peng.wave_functions.ffti(wave, npoints=None, indep_min=None, indep_max=None)

Return the imaginary part of the Fast Fourier Transform of a waveform.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • npoints (positive integer) – Number of points to use in the transform. If npoints is less than the size of the independent variable vector the waveform is truncated; if npoints is greater than the size of the independent variable vector, the waveform is zero-padded
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `npoints` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
  • RuntimeError (Non-uniform sampling)
peng.wave_functions.fftm(wave, npoints=None, indep_min=None, indep_max=None)

Return the magnitude of the Fast Fourier Transform of a waveform.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • npoints (positive integer) – Number of points to use in the transform. If npoints is less than the size of the independent variable vector the waveform is truncated; if npoints is greater than the size of the independent variable vector, the waveform is zero-padded
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `npoints` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
  • RuntimeError (Non-uniform sampling)
peng.wave_functions.fftp(wave, npoints=None, indep_min=None, indep_max=None, unwrap=True, rad=True)

Return the phase of the Fast Fourier Transform of a waveform.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • npoints (positive integer) – Number of points to use in the transform. If npoints is less than the size of the independent variable vector the waveform is truncated; if npoints is greater than the size of the independent variable vector, the waveform is zero-padded
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
  • unwrap (boolean) – Flag that indicates whether phase should change phase shifts to their 2*pi complement (True) or not (False)
  • rad (boolean) – Flag that indicates whether phase should be returned in radians (True) or degrees (False)
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `npoints` is not valid)
  • RuntimeError (Argument `rad` is not valid)
  • RuntimeError (Argument `unwrap` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
  • RuntimeError (Non-uniform sampling)
peng.wave_functions.fftr(wave, npoints=None, indep_min=None, indep_max=None)

Return the real part of the Fast Fourier Transform of a waveform.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • npoints (positive integer) – Number of points to use in the transform. If npoints is less than the size of the independent variable vector the waveform is truncated; if npoints is greater than the size of the independent variable vector, the waveform is zero-padded
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `npoints` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
  • RuntimeError (Non-uniform sampling)
peng.wave_functions.find(wave, dep_var, der=None, inst=1, indep_min=None, indep_max=None)

Return the independent variable point associated with a dependent variable point.

If the dependent variable point is not in the dependent variable vector the independent variable vector point is obtained by linear interpolation

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • dep_var (integer, float or complex) – Dependent vector value to search for
  • der (integer, float or complex) – Dependent vector derivative filter. If +1 only independent vector points that have positive derivatives when crossing the requested dependent vector point are returned; if -1 only independent vector points that have negative derivatives when crossing the requested dependent vector point are returned; if 0 only independent vector points that have null derivatives when crossing the requested dependent vector point are returned; otherwise if None all independent vector points are returned regardless of the dependent vector derivative. The derivative of the first and last point of the waveform is assumed to be null
  • inst (positive integer) – Instance number filter. If, for example, inst equals 3, then the independent variable vector point at which the dependent variable vector equals the requested value for the third time is returned
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

integer, float or None if the dependent variable point is not found

Raises:
  • RuntimeError (Argument `dep_var` is not valid)
  • RuntimeError (Argument `der` is not valid)
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `inst` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
peng.wave_functions.floor(wave)

Return the floor of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.group_delay(wave)

Return the group delay of a waveform.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.ifft(wave, npoints=None, indep_min=None, indep_max=None)

Return the inverse Fast Fourier Transform of a waveform.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • npoints (positive integer) – Number of points to use in the transform. If npoints is less than the size of the independent variable vector the waveform is truncated; if npoints is greater than the size of the independent variable vector, the waveform is zero-padded
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `npoints` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
  • RuntimeError (Non-uniform frequency spacing)
peng.wave_functions.ifftdb(wave, npoints=None, indep_min=None, indep_max=None)

Return the inverse Fast Fourier Transform of a waveform.

The dependent variable vector of the returned waveform is expressed in decibels

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • npoints (positive integer) – Number of points to use in the transform. If npoints is less than the size of the independent variable vector the waveform is truncated; if npoints is greater than the size of the independent variable vector, the waveform is zero-padded
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `npoints` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
  • RuntimeError (Non-uniform frequency spacing)
peng.wave_functions.iffti(wave, npoints=None, indep_min=None, indep_max=None)

Return the imaginary part of the inverse Fast Fourier Transform of a waveform.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • npoints (positive integer) – Number of points to use in the transform. If npoints is less than the size of the independent variable vector the waveform is truncated; if npoints is greater than the size of the independent variable vector, the waveform is zero-padded
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `npoints` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
  • RuntimeError (Non-uniform frequency spacing)
peng.wave_functions.ifftm(wave, npoints=None, indep_min=None, indep_max=None)

Return the magnitude of the inverse Fast Fourier Transform of a waveform.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • npoints (positive integer) – Number of points to use in the transform. If npoints is less than the size of the independent variable vector the waveform is truncated; if npoints is greater than the size of the independent variable vector, the waveform is zero-padded
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `npoints` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
  • RuntimeError (Non-uniform frequency spacing)
peng.wave_functions.ifftp(wave, npoints=None, indep_min=None, indep_max=None, unwrap=True, rad=True)

Return the phase of the inverse Fast Fourier Transform of a waveform.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • npoints (positive integer) – Number of points to use in the transform. If npoints is less than the size of the independent variable vector the waveform is truncated; if npoints is greater than the size of the independent variable vector, the waveform is zero-padded
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
  • unwrap (boolean) – Flag that indicates whether phase should change phase shifts to their 2*pi complement (True) or not (False)
  • rad (boolean) – Flag that indicates whether phase should be returned in radians (True) or degrees (False)
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `npoints` is not valid)
  • RuntimeError (Argument `rad` is not valid)
  • RuntimeError (Argument `unwrap` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
  • RuntimeError (Non-uniform frequency spacing)
peng.wave_functions.ifftr(wave, npoints=None, indep_min=None, indep_max=None)

Return the real part of the inverse Fast Fourier Transform of a waveform.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • npoints (positive integer) – Number of points to use in the transform. If npoints is less than the size of the independent variable vector the waveform is truncated; if npoints is greater than the size of the independent variable vector, the waveform is zero-padded
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `npoints` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
  • RuntimeError (Non-uniform frequency spacing)
peng.wave_functions.imag(wave)

Return the imaginary part of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.integral(wave, indep_min=None, indep_max=None)

Return the running integral of a waveform’s dependent variable vector.

The method used is the trapezoidal method

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
peng.wave_functions.log(wave)

Return the natural logarithm of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:
  • RuntimeError (Argument `wave` is not valid)
  • ValueError (Math domain error)
peng.wave_functions.log10(wave)

Return the base 10 logarithm of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:
  • RuntimeError (Argument `wave` is not valid)
  • ValueError (Math domain error)
peng.wave_functions.naverage(wave, indep_min=None, indep_max=None)

Return the numerical average of a waveform’s dependent variable vector.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
peng.wave_functions.nintegral(wave, indep_min=None, indep_max=None)

Return the numerical integral of a waveform’s dependent variable vector.

The method used is the trapezoidal method

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

float

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
peng.wave_functions.nmax(wave, indep_min=None, indep_max=None)

Return the maximum of a waveform’s dependent variable vector.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

float

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
peng.wave_functions.nmin(wave, indep_min=None, indep_max=None)

Return the minimum of a waveform’s dependent variable vector.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
Return type:

float

Raises:
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
peng.wave_functions.phase(wave, unwrap=True, rad=True)

Return the phase of a waveform’s dependent variable vector.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • unwrap (boolean) – Flag that indicates whether phase should change phase shifts to their 2*pi complement (True) or not (False)
  • rad (boolean) – Flag that indicates whether phase should be returned in radians (True) or degrees (False)
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `rad` is not valid)
  • RuntimeError (Argument `unwrap` is not valid)
  • RuntimeError (Argument `wave` is not valid)
peng.wave_functions.real(wave)

Return the real part of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.round(wave, decimals=0)

Round a waveform’s dependent variable vector to a given number of decimal places.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • decimals (integer) – Number of decimals to round to
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `decimals` is not valid)
  • RuntimeError (Argument `wave` is not valid)
peng.wave_functions.sin(wave)

Return the sine of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.sinh(wave)

Return the hyperbolic sine of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.sqrt(wave)

Return the square root of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.subwave(wave, dep_name=None, indep_min=None, indep_max=None, indep_step=None)

Return a waveform that is a sub-set of a waveform, potentially re-sampled.

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • dep_name – Independent variable name
  • indep_min (integer or float) – Independent vector start point of computation
  • indep_max (integer or float) – Independent vector stop point of computation
  • indep_step (integer or float) – Independent vector step
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `dep_name` is not valid)
  • RuntimeError (Argument `indep_max` is not valid)
  • RuntimeError (Argument `indep_min` is not valid)
  • RuntimeError (Argument `indep_step` is greater than independent vector range)
  • RuntimeError (Argument `indep_step` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • RuntimeError (Incongruent `indep_min` and `indep_max` arguments)
peng.wave_functions.tan(wave)

Return the tangent of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.tanh(wave)

Return the hyperbolic tangent of a waveform’s dependent variable vector.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.wcomplex(wave)

Convert a waveform’s dependent variable vector to complex.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:RuntimeError (Argument `wave` is not valid)
peng.wave_functions.wfloat(wave)

Convert a waveform’s dependent variable vector to float.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:
  • RuntimeError (Argument `wave` is not valid)
  • TypeError (Cannot convert complex to float)
peng.wave_functions.wint(wave)

Convert a waveform’s dependent variable vector to integer.

Parameters:wave (peng.eng.Waveform) – Waveform
Return type:peng.eng.Waveform
Raises:
  • RuntimeError (Argument `wave` is not valid)
  • TypeError (Cannot convert complex to integer)
peng.wave_functions.wvalue(wave, indep_var)

Return the dependent variable value at a given independent variable point.

If the independent variable point is not in the independent variable vector the dependent variable value is obtained by linear interpolation

Parameters:
  • wave (peng.eng.Waveform) – Waveform
  • indep_var (integer or float) – Independent variable point for which the dependent variable is to be obtained
Return type:

peng.eng.Waveform

Raises:
  • RuntimeError (Argument `indep_var` is not valid)
  • RuntimeError (Argument `wave` is not valid)
  • ValueError (Argument `indep_var` is not in the independent variable vector range)

Contracts pseudo-types

Introduction

The pseudo-types defined below can be used in contracts of the PyContracts or Pexdoc libraries. As an example, with the latter:

>>> from __future__ import print_function
>>> import pexdoc
>>> from peng.ptypes import engineering_notation_suffix
>>> @pexdoc.pcontracts.contract(suffix='engineering_notation_suffix')
... def myfunc(suffix):
...     print('Suffix received: '+str(suffix))
...
>>> myfunc('m')
Suffix received: m
>>> myfunc(35)
Traceback (most recent call last):
    ...
RuntimeError: Argument `suffix` is not valid

Alternatively each pseudo-type has a checker function associated with it that can be used to verify membership. For example:

>>> import peng.ptypes
>>> # None is returned if object belongs to pseudo-type
>>> peng.ptypes.engineering_notation_suffix('m')
>>> # ValueError is raised if object does not belong to pseudo-type
>>> peng.ptypes.engineering_notation_suffix(3.5) 
Traceback (most recent call last):
    ...
ValueError: [START CONTRACT MSG: engineering_notation_suffix]...

Description

EngineeringNotationNumber

Import as engineering_notation_number. String with a number represented in engineering notation. Optional leading whitespace can precede the mantissa; optional whitespace can also follow the engineering suffix. An optional sign (+ or -) can precede the mantissa after the leading whitespace. The suffix must be one of 'y', 'z', 'a', 'f', 'p', 'n', 'u', 'm', ' ' (space), 'k', 'M', 'G', 'T', 'P', 'E', 'Z' or 'Y'. The correspondence between suffix and floating point exponent is:

Exponent Name Suffix
1E-24 yocto y
1E-21 zepto z
1E-18 atto a
1E-15 femto f
1E-12 pico p
1E-9 nano n
1E-6 micro u
1E-3 milli m
1E+0    
1E+3 kilo k
1E+6 mega M
1E+9 giga G
1E+12 tera T
1E+15 peta P
1E+18 exa E
1E+21 zetta Z
1E+24 yotta Y

EngineeringNotationSuffix

Import as engineering_notation_suffix. A single character string, one of 'y', 'z', 'a', 'f', 'p', 'n', 'u', 'm', ' ' (space), 'k', 'M', 'G', 'T', 'P', 'E', 'Z' or 'Y'. EngineeringNotationNumber lists the correspondence between suffix and floating point exponent

IncreasingRealNumpyVector

Import as increasing_real_numpy_vector. Numpy vector in which all elements are real (integers and/or floats) and monotonically increasing (each element is strictly greater than the preceding one)

NumberNumpyVector

Import as number_numpy_vector. Numpy vector in which all elements are integers and/or floats and/or complex

RealNumpyVector

Import as real_numpy_vector. Numpy vector in which all elements are real (integers and/or floats)

TouchstoneData

Import as touchstone_data. A dictionary with the following structure:

  • points (integer) – Number of data points
  • freq (IncreasingRealNumpyVector) – Frequency vector
  • pars (NumberNumpyVector) – Parameter data, its size is equal to nports x nports x points where nports represents the number of ports in the file

The dictionary keys are case sensitive

TouchstoneNoiseData

Import as touchstone_noise_data. A dictionary with the following structure:

The dictionary keys are case sensitive

TouchstoneOptions

Import as touchstone_options. A dictionary with the following structure:

  • units (string) – Frequency units, one of 'GHz', 'MHz', 'KHz' or 'Hz' (case insensitive, default 'GHz')
  • ptype (string) – Parameter type, one of 'S', 'Y', 'Z', 'H' or 'G' (case insensitive, default 'S')
  • pformat (string) – Data point format type, one of 'DB' (decibels), 'MA' (magnitude and angle), or 'RI' (real and imaginary) (case insensitive, default 'MA')
  • z0 (float) – Reference resistance in Ohms, default 50 Ohms

The dictionary keys are case sensitive

WaveInterpOption

Import as wave_interp_option. String representing a waveform interpolation type, one of 'CONTINUOUS' or 'STAIRCASE' (case insensitive)

WaveScaleOption

Import as wave_scale_option. String representing a waveform scale type, one of 'LINEAR' or 'LOG' (case insensitive)

WaveVectors

Import as wave_vectors. Non-empty list of tuples in which each tuple is a waveform point. The first item of a point tuple is its independent variable and the second item of a point tuple is its dependent variable. The vector formed by the first item of the point tuples is of IncreasingRealNumpyVector pseudo-type; the vector formed by the second item of the point tuples is of RealNumpyVector pseudo-type

Checker functions

peng.ptypes.engineering_notation_number(obj)

Validate if an object is an EngineeringNotationNumber pseudo-type object.

Parameters:obj (any) – Object
Raises:RuntimeError (Argument `*[argument_name]*` is not valid). The token *[argument_name]* is replaced by the name of the argument the contract is attached to
Return type:None
peng.ptypes.engineering_notation_suffix(obj)

Validate if an object is an EngineeringNotationSuffix pseudo-type object.

Parameters:obj (any) – Object
Raises:RuntimeError (Argument `*[argument_name]*` is not valid). The token *[argument_name]* is replaced by the name of the argument the contract is attached to
Return type:None
peng.ptypes.increasing_real_numpy_vector(obj)

Validate if an object is IncreasingRealNumpyVector pseudo-type object.

Parameters:obj (any) – Object
Raises:RuntimeError (Argument `*[argument_name]*` is not valid). The token *[argument_name]* is replaced by the name of the argument the contract is attached to
Return type:None
peng.ptypes.number_numpy_vector(obj)

Validate if an object is a NumberNumpyVector pseudo-type object.

Parameters:obj (any) – Object
Raises:RuntimeError (Argument `*[argument_name]*` is not valid). The token *[argument_name]* is replaced by the name of the argument the contract is attached to
Return type:None
peng.ptypes.real_numpy_vector(obj)

Validate if an object is a RealNumpyVector pseudo-type object.

Parameters:obj (any) – Object
Raises:RuntimeError (Argument `*[argument_name]*` is not valid). The token *[argument_name]* is replaced by the name of the argument the contract is attached to
Return type:None
peng.ptypes.touchstone_data(obj)

Validate if an object is an TouchstoneData pseudo-type object.

Parameters:obj (any) – Object
Raises:RuntimeError (Argument `*[argument_name]*` is not valid). The token *[argument_name]* is replaced by the name of the argument the contract is attached to
Return type:None
peng.ptypes.touchstone_noise_data(obj)

Validate if an object is an TouchstoneNoiseData pseudo-type object.

Parameters:obj (any) – Object
Raises:RuntimeError (Argument `*[argument_name]*` is not valid). The token *[argument_name]* is replaced by the name of the argument the contract is attached to
Return type:None
peng.ptypes.touchstone_options(obj)

Validate if an object is an TouchstoneOptions pseudo-type object.

Parameters:obj (any) – Object
Raises:RuntimeError (Argument `*[argument_name]*` is not valid). The token *[argument_name]* is replaced by the name of the argument the contract is attached to
Return type:None
peng.ptypes.wave_interp_option(obj)

Validate if an object is a WaveInterpOption pseudo-type object.

Parameters:obj (any) – Object
Raises:RuntimeError (Argument `*[argument_name]*` is not valid). The token *[argument_name]* is replaced by the name of the argument the contract is attached to
Return type:None
peng.ptypes.wave_scale_option(obj)

Validate if an object is a WaveScaleOption pseudo-type object.

Parameters:obj (any) – Object
Raises:RuntimeError (Argument `*[argument_name]*` is not valid). The token *[argument_name]* is replaced by the name of the argument the contract is attached to
Return type:None
peng.ptypes.wave_vectors(obj)

Validate if an object is a WaveVectors pseudo-type object.

Parameters:obj (any) – Object
Raises:RuntimeError (Argument `*[argument_name]*` is not valid). The token *[argument_name]* is replaced by the name of the argument the contract is attached to
Return type:None