Belle II Software development
RealVariable Class Reference
Inheritance diagram for RealVariable:
Variable

Public Member Functions

 format_value (self, value, check=True)
 

Public Attributes

 ident = ident
 Identifier used in VCD output stream.
 
 type = type
 VCD variable type; one of :const:VCDWriter.VAR_TYPES.
 
 size = size
 Size, in bits, of variable.
 

Static Private Attributes

tuple __slots__ = ()
 variables
 

Detailed Description

Real (IEEE-754 double-precision floating point) variable.

Values must be numeric and cannot be 'x' or 'z' states.

Definition at line 512 of file writer.py.

Member Function Documentation

◆ format_value()

format_value ( self,
value,
check = True )
Format real value change for VCD stream.

:param value: Numeric changed value.
:param type: float or int
:raises ValueError: for invalid real *value*.
:returns: string representing value change for use in a VCD stream.

Reimplemented from Variable.

Definition at line 522 of file writer.py.

522 def format_value(self, value, check=True):
523 """Format real value change for VCD stream.
524
525 :param value: Numeric changed value.
526 :param type: float or int
527 :raises ValueError: for invalid real *value*.
528 :returns: string representing value change for use in a VCD stream.
529
530 """
531 if not check or isinstance(value, Number):
532 return f'r{value:.16g} {self.ident}'
533 else:
534 raise ValueError(f'Invalid real value ({value})')
535
536

Member Data Documentation

◆ __slots__

tuple __slots__ = ()
staticprivate

variables

Definition at line 520 of file writer.py.

◆ ident

ident = ident
inherited

Identifier used in VCD output stream.

Definition at line 470 of file writer.py.

◆ size

size = size
inherited

Size, in bits, of variable.

Definition at line 474 of file writer.py.

◆ type

type = type
inherited

VCD variable type; one of :const:VCDWriter.VAR_TYPES.

Definition at line 472 of file writer.py.


The documentation for this class was generated from the following file: