Skip to content

Commit 435e545

Browse files
authored
Update README.md
1 parent ef64ae5 commit 435e545

File tree

1 file changed

+31
-20
lines changed

1 file changed

+31
-20
lines changed

README.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This package is an extension to the SMT (Surrogate Modeling Toolbox), offering a
1010
## 🔍 What It Does
1111

1212
- **Hierarchical variables**: Support for nested conditional variables (e.g., a rotor configuration branch that only activates when `use_rotor = yes`).
13-
- **Mixed types**: Handles continuous, integer, categorical, meta and indicator variables uniformly.
13+
- **Mixed types**: Handles continuous, integer or categorical variables uniformly.
1414
- **Conditional activation**: Meta-variables powerfully control lower-level variable activation based on context.
1515
- **Graph-based design space representation**: Clean and intuitive implementation of complex, branching designs.
1616
- **Extensible subtress**: Easily add new types or layers of conditional logic.
@@ -43,27 +43,38 @@ The paper provides a comprehensive survey and introduces a unified graph-based m
4343
```bash
4444
pip install smt-design-space-ext
4545
```
46-
46+
https://pypi.org/project/smt-design-space-ext/
4747
---
4848

4949
## 🚀 Quick Start Example
5050

5151
```python
52-
from smt_design_space import DesignSpace
53-
54-
ds = DesignSpace()
55-
# Meta-variable to enable feature branching
56-
ds.add_categorical("enable_feature", ["yes", "no"])
57-
# Feature type only active if enabled
58-
ds.add_meta("feature_type",
59-
parent="enable_feature",
60-
active_if="yes",
61-
values=["typeA", "typeB"])
62-
# Parameter only active in typeA branch
63-
ds.add_numeric("featureA_param",
64-
parent="feature_type",
65-
active_if="typeA",
66-
bounds=(0.0, 1.0))
52+
from smt_design_space_ext import (
53+
HAS_CONFIG_SPACE,
54+
HAS_ADSG,
55+
AdsgDesignSpaceImpl,
56+
ConfigSpaceDesignSpaceImpl,
57+
BaseDesignSpace,
58+
CategoricalVariable,
59+
FloatVariable,
60+
IntegerVariable,
61+
OrdinalVariable,
62+
)
63+
64+
ds = ConfigSpaceDesignSpaceImpl(
65+
[
66+
CategoricalVariable(["A", "B", "C"]), # x0
67+
CategoricalVariable(["E", "F"]), # x1
68+
IntegerVariable(0, 1), # x2
69+
FloatVariable(0.1, 1), # x3
70+
],
71+
random_state=42,
72+
)
73+
ds.declare_decreed_var(
74+
decreed_var=3, meta_var=0, meta_value="A"
75+
) # Activate x3 if x0 == A
76+
77+
6778
```
6879

6980
This dynamically builds a tree-like structure of variables, enabling clear and constrained space exploration.
@@ -72,9 +83,9 @@ This dynamically builds a tree-like structure of variables, enabling clear and c
7283

7384
## 🧩 Integration
7485

75-
- Integrates readily with SMT’s Kriging and PyKriging modules.
76-
- Compatible with Bayesian, evolutionary, or gradient‑based optimizers.
77-
- Prepare space definitions for use with graph neural networks or surrogate modeling pipelines.
86+
- Integrates readily with SMT’s Kriging modules.
87+
- Compatible with Bayesian or gradient‑based optimizers.
88+
- Prepare space definitions for use with surrogate modeling pipelines.
7889

7990
---
8091

0 commit comments

Comments
 (0)