The PropertyResolver Class¶
Examples are just a click away
Boxes like this link to example code.
-
class
fixedpoint.properties.PropertyResolver¶ Resolves properties between two
FixedPoints.This is used internally by the
FixedPointclass 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
FixedPoints whosemismatch_alertproperties are to be resolved.- Returns
Resolved
mismatch_alertproperty.- Return type
- Raises
MismatchError – if
mismatch_alertproperties of all args do not match, and any args’mismatch_alertproperty setting is'error'.
When all args have equivalent
mismatch_alertproperties, that value is returned. Otherwise, the priority of resolution order is:'warning''error''ignore'
If there are mismatches in the
mismatch_alertproperties, then an alert is issued according to the highest priority mismatch_alert setting in args.
-
overflow(*args)¶ - Parameters
args (FixedPoint) – An variable number of
FixedPoints whoseoverflowproperties are to be resolved.- Returns
Resolved
overflowproperty.- Return type
- Raises
MismatchError – if
overflowormismatch_alertproperties of all args do not match, and any args’mismatch_alertproperty setting is'error'.
When all args have equivalent
overflowproperties, that value is returned. Otherwise, the priority of resolution order is:'clamp''wrap'
If there are mismatches in the
mismatch_alertproperties, then an alert is issued according to the highest priority mismatch_alert setting in args.
-
rounding(*args)¶ - Parameters
args (FixedPoint) – An variable number of
FixedPoints whoseroundingproperties are to be resolved.- Returns
Resolved
roundingproperty.- Return type
- Raises
MismatchError – if
roundingormismatch_alertproperties of all args do not match, and any args’mismatch_alertproperty setting is'error'.
When all args have equivalent
roundingproperties, 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_alertproperties, 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
FixedPoints whoseoverflow_alertproperties are to be resolved.- Returns
Resolved
overflow_alertproperty.- Return type
- Raises
MismatchError – if
mismatch_alertoroverflow_alertproperties of all args do not match.
When all args have equivalent
overflow_alertproperties, that value is returned. Otherwise, the priority of resolution order is:'error''warning''ignore'
If there are mismatches in the
overflow_alertproperties, 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
FixedPoints whoseimplicit_cast_alertproperties are to be resolved.- Returns
Resolved
implicit_cast_alertproperty.- Return type
- Raises
MismatchError – if
mismatch_alertorimplicit_cast_alertproperties of all args do not match.
When all args have equivalent
implicit_cast_alertproperties, that value is returned. Otherwise, the priority of resolution order is:'warning''error''ignore'
If there are mismatches in the
implicit_cast_alertproperties, 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
FixedPoints whosestr_baseproperties are to be resolved.- Returns
Resolved
str_baseproperty.- Return type
When all args have equivalent
str_baseproperties, thatstr_baseis returned. Otherwise the resolution is 16.Note
str_basemismatches do not raiseMismatchErrors.
-
all(*args)¶ - Parameters
args (FixedPoint) – An variable number of
FixedPoints whose property settings are to be resolved.- Returns
dictof resolved properties.- Return type
- Raises
MismatchError – if any properties are not equivalent for all args and any args’
mismatch_alertproperty setting is'error'.
Resolves all properties for each
FixedPointin args.Return value is a
dict, with the format'property name': 'property setting'. This can be used directly in theFixedPointconstructor 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:
-