Skip to content

Release 0.4.10#104

Merged
francof2a merged 28 commits intomasterfrom
release-0.4.10
Mar 24, 2026
Merged

Release 0.4.10#104
francof2a merged 28 commits intomasterfrom
release-0.4.10

Conversation

@francof2a
Copy link
Copy Markdown
Owner

Release 0.4.10

Base: master
Compare: release-0.4.10

Overview

This PR promotes the current develop release candidate into master for the 0.4.10 release.

It includes the finalized package version (0.4.10), changelog alignment, and CI/workflow hardening completed during this cycle.

Release Intent

This release focuses on:

  • Stability and correctness fixes
  • Packaging modernization
  • Reshape/bitwise behavior improvements
  • Complex-number handling fixes
  • Stronger regression and installation validation

Primary Changes

1. Versioning and release metadata

  • Set package runtime version to 0.4.10 in fxpmath/__init__.py.
  • Keep changelog history aligned with release entries (0.4.10, 0.4.9).

2. Packaging and installation modernization

  • Modernized packaging metadata to PEP 517/PEP 621 conventions via pyproject.toml.
  • Dynamic versioning from fxpmath.__version__.
  • Added installation smoke coverage for source install/import/version validation.

3. Core fixes and behavior updates (0.4.10 scope)

  • Fixed complex uraw conversion for independent unsigned two’s-complement handling of real/imag parts.
  • Improved scalar integer casting stability after repeated in-place increments.
  • Aligned reshape semantics with NumPy behavior.
  • Added explicit in-place reshape API (reshape_inplace).
  • Added deprecation path for Fxp.shape = ....
  • Improved reshape compatibility across NumPy versions.
  • Clarified and implemented complex bitwise semantics for mixed/complex operands.
  • Refactored bitwise internals for broadcasted array operations.

4. Test and regression expansion

5. CI/workflow improvements

  • Consolidated legacy duplicate workflows.
  • Added explicit multi-OS test coverage.
  • Expanded Python matrix to: 3.9, 3.10, 3.11, 3.12, 3.13, 3.14.
  • Updated action versions to remove Node 20 warnings:
    • actions/checkout@v5
    • actions/setup-python@v6

Why this release matters

  • Improves correctness in complex and edge-case fixed-point operations.
  • Reduces packaging friction with modern build standards.
  • Raises confidence with broader CI and regression coverage.
  • Clarifies API behavior and compatibility expectations.

Compatibility notes

  • Release version is 0.4.10 (non-dev).
  • Fxp.shape = ... is deprecated; use reshape() or reshape_inplace().

Validation performed

  • CI executed across Linux/macOS/Windows with expanded Python matrix.
  • Lint + tests passed under required gates.
  • Regression additions/updates included for issue-specific coverage.

Risk assessment

  • Overall risk: Low to moderate.
  • Primary risk area: behavior-sensitive numeric paths (reshape, bitwise, complex conversions).
  • Mitigation: expanded targeted regression coverage + CI matrix breadth.

Out of scope

  • gh-pages branch/site design changes are not part of this release PR unless explicitly cherry-picked.

Post-merge release steps

  1. Merge this PR into master.
  2. Pull latest master locally.
  3. Create and push tag:
    • git tag v0.4.10
    • git push origin v0.4.10
  4. Publish GitHub Release notes from changelog.txt (0.4.10 section).
  5. Optionally bump develop to the next -dev version.

Checklist

  • Base branch is master
  • Compare branch is release-0.4.10
  • Package version set to 0.4.10
  • Changelog release content present
  • CI checks green
  • Ready for tag v0.4.10 after merge

falcaraz and others added 28 commits March 10, 2026 23:20
…local plan

- create development-plan.md with phased future work (Now/Next/Later)
- add /development-plan.md to .gitignore for local-only planning
- add .devcontainer configuration for reproducible local development
  (Dockerfile, docker-compose.yml, and devcontainer.json)
