Skip to content

Repeated calculations#6

Merged
htjb merged 9 commits intomasterfrom
repeated-calculations
Feb 27, 2026
Merged

Repeated calculations#6
htjb merged 9 commits intomasterfrom
repeated-calculations

Conversation

@htjb
Copy link
Owner

@htjb htjb commented Feb 27, 2026

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 refactor qp_class.fit() / DCF.smooth() to reuse precomputed Q, q, h, and derivative prefactors across sign iterations.
  • Replace setup.py + requirements.txt with a minimal pyproject.toml, and bump version to 1.2.4 across 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.

@htjb htjb merged commit 8564898 into master Feb 27, 2026
4 checks passed
@htjb htjb deleted the repeated-calculations branch February 27, 2026 16:14
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.

2 participants