Skip to main content

Dictionary-based, multi-dimensional parameter space iteration

Project description

The paramspace package is an open-source project and Python package that makes it possible to conveniently define dictionary-based, multi-dimensional parameter spaces and iterate over them.

Why?

In Python, dictionaries provide a powerful tool to control program behaviour. Frequently, these configuration structures take the shape of highly nested dictionaries, where each hierarchical level holds the information required at that point of the program.

However, it is frequently desired to instantiate some program not with a single set of parameters but with a set of parameters. Especially for scientific purposes, e.g. numerical simulations, it is often required to perform many instantiations of the same program with different parameters, so-called parameter sweeps. For simple configuration structures, this can be easily achieved by basic control flow tools; however, this becomes increasingly difficult the more parameters are desired to be sweeped over or the further nested they are in the configuration hierarchy.

This is where the paramspace package comes in.

How?

At its core, the paramspace package supplies the ParamSpace class, which accepts a dictionary-like object. To define parameter dimensions, individual entries within that dictionary can be replaced by a ParamDim object, regardless of the position and nestedness within the dictionary. The parameter space is then the cartesian product of all parameter dimensions, each parameter opening a new dimension of the parameter space.

When iterating over the space, each returned value is a dictionary with one combination of parameters, ready to be passed on to run the desired program. This allows retaining a hierarchical configuration structure while at the same time being able to conveniently perform sweeps over parameters, e.g. to spawn simulations with.

Furthermore, the paramspace package integrates tightly with YAML, making it very simple to define multidimensional parameter spaces directly in a configuration file.

Learn More

For more information, visit the project page and have a look at the README: https://gitlab.com/blsqr/paramspace

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

paramspace-2.5.8.tar.gz (41.6 kB view details)

Uploaded Source

Built Distribution

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

paramspace-2.5.8-py3-none-any.whl (39.3 kB view details)

Uploaded Python 3

File details

Details for the file paramspace-2.5.8.tar.gz.

File metadata

  • Download URL: paramspace-2.5.8.tar.gz
  • Upload date:
  • Size: 41.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.11

File hashes

Hashes for paramspace-2.5.8.tar.gz
Algorithm Hash digest
SHA256 ee6d4e26e91ca6c9aa679af5e5b8ba52ac46e031045a3e227a5115ad235b06b4
MD5 2928118e31582eede0af3fee84080515
BLAKE2b-256 0f466de99c6f7235753646cd546641b5aaa016d112bd4ff0d0e52c7be8efc851

See more details on using hashes here.

File details

Details for the file paramspace-2.5.8-py3-none-any.whl.

File metadata

  • Download URL: paramspace-2.5.8-py3-none-any.whl
  • Upload date:
  • Size: 39.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.11

File hashes

Hashes for paramspace-2.5.8-py3-none-any.whl
Algorithm Hash digest
SHA256 44b2c4d06543f24cf60ab34db0dc342daf0bf98c6bd981f82530e4f9ab640a26
MD5 d7002e38498f2468e68cfbe3f73a5e38
BLAKE2b-256 6e2718d03cd5b51147eeeb90f3de844c34f3d26e9e906cadaebdf772f2a603f7

See more details on using hashes here.

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