Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
….bootstrap Co-authored-by: aaronspring <12237157+aaronspring@users.noreply.github.com>
Copilot
AI
changed the title
[WIP]
Add simultaneous member and init resampling to HindcastEnsemble.bootstrap
Oct 5, 2025
climpred.classes.HindcastEnsemble.bootstrap dim member and init simultaneously
Collaborator
|
@copilot try with xbootstrap |
Co-authored-by: aaronspring <12237157+aaronspring@users.noreply.github.com>
Author
Implemented xbootstrap integration for efficient multi-dimensional resampling! The system now:
Key benefits:
The same API call now automatically leverages xbootstrap: HindcastEnsemble.bootstrap(resample_dim=["member", "init"], ...)Commit: 629738d implements the xbootstrap integration as suggested. |
Copilot
AI
changed the title
Add simultaneous member and init resampling to HindcastEnsemble.bootstrap
Add simultaneous member and init resampling to HindcastEnsemble.bootstrap with xbootstrap integration
Oct 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the ability to resample both "member" and "init" dimensions simultaneously in
HindcastEnsemble.bootstrap(), addressing the feature request in the original issue. The implementation now integrates with thexbootstraplibrary for efficient nested block bootstrap resampling.Problem
Previously,
HindcastEnsemble.bootstrap()only supported resampling along a single dimension at a time:Users requested the ability to resample both dimensions simultaneously for more comprehensive bootstrap analysis.
Solution
The
resample_dimparameter now accepts both single strings and lists of strings, enabling simultaneous multi-dimensional resampling:Implementation Details
Enhanced Type Support: Updated method signatures to accept
Union[str, List[str]]forresample_dimparameterxbootstrap Integration: Added optional integration with the
xbootstraplibrary for efficient nested circular block bootstrap resamplingxb.block_bootstrap()for multi-dimensional resampling when availableSmart Routing Logic: Modified bootstrap logic to detect multi-dimensional resampling and automatically choose the most efficient method:
Backward Compatibility: All existing single-dimension calls continue to work unchanged with no API modifications required
Comprehensive Documentation: Updated docstrings with examples and clear descriptions of the new functionality, including xbootstrap integration notes
Files Changed
src/climpred/bootstrap.py: Added xbootstrap integration,_resample_multiple_dims_xbootstrap()function,resample_skill_xbootstrap()method, and updated existing functionssrc/climpred/classes.py: Updated method signatures, bootstrap logic with xbootstrap routing, and documentationsrc/climpred/tests/test_bootstrap.py: Added comprehensive tests for multi-dimensional resampling including xbootstrap-specific testsTesting
Added test coverage for:
Key Benefits
This enhancement provides users with more flexible and efficient bootstrap analysis capabilities while maintaining full backward compatibility with existing code.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.