…mpatibility

- normalize shape/newshape in fxpmath.functions.reshape
- switch internal np.reshape calls to positional shape for 1.26/2.x compatibility
- add regression test for shape, newshape, and conflicting kwargs
- document reshape usage in README and quick start
- verified in both envs: NumPy 2.4.3 and 1.26.4
- add `fxpmath/helpers.py` with shared overflow/casting helpers for raw math paths
- move casting decision logic out of `functions.py` and reuse it across kernels
- fix extended-precision overflow paths in `_truediv_raw` and `_pow_raw`
- apply safe object-casting guards to related raw operations and dispatch functions
- add regression tests for operator overflow cases in `tests/test_operators.py`
- add boundary-precision regression coverage for function dispatch in `tests/test_functions.py`
- update `development-plan.md` checklist for completed P0 overflow tasks
- record latest NumPy 2.x full test result (`96 passed` on NumPy `2.4.3`)
replace generic placeholder docstrings with behavior-accurate docs
document parameters/returns for callable APIs and side effects for mutators
improve NumPy-mapped function docs with fxpmath sizing/output semantics
expand and refine Config class/property docstrings using project config behavior
rewrite test docstrings to describe validated behavior (not just test names)
run validation in venv (.venv/bin/python -m pytest -q, all tests passing)
Optional body:
- add `.github/workflows/manual-windows-tests.yml`
- enable `workflow_dispatch` with Python version input
- run full test suite (`pytest -q`) on `windows-latest` without requiring a PR
Complex multiplication needs one extra output bit because each component is a sum/difference of two products. Without this guard bit, values like (-1-1j)*(-1-1j) overflow and saturate to 1j instead of 2j.

- restore `is_complex` guard-bit logic in `functions.mul` output sizing
- add regression test `test_issue_91_v0_4_9` in `tests/test_issues.py`

Fixes #91
…rsions`

- clarify that `trunc` is numeric round-toward-zero (`numpy.trunc`/`numpy.fix`)
- explicitly distinguish it from arithmetic right-shift/floor for negative values
- add concrete negative example (`-2046.3867 -> trunc -2046`, `floor -2047`)
- apply the same wording in `README.md` and `docs/quick_start.md`
Apply the keep-mode left shift algorithm proposed in PR #92 discussion and add regression coverage for signed keep-left behavior and N-D arrays.

Co-authored-by: Jonah Foley <jonah.foley@nu-quantum.com>
…s package discovery

- add pyproject.toml with explicit build-system (setuptools, wheel)
- move project metadata/dependencies from setup.py to [project] (PEP 621)
- enable dynamic version from fxpmath.__version__
- switch package config to setuptools find discovery (include = ["fxpmath*"])
- simplify setup.py to compatibility shim (setup())
- remove obsolete setup.cfg

This resolves legacy setup.py install deprecation paths and modernizes source builds to PEP 517.
Fix issue #102 (reported on v0.4.9) where complex values in uraw() were
converted using a single complex comparison and produced incorrect unsigned
raw output. Convert real/imag parts independently with two's-complement logic.
Add regression coverage for test_issue_102_v0_4_9 and document the fix.
…ression

Replace flatten-based int casting with utils.int_array in Fxp.astype() and
object-cast set_val() branches, preserving existing array behavior while
fixing scalar conversion crashes after repeated += growth (issue #98).

Add strict regression coverage for issue #98 across both Linux-relevant sizing
paths (n_word=32 and n_word=64), asserting int(Fxp) remains stable.

Update changelog with #98 fix and regression entries.
Update development plan status to mark #98 as solved and remove it from open
P0 backlog.
…trix, and full tests

Implement issue #86 by adding new rounding modes that preserve existing rounding
execution paths while extending tie-breaking behavior and naming compatibility.

What’s included:
- Add new rounding modes:
  - `nearest_posinf` (ties toward +inf, SystemC `SC_RND`)
  - `nearest_neginf` (ties toward -inf, SystemC `SC_RND_MIN_INF`)
  - `nearest_zero` (ties toward zero, SystemC `SC_RND_ZERO`)
  - `nearest_away` (ties away from zero, SystemC `SC_RND_INF`)
  - `bit_trunc` (SystemC `SC_TRN` style truncation)
- Keep legacy passthrough behavior for integer/object raw-domain paths in `_round`
  and add a warning when object dtype reaches rounding with `n_word < n_word_max`.
- Extend rounding config with canonical modes + aliases from:
  - IEEE 754 names (`roundTiesToEven`, `roundTowardZero`, etc.)
  - IEEE 1666/SystemC names (`SC_RND*`, `SC_TRN*`)
  - canonical/descriptive alias names.
- Update docs in README and quick start:
  - add new mode descriptions
  - add cross-reference table (fxpmath nominal name, aliases, NumPy/IEEE/SystemC/canonical mapping, support status).
- Expand tests:
  - extend `test_rounding` in `tests/test_basic.py` for the new modes
  - add comprehensive `tests/test_rounding.py` coverage for:
    - aliases -> canonical mapping
    - issue #86 reproducer (`nearest_posinf`)
    - scalar/1D/2D array/complex behavior
    - >64-bit/object dtype behavior and passthrough
    - warning behavior on unexpected object dtype rounding path.
- Update changelog for `0.5.0-dev0`.

Files touched:
- `fxpmath/objects.py`
- `tests/test_basic.py`
- `tests/test_rounding.py`
- `README.md`
- `docs/quick_start.md`
- `changelog.txt`
… bitwise coverage`

