Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reduces repeated computation in the QP fitting loop by precomputing sign-independent matrices/derivative prefactors once, and modernizes packaging by moving to pyproject.toml with a CI version-increment check.
Changes:
- Add
precompute_matrices()and refactorqp_class.fit()/DCF.smooth()to reuse precomputedQ,q,h, and derivative prefactors across sign iterations. - Replace
setup.py+requirements.txtwith a minimalpyproject.toml, and bump version to1.2.4across metadata. - Add a GitHub Actions workflow + script to enforce version increments on PRs; remove basin-hopping comparison assets.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
maxsmooth/qp.py |
Introduces precomputation helpers and uses them inside qp_class.fit() to avoid redundant work. |
maxsmooth/DCF.py |
Precomputes QP matrices once per run and passes them into repeated qp_class calls. |
pyproject.toml |
New packaging metadata/dependencies (replacing setup.py / requirements.txt). |
setup.py |
Removed legacy setuptools configuration. |
requirements.txt |
Removed legacy dependency list. |
maxsmooth/_version.py |
Version bump to 1.2.4. |
README.rst |
Updates documented version string to 1.2.4. |
bin/check_version.py |
Adds a script to validate version increments versus master. |
.github/workflows/version.yml |
Adds CI workflow to run version increment checks on PRs to master. |
Basin-hopping_Nelder-Mead/* |
Removes timing/comparison scripts and data files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Previously the derivatives, Q, q, and h were calcualted everytime qp_call.fit() but these quantities only need to be calcualted once as they just depend on the functional form of the maximally smooth function and the data.
This adds functions to precompute these quantities outside of qp_class.fit() which will reduce the run time of both the sign flipping and brute force algorithms.
Also replaced requirements.txt and setup.py with a very minimal pyproject.toml and added a version checking workflow.