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.21.0.tar.gz (12.8 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.21.0-py3-none-any.whl (127.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for humpday-0.21.0.tar.gz
Algorithm Hash digest
SHA256 6da41a8caa5ce93129b41159c17634617bbddc18c7c9b00a74e8ba9dbd12c069
MD5 5edd346f2cf68f013d7a269eaaaee2ff
BLAKE2b-256 2b3da8cca4ccfadaa8dcb73a89d57729e34fec611e44bdf43d9bd687623ea6af

See more details on using hashes here.

Provenance

The following attestation bundles were made for humpday-0.21.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.21.0-py3-none-any.whl.

File metadata

  • Download URL: humpday-0.21.0-py3-none-any.whl
  • Upload date:
  • Size: 127.1 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.21.0-py3-none-any.whl
Algorithm Hash digest
SHA256 996cfdc080eedfa4bbdaf1e772489f9be465eddd382c0664c4df93aebff6a8b2
MD5 23e05d8697a9bde0490f7e25fb36c675
BLAKE2b-256 3f218b4f358327f3d04779ad000a885513f390f36e570678182c514b5429b460

See more details on using hashes here.

Provenance

The following attestation bundles were made for humpday-0.21.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