Body:
- keep `test_issue_55_v0_4_5` minimal and focused on the core regression
- move broader complex bitwise scenarios into a dedicated test in `tests/test_complex_numbers.py`
- expand `tests/test_operators.py::test_arrays` with multidimensional bitwise checks (`&`, `|`, `^`, `~`)
- validate behavior across scalar, array, mixed, and complex operands without changing implementation logic
…calar/array coverage`

Body:
- refactor bitwise helpers in `fxpmath/utils.py` to use broadcast-aware paths for `binary_and`, `binary_or`, `binary_xor`, and `binary_invert`
- remove scalar-recursive bitwise dependency and preserve scalar behavior
- add multidimensional array-vs-array and broadcasted bitwise assertions in `tests/test_operators.py`
- extend complex bitwise coverage with array-vs-array checks in `tests/test_complex_numbers.py`
- add dedicated `n_word > 64` regression (`n_word=80`) for all bitwise ops across scalar and array cases
- full test suite passes (`111 passed`)
- make Fxp.reshape return a reshaped copy (non-mutating)
- add Fxp.reshape_inplace(shape, order='C') for explicit in-place reshape
- deprecate Fxp.shape assignment with DeprecationWarning and migration guidance
- use positional ndarray reshape args for cross-version NumPy compatibility
…/master

1. Replace legacy duplicate workflows with unified `ci.yml` and `master-release-gate.yml`
2. Run strict lint/test matrix on PRs to `develop`/`master` and pushes to `develop`
3. Add multi-OS coverage: Ubuntu 22.04/24.04, macOS 14, Windows
4. Keep master push as release gate with test-before-build behavior
5. Remove `continue-on-error` behavior from old workflows
Copy link
Copy Markdown
Owner Author

@francof2a francof2a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is in good shape for release cut.
I reviewed the release branch intent (release-0.4.10 -> master) and verified that the previous merge conflict was resolved cleanly by preserving the modern packaging direction (pyproject.toml) and keeping legacy setup.cfg removed.

@francof2a francof2a self-assigned this Mar 24, 2026
@francof2a francof2a merged commit 90b7766 into master Mar 24, 2026
24 checks passed
@francof2a francof2a deleted the release-0.4.10 branch March 24, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant