Skip to content

Add configurable convergence criterion ordering and per-criterion ena…#102

Merged
jc-macdonald merged 1 commit into
mainfrom
feature/configurable-convergence-criteria
Apr 20, 2026
Merged

Add configurable convergence criterion ordering and per-criterion ena…#102
jc-macdonald merged 1 commit into
mainfrom
feature/configurable-convergence-criteria

Conversation

@jc-macdonald
Copy link
Copy Markdown
Collaborator

This pull request introduces significant improvements to the convergence criteria system in the VBPCA implementation. It adds support for customizable priority ordering of convergence criteria and per-criterion enable/disable controls, making model convergence more flexible and user-configurable. These features are fully documented, validated, and tested throughout the codebase.

Enhancements to convergence criteria configuration:

  • Added criterion_order option to allow users to specify the priority order in which convergence criteria are evaluated, instead of using a fixed order. (src/vbpca_py/_converge.py, src/vbpca_py/estimators.py, src/vbpca_py/_pca_full.py, [1] [2] [3] [4]
  • Added convergence_criteria option to enable or disable individual convergence criteria without affecting their diagnostic evaluation. (src/vbpca_py/_converge.py, src/vbpca_py/estimators.py, src/vbpca_py/_pca_full.py, [1] [2] [3] [4]

Validation and error handling:

  • Implemented validation in _build_options to check for unknown or incorrectly typed criterion names in both criterion_order and convergence_criteria, raising informative errors for invalid input. (src/vbpca_py/_pca_full.py, [1] [2]

Estimator API and forwarding:

  • Updated the VBPCA estimator to accept and forward criterion_order and convergence_criteria through its API, ensuring these options are correctly passed to the underlying implementation. (src/vbpca_py/estimators.py, [1] [2] [3] [4] [5]

Documentation and usage examples:

  • Expanded documentation with detailed explanations and practical examples for customizing convergence behavior using the new options. (docs/concepts/convergence.md, docs/howto/convergence.md, [1] [2]

Testing:

  • Added comprehensive tests to verify correct behavior of criterion ordering, per-criterion enable/disable, option forwarding, and validation of invalid input. (tests/test_converge.py, tests/test_estimators.py, [1] [2]

Closes #101

…ble/disable

- Add DEFAULT_CRITERION_ORDER constant and _VALID_CRITERION_NAMES to _converge.py
- Refactor convergence_check() to use a dict-based registry with configurable
  ordering (criterion_order) and per-criterion enable/disable (convergence_criteria)
- Add criterion_order and convergence_criteria defaults to _build_options()
- Extract _validate_convergence_opts() helper for input validation
- Surface criterion_order and convergence_criteria as named kwargs on VBPCA.__init__
- Forward both options through VBPCA.fit() and VBPCA.get_options()
- Add tests for reordering, disabling, combined usage, and validation errors
- Update convergence concept and howto documentation with new options

Fixes #101
@jc-macdonald jc-macdonald merged commit 04c5a9b into main Apr 20, 2026
7 checks passed
@jc-macdonald jc-macdonald deleted the feature/configurable-convergence-criteria branch April 20, 2026 14:15
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.

Configurable convergence criterion ordering and per-criterion enable/disable

1 participant