Skip to content

Commit

Permalink
Merge pull request #951 from gchq/fix/map-reduce-padding-warning
Browse files Browse the repository at this point in the history
fix: stacklevel of MapReduce padding warning
  • Loading branch information
qh681248 authored Feb 7, 2025
2 parents cf1bb0a + 9684213 commit 94a1a2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Type annotations so that the example scripts pass Pyright. (https://github.com/gchq/coreax/pull/921)
- `KernelThinning` now computes swap probability correctly. (https://github.com/gchq/coreax/pull/932)
- Incorrectly-implemented tests for the gradients of `PeriodicKernel`. (https://github.com/gchq/coreax/pull/936)
- `MapReduce`'s warning about a solver not being padding-invariant is now raised at the
correct stack level. (https://github.com/gchq/coreax/pull/951)

### Changed

Expand Down
4 changes: 3 additions & 1 deletion coreax/solvers/composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ def __check_init__(self):
warnings.warn(
"'base_solver' is not a 'PaddingInvariantSolver'; Zero-weighted padding"
+ " applied in 'MapReduce' may lead to undefined results.",
stacklevel=2,
# __check_init__ is called inside base __init__, so stacklevel=3 should
# show this warning at the call site
stacklevel=3,
)

@override
Expand Down

0 comments on commit 94a1a2d

Please sign in to comment.