Repository navigation
refactor: share the hrp/schur_hrp pipeline and narrow hrp.__all__ (#815) - #818
Merged
Merged
Conversation
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 45 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Fixes #815.
Acceptance criterion (verbatim):
What changed
src/pyhrp/hrp.py_prepare(prices, node, method, bisection) -> (cov, node). It computes returns and the finite covariance matrix, and only builds the correlation matrix and tree whennode is None(this replacesnode or …).hrpandschur_hrpnow each make one_preparecall plus one allocator call.__all__narrowed to["hrp", "schur_hrp"].Dendrogram,build_tree,compute_corrandcompute_covstay importable frompyhrp.hrpthrough explicitX as Xre-exports.docs/api.md, the marimo notebooks,book/scripts/demo.pyand the doctests inalgos.py/plot.pyall import from that path.Literalwas repeated in both signatures; it is now a singleMethodalias.src/pyhrp/__init__.py: importscompute_*fromcovariance,Dendrogram/build_treefromdendrogram, andhrp/schur_hrpfromhrp.Gates
make fmt: pass (ruff, mypy, interrogate, bandit, …)make typecheck:tyandmypy --strictboth passmake test: 132 passed, 1 skipped; coverage 100% (lines and branches; both branches ofif node is Noneare covered by the existing tests)make rhiza-test: 29 passed, 6 skipped (dynamic version); the docstring examples passNot addressed
check_finite_matrixis no longer re-exported frompyhrp.hrp's__all__. It is still importable from there becausehrp.pyuses it, and its owner ispyhrp.covariance. Nothing in the repo imported it throughpyhrp.hrp.compute_corris skipped when a node is passed; the criterion is met in code (see_prepare).hrp/schur_hrp), so I held Add doctest examples to hrp() and schur_hrp() #816 back until this merges.Closes #815
🤖 Generated with Claude Code