Skip to content

Conversation

@williamjameshandley
Copy link

Summary

Fixes failing tests in nested sampling and slice sampling modules following the main branch integration. Improves API documentation with proper type annotations.

Changes

Test Fixes

  • Applied PR Fix sampling in 1D #15 fix for 1D covariance matrix shape issue in nss.py
  • Fixed 12 failing tests across nested sampling and slice sampling
  • Added missing utility functions (combine_dead_info, sample_particles)
  • Resolved JAX shape consistency issues in while_loop operations
  • Ensured constraint_fn and logdensity_fn return consistent shapes
  • Fixed import issues and removed unused variables

Documentation

  • Added type annotations to function parameters (Callable[[ArrayTree], float], etc.)
  • Clarified shape requirements for constraint functions
  • Replaced ambiguous terminology with precise technical language
  • Added examples for proper constraint function usage

Technical Details

  • Log-density functions now return scalars using jnp.sum()
  • Fixed constraint array dtypes for JAX compatibility
  • Corrected function signatures in tests

All 111 tests now pass (62 nested sampling + 49 slice sampling).

Generated with Claude Code

Co-Authored-By: Claude [email protected]

yallup and others added 19 commits September 18, 2024 14:23
* TESTS

* TESTS

* UPDATE DOCSTRING

* ADD STREAMING VERSION

* ADD PRECONDITIONING TO MCLMC

* ADD PRECONDITIONING TO TUNING FOR MCLMC

* UPDATE GITIGNORE

* UPDATE GITIGNORE

* UPDATE TESTS

* UPDATE TESTS

* ADD DOCSTRING

* ADD TEST

* STREAMING AVERAGE

* ADD TEST

* REFACTOR RUN_INFERENCE_ALGORITHM

* UPDATE DOCSTRING

* Precommit

* CLEAN TESTS

* FIX BAD MERGE

* ADJUSTED MCLMC

* REMOVE BENCHMARKS:

* ADD ADJUSTED MCLMC

* GITIGNORE

* PRECOMMIT CLEAN UP

* FIX SPELLING, ADD OMELYAN, EXPORT COEFFICIENTS

* TEMPORARILY ADD BENCHMARKS

* ADD ADJUSTED MCLMC TUNING

* CLEAN

* UNIFY ADJUSTED MCLMC AND MCHMC

* ADD INITIAL_POSITION

* FIX TEST

* CLEAN UP

* REMOVE BENCHMARKS

* ADD TEST

* REMOVE BENCHMARKS

* MODIFY WINDOW ADAPTATION TO TAKE INTEGRATOR

* MODIFY WINDOW ADAPTATION TO TAKE INTEGRATOR

* BUG FIX

* CHANGE PRECISION

* CHANGE PRECISION

* ADD OMELYAN TEST

* ADD ADJUSTED MCLMC TEST

* ADD ADJUSTED MCLMC TEST

* RENAME O

* UPDATE STREAMING AVG

* UPDATE STREAMING AVG

* FIX MERGE

* UPDATE PR

* RENAME STD_MAT

* RENAME STD_MAT

* RENAME STD_MAT

* MERGE MAIN

* REMOVE COEFFICIENT EXPORTS

* REMOVE COEFFICIENT EXPORTS

* RESOLVE MYPY ISSUE

* RESOLVE MYPY ISSUE

* RETURN EXPECTATION HISTORY

* FIX KWARG BUG

* FIX KWARG BUG

* FIX KWARG BUG IN ADJUSTED MCLMC

* MAKE WINDOW ADAPTATION TAKE INTEGRATOR AS ARGUMENT

* L_proposal_factor

* SPLIT TUNING FOR AMCLMC INTO SEPARATE FILE

* SPLIT TUNING FOR AMCLMC INTO SEPARATE FILE

* RENAME STREAMING_AVERAGE_UPDATE ARGS IN ADJUSTED MCLMC ADAPTATION

* diagnostics

* fix bugs

* FIX MINOR TUNING BUGS

* UPDATE TUNING

* UPDATE TUNING

* UPDATE TUNING

* names

* test

* tuning

* update

* ready for test

* ready for test

* ready for test

* Update blackjax/adaptation/adjusted_mclmc_adaptation.py

Co-authored-by: Junpeng Lao <[email protected]>

* edit

---------

Co-authored-by: Junpeng Lao <[email protected]>
* extracting taking last

* test passing

* layering

* example

* more

* Adding another example

* tests in place

* rolling back changes

* Adding test for num_mcmc_steps

* format

* better test coverage

* linter

* Flake8

* black

* implementation[

* partial posteriors implementation

* rolling back some changes

* linter

* fixing test

* adding reference

* typo

* exposing in top level api

* reruning precommit

* up to now

* one step working

* fixes

* tests passing

* checkpoint tests passing

* more

* tests passing, implementation in place

* tests passing

* rounding

* adding to init

* rollbacks

* rollback

* rollback

* docs

* precommit

* removing extra parameter

* code review updates
* Remove meeting scheduling

* Fix tests
* test CI

* test CI

* test CI: add static

* test CI: add static

* test CI: add static tests

* Revert "test CI: add static"

This reverts commit 2db919d.

* Revert "test CI: add static"

This reverts commit fa6558f.

* test CI: add static tests

* test CI: add static tests

* test CI: add static tests

* test CI: old tests

* test CI: old tests

* test CI: old tests with addition

* test CI: old tests with addition of num tuning steps
* total_num_tuning_integrator_steps

* Initial params for MCLMC adaptation
* impl

* rename

* docs

---------

Co-authored-by: Junpeng Lao <[email protected]>
* energy error monitoring

* energy error monitoring

* jnp abs
* ping Jaxopt version to unbreak test

* lower jaxopt version
- Add comprehensive test suite for nested sampling functionality
- Add unit tests for slice sampling implementation
- Tests cover core algorithms and edge cases

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…and nested sampling with main branch features
- Merge PR #15 fix for 1D covariance matrix shape issue in nss.py
- Fix missing imports and utility functions in test files
- Ensure constraint_fn and logdensity_fn return consistent shapes:
  * logdensity functions now return scalars using jnp.sum()
  * constraint functions return properly typed arrays
  * Fix empty constraint array dtypes for JAX while_loop compatibility
- Improve docstrings with proper type annotations:
  * Replace vague "positions" terminology with "parameter sample"
  * Add clear Callable type signatures for all function parameters
  * Document shape and dtype requirements explicitly
- Implement missing utility functions: combine_dead_info, sample_particles
- All 111 tests now passing (62 nested sampling + 49 slice sampling)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@williamjameshandley williamjameshandley force-pushed the test-coverage-improvements branch from 432e1d0 to 7907f86 Compare June 14, 2025 17:27
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.

8 participants