Humpday: Pure Python or Javascript Derivative-Free Optimization
23 derivative-free optimization algorithms in pure Python. No compilation, no required dependencies.
See it work
Differential Evolution clears a 9-ball rack on a single break — one of 13+ interactive applications that pit every HumpDay optimizer against a real physics or engineering problem. (Watch the 14-second video · Browse all applications →)
Optimizing on the simplex
Mixtures, portfolios, and allocations live on the probability simplex (weights
that sum to 1), not the cube. HumpDay optimizes them by lifting a plain [0,1]ⁿ
objective through a smooth bijection φθ onto the simplex — so every box-domain
optimizer works unchanged.
The map's scale is a tunable preconditioner: too small
and the whole cube collapses onto the centroid; tuned (the θ★ shown), off-centre
optima map back to interior cube points where optimizers sample densely.
Explore it live →
(drag to orbit, morph cube ⇆ simplex, watch the optimum's pre-image move).
For fun, the same map applied to a football pitch — straight lines bend, the centre circle becomes an oval, the corners smear toward the boundary: ⚽ the beautiful game on the simplex →.
Install & Use
pip install humpday
Zero runtime dependencies. Every algorithm has a pure-Python implementation that works wherever Python runs.
If you want the numpy-accelerated backend for higher dimensions:
pip install humpday[fast]
The same algorithm code runs either way; humpday transparently uses numpy when it's available and falls back to pure Python when it isn't.
from humpday import minimize
def objective(x):
return (x[0] - 2)**2 + (x[1] - 3)**2
result = minimize(objective, bounds=[(-5, 5), (-5, 5)], method='DifferentialEvolution')
print(f"Solution: {result.x}") # [2.0, 3.0]
Algorithms
22 validated optimizers: See them in action | Source code
Trust region methods, evolutionary algorithms, metaheuristics.
Save the Planet
Cut and paste to avoid waste.
Read https://raw.githubusercontent.com/microprediction/humpday/main/SKILL.md
and create a project skill from it.
Comparison
Marginal install footprint on top of a Python environment that already has numpy:
| Library | Adds on top of numpy | Global optimizers |
|---|---|---|
| Humpday | ~1 MB (or zero without [fast]) |
22 |
| SciPy | ~100 MB | 6 documented |
| Optuna | ~30 MB | 11 samplers |
| Nevergrad | ~230 MB | 540+ registered (tuned variants of ~30 base methods) |
Humpday's niche: when you need optimization that works anywhere Python runs, without dependencies or compilation.
License
MIT - Use freely in commercial and research projects.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file humpday-0.22.0.tar.gz.
File metadata
- Download URL: humpday-0.22.0.tar.gz
- Upload date:
- Size: 5.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e5b052b6802ba3408ac68a1212868f1a78aed45f569b747b6cfa79995c1801d
|
|
| MD5 |
93187b20697e8822b7b50c3eeca1f671
|
|
| BLAKE2b-256 |
093b2e36da47f45275382a461ad03917ba5400d4888de16b282a62725ace225c
|
Provenance
The following attestation bundles were made for humpday-0.22.0.tar.gz:
Publisher:
publish.yml on microprediction/humpday
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
humpday-0.22.0.tar.gz -
Subject digest:
9e5b052b6802ba3408ac68a1212868f1a78aed45f569b747b6cfa79995c1801d - Sigstore transparency entry: 2213266403
- Sigstore integration time:
-
Permalink:
microprediction/humpday@b87b754a407a5748d8d5616299ced5270a279a9b -
Branch / Tag:
refs/tags/v0.22.0 - Owner: https://github.com/microprediction
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b87b754a407a5748d8d5616299ced5270a279a9b -
Trigger Event:
release
-
Statement type:
File details
Details for the file humpday-0.22.0-py3-none-any.whl.
File metadata
- Download URL: humpday-0.22.0-py3-none-any.whl
- Upload date:
- Size: 138.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a294ad7fc0d08703040bdb2624d544905580783186f8555dde0c6dc3f50553d0
|
|
| MD5 |
4a8145ed93e6dc5dab95ed8219dd025d
|
|
| BLAKE2b-256 |
8d89e46218e3a9a9ae8dae358e8f6d11bce253d9264c92ef524c91f60630a637
|
Provenance
The following attestation bundles were made for humpday-0.22.0-py3-none-any.whl:
Publisher:
publish.yml on microprediction/humpday
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
humpday-0.22.0-py3-none-any.whl -
Subject digest:
a294ad7fc0d08703040bdb2624d544905580783186f8555dde0c6dc3f50553d0 - Sigstore transparency entry: 2213266442
- Sigstore integration time:
-
Permalink:
microprediction/humpday@b87b754a407a5748d8d5616299ced5270a279a9b -
Branch / Tag:
refs/tags/v0.22.0 - Owner: https://github.com/microprediction
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b87b754a407a5748d8d5616299ced5270a279a9b -
Trigger Event:
release
-
Statement type: