Skip to main content

Taking the pain out of choosing a Python global optimizer

Project description

Humpday: Pure Python or Javascript Derivative-Free Optimization

CI License: MIT Python 3.9+

Documentation & Live Demos

22 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

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 →)

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.

SKILL.md.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

humpday-0.20.0.tar.gz (12.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

humpday-0.20.0-py3-none-any.whl (125.4 kB view details)

Uploaded Python 3

File details

Details for the file humpday-0.20.0.tar.gz.

File metadata

  • Download URL: humpday-0.20.0.tar.gz
  • Upload date:
  • Size: 12.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for humpday-0.20.0.tar.gz
Algorithm Hash digest
SHA256 7f8fed43ed6f0723f2a86a88a4b2f3ecf0176b62fa6737f19a716febb4d3acd0
MD5 762de1c21312467b598cba9773666674
BLAKE2b-256 8aad3382526f4e9982f5fefa05e773e474c444d79c1e74867265d85878ad2821

See more details on using hashes here.

Provenance

The following attestation bundles were made for humpday-0.20.0.tar.gz:

Publisher: publish.yml on microprediction/humpday

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file humpday-0.20.0-py3-none-any.whl.

File metadata

  • Download URL: humpday-0.20.0-py3-none-any.whl
  • Upload date:
  • Size: 125.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for humpday-0.20.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b451ec61a8b3b6492b94393b781aac48636841dc44610535c27fea57a13a9b71
MD5 bf78fa6644b032f035500eb65d961c1a
BLAKE2b-256 5d761af57f8d884252cb8d333c5f885b112f6f5950982ea0c928c9a5ae6c5581

See more details on using hashes here.

Provenance

The following attestation bundles were made for humpday-0.20.0-py3-none-any.whl:

Publisher: publish.yml on microprediction/humpday

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page