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

For use of paramspace, see utopya or the Utopia Project.

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.8.0.tar.gz (43.8 kB view details)

Uploaded Source

Built Distribution

paramspace-2.8.0-py3-none-any.whl (46.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: paramspace-2.8.0.tar.gz
  • Upload date:
  • Size: 43.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for paramspace-2.8.0.tar.gz
Algorithm Hash digest
SHA256 eeb6e36cd80755ad33309479fd50b32a3ff7083fd0a8c4a5049ff4054ce67587
MD5 4410e3574dd858f639608e734d81446e
BLAKE2b-256 ed6ef324e7a0c2017bf65b1f0b0ae4c8b0ce28dc73c62880eaa016160b9bf552

See more details on using hashes here.

File details

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

File metadata

  • Download URL: paramspace-2.8.0-py3-none-any.whl
  • Upload date:
  • Size: 46.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for paramspace-2.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d10f83d8df3a10db9e1a0e591a3751e42142b97adfd4ef049d90cea8c0736d5
MD5 75120d452a690993e004723d9bf318dd
BLAKE2b-256 d8bfda5bf774a7dc48d959383e9fba1426e16c0a7fc6b6b9e255bb82acd965a8

See more details on using hashes here.

Supported by

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