All notable changes to this project will be documented in this file.
The format is inspired by Keep a Changelog, adapted to fit fxpmath release history and compatibility tracking.
- Removed default import-time mutation of
NUMPY_EXPERIMENTAL_ARRAY_FUNCTIONand fixed its environment parsing bug. - Defined support policy for Python
3.9to3.14and NumPy1.26.4to<3in packaging metadata and dependency files. - Expanded CI and release-gate workflows with explicit NumPy
1.26.4and latest2.xmatrix lanes across valid Python versions. - Normalized
out=...handling across operator helpers so NumPy ellipsis is treated as an omitted output argument. - Kept strict
Fxp-onlyoutcontract for fxpmath-managed dispatch and explicit errors for invalidoutandout_liketypes. - Updated
_wrapped_numpy_funcoutput routing to make__array_ufunc__and__array_function__paths consistent foroutandout_likehandling. - Modernized NumPy protocol hooks:
Fxp.__array__now supports NumPy2.xdtypeandcopybehavior while preserving legacy positional compatibility. - Removed legacy
__array_prepare__hook and extendedFxp.__array_wrap__withreturn_scalarsupport for NumPy2.xcompatibility.
- Added isolated import regression coverage to verify
import fxpmathpreserves absent,0, and1states forNUMPY_EXPERIMENTAL_ARRAY_FUNCTION. - Added mixed-input NumPy divide regression coverage.
- Added focused feature tests for
out=..., scalar and 0-D output paths, strict output-type validation, and array protocol compatibility in NumPy-facing and function-level test files. - Added user-facing compatibility notes and NumPy migration guidance in
docs/compatibility_notes.md. - Started internal module reorganization for
0.5.0withfxpmath/operators/split intocore,arithmetic,reduction, andarray. - Extracted
Configfromfxpmath/objects.pyintofxpmath/config.py.
- Narrowed fallback conversion retries in
_wrapped_numpy_funcso unsupported kwargs raise cleanly instead of being retried through broad implicit coercion. - Converted
fxpmath/functions.pyinto a backward-compatible public facade re-exporting operator functions fromfxpmath.operators. - Converted monolithic
fxpmath/utils.pyinto a package-based layout underfxpmath/utils/withcommon,parse,repr,bitwise, andnumericmodules. - Preserved compatibility for
from fxpmath import utils,from fxpmath import Config, andfrom fxpmath.objects import Configduring the reorganization. - Kept NumPy dispatch registrations and public operation signatures stable during the refactor.
- Fixed unsigned subtraction underflow in raw arithmetic dispatch by forcing object-backed intermediates when both operands are unsigned, preventing pre-saturation wraparound on 32-bit paths and 64-bit boundary cases (issue
#73).
- Expanded issue
#73regression coverage with explicit cross-platform paths intests/test_issues.py: default behavior, emulatedn_word_max=32, and emulatedn_word_max=64boundary conditions.
- Documented supported Python and NumPy ranges plus finalized NumPy dispatch output behavior.
- Moved compatibility guidance out of the README into dedicated documentation.
- Validated targeted compatibility test groups on NumPy
1.26.4and latest2.x. - Added stable CI gate jobs for required NumPy compatibility and installation smoke checks, plus artifact uploads for lint/test traceability.
- Added a scheduled nightly workflow against NumPy pre-release wheels.
- Ran full-suite validation successfully on NumPy
1.26.4and latest2.xenvironments (143 passed).
- Added installation smoke tests in
tests/test_installation.pyto create an isolated virtual environment, install from source, and verify import path and version. - Added regression test coverage for complex
urawconversion parity (issue#102). - Added regression coverage for repeated
int()casting across Linux sizing paths (issue#98). - Added
Fxp.reshape_inplace(shape, order='C')as the explicit in-place reshape API.
- Modernized packaging to PEP
517and PEP621usingpyproject.tomlas canonical metadata source. - Added dynamic versioning from
fxpmath.__version__and setuptools package discovery viafind. - Cleaned up development-plan tracking by removing a duplicated issue
#86status entry. - Deprecated
Fxp.shape = ...assignment withDeprecationWarning; preferreshape()orreshape_inplace().
- Fixed complex
urawconversion by applying unsigned two's-complement independently to real and imaginary components (issue#102). - Fixed scalar integer casting after repeated in-place increments by using scalar-safe integer conversion in
astypeand object-castset_valpaths (issue#98). - Defined complex bitwise semantics for issue
#55: mixed complex and non-complex operands now warn once and apply the real operand to both components, while complex-complex applies operations part-wise. - Refactored bitwise internals to support array-vs-array operands with NumPy broadcasting semantics for
&,|,^, and~. - Aligned
Fxp.reshapewith NumPy by returning a reshaped copy instead of mutating the source object. - Improved reshape compatibility by using positional ndarray reshape arguments across NumPy versions.
- Kept issue
#55regression minimal intests/test_issues.pyand moved broader behavior coverage totests/test_complex_numbers.py. - Expanded bitwise operator coverage in
tests/test_operators.pyfor multidimensional arrays, broadcast paths, scalar masks, and>64-bit cases.
- Added
from_binmethod and function for creating or settingFxpvalues from binary strings (issue#49). - Added support for complex binary strings as input format.
- Added prefix selection for binary and hexadecimal representations.
- Forced
config.op_input_size = 'best'when power uses a constant non-Fxpoperand and added a warning (issue#89).
- Fixed wrap behavior beyond
n_word_max(issue#41). - Propagated the inaccuracy flag to new or resulting
Fxpobjects when any input is inaccurate (issue#48). - Fixed
cumsumfor sizes larger than32bits on Windows and64bits on Linux (issue#76). - Fixed
numpy.reshapehandling so the default sizing remainssameinstead ofoptimal(issue#77). - Fixed negative number parsing in dtype strings (issue
#80).
- Fixed value dtype handling for Windows and
uintvalues treated as32bits. - Updated
__getitem__so it returns anFxpwith raw value as a view, solving issue#62.
- Added tests for issues
#60and#62.
- Added
absmethod.
- Kept
valas the originalvdtypeinstead of forcingobjectwhen it is safe to do so. - Converted
vdtypetofloatwhen scaling transformation is applied.
- Fixed complex
truedivandfloordivmethods (issue#53). - Fixed complex binary, hexadecimal, and base representations for arrays (issue
#56). - Fixed dtype-based initialization when the dtype is complex (issue
#58).
- Updated tests for complex representations.
- Added
dtypeargument toresize. - Added
get_dtypemethod withnotationargument. - Added docstring updates for
get_dtype,resize,reshape,flatten,set_val,astype,get_val,raw,uraw, andequal. - Added
orderparameter support forreshapeandflatten.
- Fixed
FutureWarningin subdtype'str'comparison (issue#45).
- Fixed wrapping and scaling behavior (issue
#44).
- Added optional
configinit parameter toFxp. - Added
copyanddeepcopymethods toConfig. - Linked
functions.truedivwithnumpy.dividedispatch. - Added
axesparameter totranspose.
- Functions operating on one or two values now copy the first operand configuration by default.
- Fixed wrap overflow after operations (issue
#42). - Fixed
utils.wrapwhen data exceedsn_word_max(issue#41). - Fixed warning about internal complex checks (issue
#39).
- Added template support to
Config.
- Fixed config update behavior from an
Fxptemplate.
- Added NumPy precision testing at init.
- Defined
n_word_maxand config error handling independently. - Added support for NumPy arrays of strings.
- Fixed
astypecasting whendtypeandvdtypeareNone. - Fixed casting to
objectin extendedcumprod, extended precision multiply, and constructor paths. - Fixed integer representation behavior.
- Fixed issues
#26and#31.
- Added extended precision support beyond
64bits foradd,sub,mult,truediv,floordiv,mod, andpow. - Added support for
tupleandDecimalinput formats. - Added dtype-based initialization for
fxpandQformats. - Added template functionality for defining default formats for new
Fxpobjects. - Added
Configclass to manage low-level object behavior. - Added extended precision status flag (
extended_prec). - Added new
Fxpproperties:size,shape,ndim, andT. - Added new
Fxpmethods:reshape,flatten,raw, anduraw. - Added NumPy-array-style methods on
Fxp:all,any,argmax,argmin,argpartition,argsort,max,min,mean,std,var,sum,cumsum,cumprod,ravel,tolist,sort,conjugate,conj,transpose,item,clip,diagonal,trace,prod,dot, andnonzero. - Added support for
bool,int,float, andcomplexcasting. - Added dtype information to
Fxp.__repr__. - Added basic callbacks:
on_value_change,on_status_overflow,on_status_underflow, andon_status_inaccuracy. - Added NumPy function dispatch so
Fxpcan be used as both NumPy inputs and outputs.
- Migrated several core calculations and methods from
floattointto support extended precision. - Results of ALU operations with constants now keep the same size as the
Fxpobject by default. likeinitialization now supports overwriting size parameters.- Improved performance in several core paths.
- NumPy
>= 1.17.xwas recommended to enable function dispatch by default. - With older NumPy versions, users were advised to import
fxpmathbefore NumPy or setNUMPY_EXPERIMENTAL_ARRAY_FUNCTION=1before importing NumPy.
- Fixed wrapping behavior (issue
#20).
- Added padding support for hexadecimal representations.
- Fixed bug with
'b'in hexadecimal strings (issue#15). - Fixed spelling/wording of
inaccuracyin status (issue#16). - Fixed
__pow__behavior (issue#17). - Fixed bug where indexed complex assignment stored only the imaginary part (issue
#19).
- Added right-shift support for
shifting='expand'mode. - Added
sumfunction infunctions. - Added support for
Fxpwords and values larger than64bits.
- Improved performance in indexed assignment.
Fxpslicing now returns anFxpobject when values are arrays.Fxpnow accepts anotherFxpas input value.- Updated docstrings.
- Fixed
setup.pydependency handling so package dependencies install correctly.
- Fixed wrap error for ndarrays.
- Fixed wrap error for unsigned
Fxp.
- Fixed bitwise shifting of unsigned values.
- Fixed wrap error when the input is a float.
- Fixed support for N-dimensional array inputs (
N > 1).
- Fixed initialization and
best_size_calcbehavior for Win32 platforms.
- Added logical (bitwise) operators.
- Added binary shifting.
- Added value scaling (scale and offset).
- Added comparison support.
- Added inaccuracy status flag to indicate stored value differs from input.
- Added verbosity support to
info(). - Added
reset()to clear status flags. - Added raw-value support to
set_val(). - Added power operator support.
- Added inplace operator support.
- Fixed several bugs.
- Added binary, hexadecimal, and base representations.
- Added upper, lower, and precision properties.
- Added arithmetic operator support.
- Added support for string inputs including binary, hexadecimal, and fractional formats.
- Added
Fxpcopying. - Added initialization from another
Fxp. - Added indexing support.
- First public release.