The PropertyResolver Class¶
Examples are just a click away
Boxes like this link to example code.
-
class
fixedpoint.properties.
PropertyResolver
¶ Resolves properties between two
FixedPoint
s.This is used internally by the
FixedPoint
class for property resolution. You should not need to instantiate this class, but it is documented here to show how properties are resolved.-
mismatch_alert
(*args)¶ - Parameters
args (FixedPoint) – An variable number of
FixedPoint
s whosemismatch_alert
properties are to be resolved.- Returns
Resolved
mismatch_alert
property.- Return type
- Raises
MismatchError – if
mismatch_alert
properties of all args do not match, and any args’mismatch_alert
property setting is'error'
.
When all args have equivalent
mismatch_alert
properties, that value is returned. Otherwise, the priority of resolution order is:'warning'
'error'
'ignore'
If there are mismatches in the
mismatch_alert
properties, then an alert is issued according to the highest priority mismatch_alert setting in args.
-
overflow
(*args)¶ - Parameters
args (FixedPoint) – An variable number of
FixedPoint
s whoseoverflow
properties are to be resolved.- Returns
Resolved
overflow
property.- Return type
- Raises
MismatchError – if
overflow
ormismatch_alert
properties of all args do not match, and any args’mismatch_alert
property setting is'error'
.
When all args have equivalent
overflow
properties, that value is returned. Otherwise, the priority of resolution order is:'clamp'
'wrap'
If there are mismatches in the
mismatch_alert
properties, then an alert is issued according to the highest priority mismatch_alert setting in args.
-
rounding
(*args)¶ - Parameters
args (FixedPoint) – An variable number of
FixedPoint
s whoserounding
properties are to be resolved.- Returns
Resolved
rounding
property.- Return type
- Raises
MismatchError – if
rounding
ormismatch_alert
properties of all args do not match, and any args’mismatch_alert
property setting is'error'
.
When all args have equivalent
rounding
properties, that value is returned. Otherwise, the priority of resolution order is:'convergent'
(if any args are signed, otherwise'nearest'
)'nearest'
(if no args are signed, otherwise'convergent'
)'down'
'in'
'out'
'up'
If there are mismatches in the
mismatch_alert
properties, then an alert is issued according to the highest priority mismatch_alert setting in args.
-
overflow_alert
(*args)¶ - Parameters
args (FixedPoint) – An variable number of
FixedPoint
s whoseoverflow_alert
properties are to be resolved.- Returns
Resolved
overflow_alert
property.- Return type
- Raises
MismatchError – if
mismatch_alert
oroverflow_alert
properties of all args do not match.
When all args have equivalent
overflow_alert
properties, that value is returned. Otherwise, the priority of resolution order is:'error'
'warning'
'ignore'
If there are mismatches in the
overflow_alert
properties, then an alert is issued according to the highest priority mismatch_alert setting in args.
-
implicit_cast_alert
(*args)¶ - Parameters
args (FixedPoint) – An variable number of
FixedPoint
s whoseimplicit_cast_alert
properties are to be resolved.- Returns
Resolved
implicit_cast_alert
property.- Return type
- Raises
MismatchError – if
mismatch_alert
orimplicit_cast_alert
properties of all args do not match.
When all args have equivalent
implicit_cast_alert
properties, that value is returned. Otherwise, the priority of resolution order is:'warning'
'error'
'ignore'
If there are mismatches in the
implicit_cast_alert
properties, then an alert is issued according to the highest priority mismatch_alert setting in args.
-
str_base
(*args)¶ - Parameters
args (FixedPoint) – An variable number of
FixedPoint
s whosestr_base
properties are to be resolved.- Returns
Resolved
str_base
property.- Return type
When all args have equivalent
str_base
properties, thatstr_base
is returned. Otherwise the resolution is 16.Note
str_base
mismatches do not raiseMismatchError
s.
-
all
(*args)¶ - Parameters
args (FixedPoint) – An variable number of
FixedPoint
s whose property settings are to be resolved.- Returns
dict
of resolved properties.- Return type
- Raises
MismatchError – if any properties are not equivalent for all args and any args’
mismatch_alert
property setting is'error'
.
Resolves all properties for each
FixedPoint
in args.Return value is a
dict
, with the format'property name': 'property setting'
. This can be used directly in theFixedPoint
constructor as its property keyword arguments.A mismatch alert is issued for each property mismatch.
Property Resolution Order
The order in which properties are resolved (and thus the order in which alerts may be issued) is:
-