Declarative design spaces with a polars-like expression API.
A design space is the set of configurations a system can take: an algorithm,
a model, a process, or a physical assembly. A space is declared once, giving
the parameters, their domains, the condition under which each is active, and
the combinations that are legal. The resulting Space can then be sampled,
validated against, handed to a solver, serialized, or compared with another
space by fingerprint.
[!NOTE] This project is research software, and may contain bugs. Please open an issue if you encounter one!
[!IMPORTANT] This project uses AI-assisted development tools. Code contributions generated or modified with the help of AI tools are reviewed and tested by maintainers before release.
Example
>>> import designspace as ds
>>> space = ds.space(
... ds.param("optimizer").categorical("adam", "sgd"),
... ds.param("lr").real(1e-4, 1e-1).log_scale(), # shorthand for .prior(ds.Log())
... ds.param("momentum").real(0.0, 0.99).when(ds.param("optimizer") == "sgd"),
... )
>>> print(space)
Space: 3 params, 1 conditional, 0 constraints
optimizer categorical {'adam', 'sgd'}
lr real [0.0001, 0.1] log
momentum real [0.0, 0.99] when optimizer == 'sgd'
>>> sgd = space.sample_one(seed=0)
>>> sgd["optimizer"], "momentum" in sgd
('sgd', True)
>>> adam = space.sample_one(seed=3)
>>> adam["optimizer"], "momentum" in adam
('adam', False)
momentum is absent from the second configuration rather than present and
null. Conditionality is structural, not a mask applied afterwards.
Scope
designspace declares spaces and does not search them. It ships no search operators, no distance functions, no tree generators, and no algebraic normalization of expressions. No value is ever silently clamped: a value outside its domain is an error, never a rounded input.
Install
pip install designspace
Python 3.12 or later. DataFrame output needs the polars extra:
pip install "designspace[polars]"
Documentation
https://librelunch.github.io/designspace
Stability
While the major version is zero, a minor release may change the Python API.
The serialized format carries a version of its own, independent of the release
version, so a space written to JSON by one release reads back in every later
release that keeps that number. CHANGELOG.md says when it changes.
Development
Enter the development environment with devenv:
devenv shell
The commit gates install as git hooks on first entry: a fast subset on commit,
the full set before a push. Run them by hand with just gates.
API.md is the normative specification. It states the target rather than the current release, so it also describes surface that is not built yet. The documentation site describes what ships.
License
This project is licensed under the MIT License.
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 designspace-0.1.0.tar.gz.
File metadata
- Download URL: designspace-0.1.0.tar.gz
- Upload date:
- Size: 662.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dfac90687821d3aef9430b1de1427ece82947112ace6a5ad265327f427ee56a
|
|
| MD5 |
95d06a3d4a0f933e2384806010d6ef04
|
|
| BLAKE2b-256 |
32d70880c7235f190b44316579462714af104939a9c82e4a0556426264d4e271
|
Provenance
The following attestation bundles were made for designspace-0.1.0.tar.gz:
Publisher:
release.yml on librelunch/designspace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
designspace-0.1.0.tar.gz -
Subject digest:
9dfac90687821d3aef9430b1de1427ece82947112ace6a5ad265327f427ee56a - Sigstore transparency entry: 2425897686
- Sigstore integration time:
-
Permalink:
librelunch/designspace@126b18286ad989376400156b4e3f4a17b5e81c16 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/librelunch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@126b18286ad989376400156b4e3f4a17b5e81c16 -
Trigger Event:
push
-
Statement type:
File details
Details for the file designspace-0.1.0-py3-none-any.whl.
File metadata
- Download URL: designspace-0.1.0-py3-none-any.whl
- Upload date:
- Size: 280.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75719e6cdd7939c240863f958208e3b9c10b8890f0946b4b65e3f23fd60ff3e5
|
|
| MD5 |
03a60ab70d53ffe398954b5ed131b2c5
|
|
| BLAKE2b-256 |
132c2af31b18802e71280bb4a3c7030d01f31ddc7916aaed2eb85e1fc08004b7
|
Provenance
The following attestation bundles were made for designspace-0.1.0-py3-none-any.whl:
Publisher:
release.yml on librelunch/designspace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
designspace-0.1.0-py3-none-any.whl -
Subject digest:
75719e6cdd7939c240863f958208e3b9c10b8890f0946b4b65e3f23fd60ff3e5 - Sigstore transparency entry: 2425897967
- Sigstore integration time:
-
Permalink:
librelunch/designspace@126b18286ad989376400156b4e3f4a17b5e81c16 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/librelunch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@126b18286ad989376400156b4e3f4a17b5e81c16 -
Trigger Event:
push
-
Statement type: