@@ -10,7 +10,7 @@ This package is an extension to the SMT (Surrogate Modeling Toolbox), offering a
10
10
## 🔍 What It Does
11
11
12
12
- ** 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.
14
14
- ** Conditional activation** : Meta-variables powerfully control lower-level variable activation based on context.
15
15
- ** Graph-based design space representation** : Clean and intuitive implementation of complex, branching designs.
16
16
- ** 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
43
43
``` bash
44
44
pip install smt-design-space-ext
45
45
```
46
-
46
+ https://pypi.org/project/smt-design-space-ext/
47
47
---
48
48
49
49
## 🚀 Quick Start Example
50
50
51
51
``` 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
+
67
78
```
68
79
69
80
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
72
83
73
84
## 🧩 Integration
74
85
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.
78
89
79
90
---
80
91
0 commit comments